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
883251c0
Commit
883251c0
authored
Jun 22, 2015
by
Shwetha GS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-33 Atlas restart fails (shwethags)
parent
155554e6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
3 deletions
+27
-3
release-log.txt
release-log.txt
+1
-1
HierarchicalType.java
...a/org/apache/atlas/typesystem/types/HierarchicalType.java
+6
-2
TypeSystemTest.java
...ava/org/apache/atlas/typesystem/types/TypeSystemTest.java
+20
-0
No files found.
release-log.txt
View file @
883251c0
...
...
@@ -6,13 +6,13 @@ Apache Atlas Release Notes
INCOMPATIBLE CHANGES:
ALL CHANGES:
ATLAS-33 Atlas restart fails (shwethags)
ATLAS-10 Update trunk version to 0.6-incubating-SNAPSHOT (shwethags)
--Release 0.5-incubating
ALL CHANGES:
ATLAS-26 Minor issues with release prep (Venkatesh Seetharam)
ATLAS-17 Parameterize schema API query per typeName (shwethags)
ATLAS-13 Add project website (Venkatesh Seetharam)
...
...
typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalType.java
View file @
883251c0
...
...
@@ -340,13 +340,17 @@ public abstract class HierarchicalType<ST extends HierarchicalType, T> extends A
@Override
public
int
compareTo
(
ST
o
)
{
String
oName
=
o
.
getName
();
if
(
superTypes
.
contains
(
oName
))
{
try
{
if
(
o
.
isSubType
(
getName
()))
{
return
1
;
}
else
if
(
o
.
superTypes
.
contains
(
getName
()
))
{
}
else
if
(
isSubType
(
oName
))
{
return
-
1
;
}
else
{
return
getName
().
compareTo
(
oName
);
}
}
catch
(
AtlasException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
public
Set
<
String
>
getAllSuperTypeNames
()
{
...
...
typesystem/src/test/java/org/apache/atlas/typesystem/types/TypeSystemTest.java
View file @
883251c0
...
...
@@ -19,6 +19,7 @@
package
org
.
apache
.
atlas
.
typesystem
.
types
;
import
com.google.common.collect.ImmutableList
;
import
org.apache.atlas.AtlasException
;
import
org.apache.atlas.typesystem.types.utils.TypesUtil
;
import
org.apache.commons.lang3.RandomStringUtils
;
import
org.testng.Assert
;
...
...
@@ -118,4 +119,23 @@ public class TypeSystemTest extends BaseTest {
ts
.
defineTypes
(
ImmutableList
.
of
(
structType
),
ImmutableList
.
of
(
traitType
),
ImmutableList
.
of
(
classType
));
}
@Test
public
void
testHierarchy
()
throws
AtlasException
{
HierarchicalTypeDefinition
<
ClassType
>
a
=
TypesUtil
.
createClassTypeDef
(
"a"
,
ImmutableList
.<
String
>
of
());
HierarchicalTypeDefinition
<
ClassType
>
b
=
TypesUtil
.
createClassTypeDef
(
"B"
,
ImmutableList
.
of
(
"a"
));
HierarchicalTypeDefinition
<
ClassType
>
c
=
TypesUtil
.
createClassTypeDef
(
"C"
,
ImmutableList
.
of
(
"B"
));
TypeSystem
ts
=
getTypeSystem
();
ts
.
defineTypes
(
ImmutableList
.<
StructTypeDefinition
>
of
(),
ImmutableList
.<
HierarchicalTypeDefinition
<
TraitType
>>
of
(),
ImmutableList
.
of
(
a
,
b
,
c
));
ClassType
ac
=
ts
.
getDataType
(
ClassType
.
class
,
"a"
);
ClassType
bc
=
ts
.
getDataType
(
ClassType
.
class
,
"B"
);
ClassType
cc
=
ts
.
getDataType
(
ClassType
.
class
,
"C"
);
Assert
.
assertTrue
(
ac
.
compareTo
(
bc
)
<
0
);
Assert
.
assertTrue
(
bc
.
compareTo
(
cc
)
<
0
);
Assert
.
assertTrue
(
ac
.
compareTo
(
cc
)
<
0
);
}
}
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