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
8119492f
Commit
8119492f
authored
May 15, 2018
by
apoorvnaik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2679 #2
Change-Id: I00ce22fe7dc58ef193f9fe884a36316171abbcb2
parent
e48a4864
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
GlossaryService.java
.../main/java/org/apache/atlas/glossary/GlossaryService.java
+15
-6
GlossaryServiceTest.java
...t/java/org/apache/atlas/glossary/GlossaryServiceTest.java
+0
-4
No files found.
repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java
View file @
8119492f
...
@@ -136,7 +136,8 @@ public class GlossaryService {
...
@@ -136,7 +136,8 @@ public class GlossaryService {
if
(
StringUtils
.
isEmpty
(
atlasGlossary
.
getQualifiedName
()))
{
if
(
StringUtils
.
isEmpty
(
atlasGlossary
.
getQualifiedName
()))
{
if
(
StringUtils
.
isEmpty
(
atlasGlossary
.
getDisplayName
()))
{
if
(
StringUtils
.
isEmpty
(
atlasGlossary
.
getDisplayName
()))
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
GLOSSARY_QUALIFIED_NAME_CANT_BE_DERIVED
);
throw
new
AtlasBaseException
(
AtlasErrorCode
.
GLOSSARY_QUALIFIED_NAME_CANT_BE_DERIVED
);
}
else
if
(
isNameInvalid
(
atlasGlossary
.
getDisplayName
())){
}
if
(
isNameInvalid
(
atlasGlossary
.
getDisplayName
())){
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_DISPLAY_NAME
);
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_DISPLAY_NAME
);
}
else
{
}
else
{
atlasGlossary
.
setQualifiedName
(
atlasGlossary
.
getDisplayName
());
atlasGlossary
.
setQualifiedName
(
atlasGlossary
.
getDisplayName
());
...
@@ -326,11 +327,16 @@ public class GlossaryService {
...
@@ -326,11 +327,16 @@ public class GlossaryService {
if
(
Objects
.
isNull
(
glossaryTerm
.
getAnchor
()))
{
if
(
Objects
.
isNull
(
glossaryTerm
.
getAnchor
()))
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
MISSING_MANDATORY_ANCHOR
);
throw
new
AtlasBaseException
(
AtlasErrorCode
.
MISSING_MANDATORY_ANCHOR
);
}
}
if
(
StringUtils
.
isEmpty
(
glossaryTerm
.
getQualifiedName
()))
{
if
(
StringUtils
.
isEmpty
(
glossaryTerm
.
getDisplayName
()))
{
if
(
StringUtils
.
isEmpty
(
glossaryTerm
.
getDisplayName
()))
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
GLOSSARY_TERM_QUALIFIED_NAME_CANT_BE_DERIVED
);
throw
new
AtlasBaseException
(
AtlasErrorCode
.
GLOSSARY_TERM_QUALIFIED_NAME_CANT_BE_DERIVED
);
}
}
if
(
isNameInvalid
(
glossaryTerm
.
getDisplayName
()))
{
if
(
isNameInvalid
(
glossaryTerm
.
getDisplayName
())){
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_DISPLAY_NAME
);
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_DISPLAY_NAME
);
}
else
{
glossaryTerm
.
setQualifiedName
(
glossaryTerm
.
getDisplayName
());
}
}
}
// This might fail for the case when the term's qualifiedName has been updated and the duplicate request comes in with old name
// This might fail for the case when the term's qualifiedName has been updated and the duplicate request comes in with old name
...
@@ -507,13 +513,16 @@ public class GlossaryService {
...
@@ -507,13 +513,16 @@ public class GlossaryService {
if
(
Objects
.
isNull
(
glossaryCategory
.
getAnchor
()))
{
if
(
Objects
.
isNull
(
glossaryCategory
.
getAnchor
()))
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
MISSING_MANDATORY_ANCHOR
);
throw
new
AtlasBaseException
(
AtlasErrorCode
.
MISSING_MANDATORY_ANCHOR
);
}
}
if
(
Objects
.
isNull
(
glossaryCategory
.
getDisplayName
()))
{
if
(
StringUtils
.
isEmpty
(
glossaryCategory
.
getQualifiedName
()))
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
MISSING_CATEGORY_DISPLAY_NAME
);
if
(
StringUtils
.
isEmpty
(
glossaryCategory
.
getDisplayName
()))
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
GLOSSARY_CATEGORY_QUALIFIED_NAME_CANT_BE_DERIVED
);
}
}
if
(
isNameInvalid
(
glossaryCategory
.
getDisplayName
()))
{
if
(
isNameInvalid
(
glossaryCategory
.
getDisplayName
()))
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_DISPLAY_NAME
);
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_DISPLAY_NAME
);
}
else
{
glossaryCategory
.
setQualifiedName
(
glossaryCategory
.
getDisplayName
());
}
}
}
// This might fail for the case when the category's qualifiedName has been updated during a hierarchy change
// This might fail for the case when the category's qualifiedName has been updated during a hierarchy change
// and the duplicate request comes in with old name
// and the duplicate request comes in with old name
...
...
repository/src/test/java/org/apache/atlas/glossary/GlossaryServiceTest.java
View file @
8119492f
...
@@ -126,7 +126,6 @@ public class GlossaryServiceTest {
...
@@ -126,7 +126,6 @@ public class GlossaryServiceTest {
// Category
// Category
accountCategory
=
new
AtlasGlossaryCategory
();
accountCategory
=
new
AtlasGlossaryCategory
();
accountCategory
.
setQualifiedName
(
"acc@testBankingGlossary"
);
accountCategory
.
setDisplayName
(
"Account categorization"
);
accountCategory
.
setDisplayName
(
"Account categorization"
);
accountCategory
.
setShortDescription
(
"Short description"
);
accountCategory
.
setShortDescription
(
"Short description"
);
accountCategory
.
setLongDescription
(
"Long description"
);
accountCategory
.
setLongDescription
(
"Long description"
);
...
@@ -138,14 +137,12 @@ public class GlossaryServiceTest {
...
@@ -138,14 +137,12 @@ public class GlossaryServiceTest {
customerCategory
.
setLongDescription
(
"Long description"
);
customerCategory
.
setLongDescription
(
"Long description"
);
mortgageCategory
=
new
AtlasGlossaryCategory
();
mortgageCategory
=
new
AtlasGlossaryCategory
();
mortgageCategory
.
setQualifiedName
(
"mtg@testBankingGlossary"
);
mortgageCategory
.
setDisplayName
(
"Mortgage categorization"
);
mortgageCategory
.
setDisplayName
(
"Mortgage categorization"
);
mortgageCategory
.
setShortDescription
(
"Short description"
);
mortgageCategory
.
setShortDescription
(
"Short description"
);
mortgageCategory
.
setLongDescription
(
"Long description"
);
mortgageCategory
.
setLongDescription
(
"Long description"
);
// Terms
// Terms
checkingAccount
=
new
AtlasGlossaryTerm
();
checkingAccount
=
new
AtlasGlossaryTerm
();
checkingAccount
.
setQualifiedName
(
"chk_acc@testBankingGlossary"
);
checkingAccount
.
setDisplayName
(
"A checking account"
);
checkingAccount
.
setDisplayName
(
"A checking account"
);
checkingAccount
.
setShortDescription
(
"Short description"
);
checkingAccount
.
setShortDescription
(
"Short description"
);
checkingAccount
.
setLongDescription
(
"Long description"
);
checkingAccount
.
setLongDescription
(
"Long description"
);
...
@@ -163,7 +160,6 @@ public class GlossaryServiceTest {
...
@@ -163,7 +160,6 @@ public class GlossaryServiceTest {
savingsAccount
.
setUsage
(
"N/A"
);
savingsAccount
.
setUsage
(
"N/A"
);
fixedRateMortgage
=
new
AtlasGlossaryTerm
();
fixedRateMortgage
=
new
AtlasGlossaryTerm
();
fixedRateMortgage
.
setQualifiedName
(
"fixed_mtg@testBankingGlossary"
);
fixedRateMortgage
.
setDisplayName
(
"Conventional mortgage"
);
fixedRateMortgage
.
setDisplayName
(
"Conventional mortgage"
);
fixedRateMortgage
.
setShortDescription
(
"Short description"
);
fixedRateMortgage
.
setShortDescription
(
"Short description"
);
fixedRateMortgage
.
setLongDescription
(
"Long description"
);
fixedRateMortgage
.
setLongDescription
(
"Long description"
);
...
...
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