Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
db6d783a
Commit
db6d783a
authored
7 years ago
by
apoorvnaik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2596: Missing classification mapping for GlossaryTerm
Change-Id: I9f1e28601f37093686e0d9d236b87c4a03a9c512
parent
fe1c7a3b
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
AtlasGlossaryTermDTO.java
...e/atlas/repository/ogm/glossary/AtlasGlossaryTermDTO.java
+14
-0
GlossaryServiceTest.java
...t/java/org/apache/atlas/glossary/GlossaryServiceTest.java
+17
-0
UserProfileServiceTest.java
.../atlas/repository/userprofile/UserProfileServiceTest.java
+0
-1
No files found.
repository/src/main/java/org/apache/atlas/repository/ogm/glossary/AtlasGlossaryTermDTO.java
View file @
db6d783a
...
@@ -168,6 +168,13 @@ public class AtlasGlossaryTermDTO extends AbstractGlossaryDTO<AtlasGlossaryTerm>
...
@@ -168,6 +168,13 @@ public class AtlasGlossaryTermDTO extends AbstractGlossaryDTO<AtlasGlossaryTerm>
ret
.
setValidValuesFor
(
toRelatedTermIdsSet
(
validValuesFor
));
ret
.
setValidValuesFor
(
toRelatedTermIdsSet
(
validValuesFor
));
}
}
if
(
CollectionUtils
.
isNotEmpty
(
entity
.
getClassifications
()))
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Processing term classifications"
);
}
ret
.
setClassifications
(
entity
.
getClassifications
());
}
if
(
LOG
.
isDebugEnabled
())
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"<== AtlasGlossaryTermDTO.from() : {}"
,
ret
);
LOG
.
debug
(
"<== AtlasGlossaryTermDTO.from() : {}"
,
ret
);
}
}
...
@@ -206,6 +213,13 @@ public class AtlasGlossaryTermDTO extends AbstractGlossaryDTO<AtlasGlossaryTerm>
...
@@ -206,6 +213,13 @@ public class AtlasGlossaryTermDTO extends AbstractGlossaryDTO<AtlasGlossaryTerm>
ret
.
setAttribute
(
"examples"
,
obj
.
getExamples
());
ret
.
setAttribute
(
"examples"
,
obj
.
getExamples
());
ret
.
setAttribute
(
"abbreviation"
,
obj
.
getAbbreviation
());
ret
.
setAttribute
(
"abbreviation"
,
obj
.
getAbbreviation
());
if
(
CollectionUtils
.
isNotEmpty
(
obj
.
getClassifications
()))
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Processing term classifications"
);
}
ret
.
setClassifications
(
obj
.
getClassifications
());
}
if
(
LOG
.
isDebugEnabled
())
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"<== AtlasGlossaryTermDTO.toEntity() : {}"
,
ret
);
LOG
.
debug
(
"<== AtlasGlossaryTermDTO.toEntity() : {}"
,
ret
);
}
}
...
...
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/glossary/GlossaryServiceTest.java
View file @
db6d783a
...
@@ -29,10 +29,13 @@ import org.apache.atlas.model.glossary.relations.AtlasGlossaryHeader;
...
@@ -29,10 +29,13 @@ import org.apache.atlas.model.glossary.relations.AtlasGlossaryHeader;
import
org.apache.atlas.model.glossary.relations.AtlasRelatedCategoryHeader
;
import
org.apache.atlas.model.glossary.relations.AtlasRelatedCategoryHeader
;
import
org.apache.atlas.model.glossary.relations.AtlasRelatedTermHeader
;
import
org.apache.atlas.model.glossary.relations.AtlasRelatedTermHeader
;
import
org.apache.atlas.model.glossary.relations.AtlasTermCategorizationHeader
;
import
org.apache.atlas.model.glossary.relations.AtlasTermCategorizationHeader
;
import
org.apache.atlas.model.instance.AtlasClassification
;
import
org.apache.atlas.model.instance.AtlasEntity
;
import
org.apache.atlas.model.instance.AtlasEntity
;
import
org.apache.atlas.model.instance.AtlasEntityHeader
;
import
org.apache.atlas.model.instance.AtlasEntityHeader
;
import
org.apache.atlas.model.instance.AtlasRelatedObjectId
;
import
org.apache.atlas.model.instance.AtlasRelatedObjectId
;
import
org.apache.atlas.model.instance.EntityMutationResponse
;
import
org.apache.atlas.model.instance.EntityMutationResponse
;
import
org.apache.atlas.model.typedef.AtlasClassificationDef
;
import
org.apache.atlas.model.typedef.AtlasTypesDef
;
import
org.apache.atlas.repository.impexp.ZipFileResourceTestUtils
;
import
org.apache.atlas.repository.impexp.ZipFileResourceTestUtils
;
import
org.apache.atlas.repository.store.graph.AtlasEntityStore
;
import
org.apache.atlas.repository.store.graph.AtlasEntityStore
;
import
org.apache.atlas.repository.store.graph.v1.AtlasEntityStream
;
import
org.apache.atlas.repository.store.graph.v1.AtlasEntityStream
;
...
@@ -95,6 +98,15 @@ public class GlossaryServiceTest {
...
@@ -95,6 +98,15 @@ public class GlossaryServiceTest {
throw
new
SkipException
(
"SubjectArea model loading failed"
);
throw
new
SkipException
(
"SubjectArea model loading failed"
);
}
}
try
{
AtlasClassificationDef
classificationDef
=
new
AtlasClassificationDef
(
"TestClassification"
,
"Test only classification"
);
AtlasTypesDef
typesDef
=
new
AtlasTypesDef
();
typesDef
.
setClassificationDefs
(
Arrays
.
asList
(
classificationDef
));
typeDefStore
.
createTypesDef
(
typesDef
);
}
catch
(
AtlasBaseException
e
)
{
throw
new
SkipException
(
"Test classification creation failed"
);
}
// Glossary
// Glossary
bankGlossary
=
new
AtlasGlossary
();
bankGlossary
=
new
AtlasGlossary
();
bankGlossary
.
setQualifiedName
(
"testBankingGlossary"
);
bankGlossary
.
setQualifiedName
(
"testBankingGlossary"
);
...
@@ -342,6 +354,7 @@ public class GlossaryServiceTest {
...
@@ -342,6 +354,7 @@ public class GlossaryServiceTest {
@Test
(
groups
=
"Glossary.UPDATE"
,
dependsOnGroups
=
"Glossary.CREATE"
)
@Test
(
groups
=
"Glossary.UPDATE"
,
dependsOnGroups
=
"Glossary.CREATE"
)
public
void
testUpdateGlossaryTerm
()
{
public
void
testUpdateGlossaryTerm
()
{
List
<
AtlasGlossaryTerm
>
glossaryTerms
=
new
ArrayList
<>();
List
<
AtlasGlossaryTerm
>
glossaryTerms
=
new
ArrayList
<>();
AtlasClassification
classification
=
new
AtlasClassification
(
"TestClassification"
);
for
(
AtlasGlossaryTerm
term
:
Arrays
.
asList
(
checkingAccount
,
savingsAccount
,
fixedRateMortgage
,
adjustableRateMortgage
))
{
for
(
AtlasGlossaryTerm
term
:
Arrays
.
asList
(
checkingAccount
,
savingsAccount
,
fixedRateMortgage
,
adjustableRateMortgage
))
{
try
{
try
{
glossaryTerms
.
add
(
glossaryService
.
getTerm
(
term
.
getGuid
()));
glossaryTerms
.
add
(
glossaryService
.
getTerm
(
term
.
getGuid
()));
...
@@ -354,9 +367,13 @@ public class GlossaryServiceTest {
...
@@ -354,9 +367,13 @@ public class GlossaryServiceTest {
t
.
setShortDescription
(
"Updated short description"
);
t
.
setShortDescription
(
"Updated short description"
);
t
.
setLongDescription
(
"Updated long description"
);
t
.
setLongDescription
(
"Updated long description"
);
entityStore
.
addClassifications
(
t
.
getGuid
(),
Arrays
.
asList
(
classification
));
AtlasGlossaryTerm
updatedTerm
=
glossaryService
.
updateTerm
(
t
);
AtlasGlossaryTerm
updatedTerm
=
glossaryService
.
updateTerm
(
t
);
assertNotNull
(
updatedTerm
);
assertNotNull
(
updatedTerm
);
assertEquals
(
updatedTerm
.
getGuid
(),
t
.
getGuid
());
assertEquals
(
updatedTerm
.
getGuid
(),
t
.
getGuid
());
assertNotNull
(
updatedTerm
.
getClassifications
());
assertEquals
(
updatedTerm
.
getClassifications
().
size
(),
1
);
}
catch
(
AtlasBaseException
e
)
{
}
catch
(
AtlasBaseException
e
)
{
fail
(
"Glossary term fetch/update should've succeeded"
,
e
);
fail
(
"Glossary term fetch/update should've succeeded"
,
e
);
}
}
...
...
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/repository/userprofile/UserProfileServiceTest.java
View file @
db6d783a
...
@@ -251,7 +251,6 @@ public class UserProfileServiceTest {
...
@@ -251,7 +251,6 @@ public class UserProfileServiceTest {
List
<
AtlasUserSavedSearch
>
savedSearchList
=
userProfileService
.
getSavedSearches
(
userName
);
List
<
AtlasUserSavedSearch
>
savedSearchList
=
userProfileService
.
getSavedSearches
(
userName
);
assertEquals
(
savedSearchList
.
size
(),
new_max_searches
-
1
);
assertEquals
(
savedSearchList
.
size
(),
new_max_searches
-
1
);
}
}
@Test
(
dependsOnMethods
=
{
"createsNewProfile"
,
"savesMultipleQueriesForUser"
,
"verifyQueryNameListForUser"
})
@Test
(
dependsOnMethods
=
{
"createsNewProfile"
,
"savesMultipleQueriesForUser"
,
"verifyQueryNameListForUser"
})
void
deleteUser
()
throws
AtlasBaseException
{
void
deleteUser
()
throws
AtlasBaseException
{
String
userName
=
getIndexBasedUserName
(
1
);
String
userName
=
getIndexBasedUserName
(
1
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment