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
024fd221
Commit
024fd221
authored
7 years ago
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2079: Fix coverity scan issue and IT failures introduced by ATLAS-2062
parent
88eadb9b
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
84 additions
and
28 deletions
+84
-28
EntityMutationResponse.java
...g/apache/atlas/model/instance/EntityMutationResponse.java
+18
-0
AtlasEntityType.java
.../src/main/java/org/apache/atlas/type/AtlasEntityType.java
+2
-3
pom.xml
pom.xml
+2
-2
GraphHelper.java
...n/java/org/apache/atlas/repository/graph/GraphHelper.java
+2
-2
atlas-application.properties
typesystem/src/test/resources/atlas-application.properties
+5
-0
NotificationHookConsumerIT.java
...apache/atlas/notification/NotificationHookConsumerIT.java
+15
-14
EntityJerseyResourceIT.java
.../apache/atlas/web/integration/EntityJerseyResourceIT.java
+40
-7
No files found.
intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java
View file @
024fd221
...
@@ -33,6 +33,8 @@ import javax.xml.bind.annotation.XmlRootElement;
...
@@ -33,6 +33,8 @@ import javax.xml.bind.annotation.XmlRootElement;
import
org.apache.atlas.model.typedef.AtlasBaseTypeDef
;
import
org.apache.atlas.model.typedef.AtlasBaseTypeDef
;
import
org.apache.atlas.model.instance.EntityMutations.EntityOperation
;
import
org.apache.atlas.model.instance.EntityMutations.EntityOperation
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.codehaus.jackson.annotate.JsonAutoDetect
;
import
org.codehaus.jackson.annotate.JsonAutoDetect
;
import
org.codehaus.jackson.annotate.JsonIgnore
;
import
org.codehaus.jackson.annotate.JsonIgnore
;
import
org.codehaus.jackson.annotate.JsonIgnoreProperties
;
import
org.codehaus.jackson.annotate.JsonIgnoreProperties
;
...
@@ -200,9 +202,25 @@ public class EntityMutationResponse {
...
@@ -200,9 +202,25 @@ public class EntityMutationResponse {
mutatedEntities
.
put
(
op
,
opEntities
);
mutatedEntities
.
put
(
op
,
opEntities
);
}
}
if
(!
entityHeaderExists
(
opEntities
,
header
))
{
opEntities
.
add
(
header
);
opEntities
.
add
(
header
);
}
}
}
private
boolean
entityHeaderExists
(
List
<
AtlasEntityHeader
>
entityHeaders
,
AtlasEntityHeader
newEntityHeader
)
{
boolean
ret
=
false
;
if
(
CollectionUtils
.
isNotEmpty
(
entityHeaders
)
&&
newEntityHeader
!=
null
)
{
for
(
AtlasEntityHeader
entityHeader
:
entityHeaders
)
{
if
(
StringUtils
.
equals
(
entityHeader
.
getGuid
(),
newEntityHeader
.
getGuid
()))
{
ret
=
true
;
break
;
}
}
}
return
ret
;
}
public
StringBuilder
toString
(
StringBuilder
sb
)
{
public
StringBuilder
toString
(
StringBuilder
sb
)
{
if
(
sb
==
null
)
{
if
(
sb
==
null
)
{
...
...
This diff is collapsed.
Click to expand it.
intg/src/main/java/org/apache/atlas/type/AtlasEntityType.java
View file @
024fd221
...
@@ -621,9 +621,8 @@ public class AtlasEntityType extends AtlasStructType {
...
@@ -621,9 +621,8 @@ public class AtlasEntityType extends AtlasStructType {
AtlasEntity
entityObj
=
(
AtlasEntity
)
obj
;
AtlasEntity
entityObj
=
(
AtlasEntity
)
obj
;
for
(
AtlasAttribute
attribute
:
relationshipAttributes
.
values
())
{
for
(
AtlasAttribute
attribute
:
relationshipAttributes
.
values
())
{
String
attributeName
=
attribute
.
getName
();
if
(
attribute
!=
null
)
{
if
(
attribute
!=
null
)
{
String
attributeName
=
attribute
.
getName
();
AtlasType
dataType
=
attribute
.
getAttributeType
();
AtlasType
dataType
=
attribute
.
getAttributeType
();
Object
value
=
entityObj
.
getAttribute
(
attributeName
);
Object
value
=
entityObj
.
getAttribute
(
attributeName
);
String
fieldName
=
objName
+
"."
+
attributeName
;
String
fieldName
=
objName
+
"."
+
attributeName
;
...
@@ -638,9 +637,9 @@ public class AtlasEntityType extends AtlasStructType {
...
@@ -638,9 +637,9 @@ public class AtlasEntityType extends AtlasStructType {
Map
attributes
=
AtlasTypeUtil
.
toStructAttributes
((
Map
)
obj
);
Map
attributes
=
AtlasTypeUtil
.
toStructAttributes
((
Map
)
obj
);
for
(
AtlasAttribute
attribute
:
relationshipAttributes
.
values
())
{
for
(
AtlasAttribute
attribute
:
relationshipAttributes
.
values
())
{
String
attributeName
=
attribute
.
getName
();
if
(
attribute
!=
null
)
{
if
(
attribute
!=
null
)
{
String
attributeName
=
attribute
.
getName
();
AtlasType
dataType
=
attribute
.
getAttributeType
();
AtlasType
dataType
=
attribute
.
getAttributeType
();
Object
value
=
attributes
.
get
(
attributeName
);
Object
value
=
attributes
.
get
(
attributeName
);
String
fieldName
=
objName
+
"."
+
attributeName
;
String
fieldName
=
objName
+
"."
+
attributeName
;
...
...
This diff is collapsed.
Click to expand it.
pom.xml
View file @
024fd221
...
@@ -1922,7 +1922,7 @@
...
@@ -1922,7 +1922,7 @@
<log4j.configuration>
atlas-log4j.xml
</log4j.configuration>
<log4j.configuration>
atlas-log4j.xml
</log4j.configuration>
</systemProperties>
</systemProperties>
<skipTests>
${skipTests}
</skipTests>
<skipTests>
${skipTests}
</skipTests>
<forkCount>
2
C
</forkCount>
<forkCount>
1
C
</forkCount>
<reuseForks>
false
</reuseForks>
<reuseForks>
false
</reuseForks>
<redirectTestOutputToFile>
true
</redirectTestOutputToFile>
<redirectTestOutputToFile>
true
</redirectTestOutputToFile>
<argLine>
-Djava.awt.headless=true -Dproject.version=${project.version}
<argLine>
-Djava.awt.headless=true -Dproject.version=${project.version}
...
@@ -2087,7 +2087,7 @@
...
@@ -2087,7 +2087,7 @@
<goals>
<goals>
<goal>
check
</goal>
<goal>
check
</goal>
</goals>
</goals>
<phase>
v
erify
</phase>
<phase>
v
alidate
</phase>
</execution>
</execution>
</executions>
</executions>
</plugin>
</plugin>
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
View file @
024fd221
...
@@ -597,12 +597,12 @@ public final class GraphHelper {
...
@@ -597,12 +597,12 @@ public final class GraphHelper {
}
}
public
AtlasEdge
getEdgeForGUID
(
String
guid
)
throws
AtlasBaseException
{
public
AtlasEdge
getEdgeForGUID
(
String
guid
)
throws
AtlasBaseException
{
AtlasEdge
ret
=
null
;
AtlasEdge
ret
;
try
{
try
{
ret
=
findEdge
(
Constants
.
GUID_PROPERTY_KEY
,
guid
);
ret
=
findEdge
(
Constants
.
GUID_PROPERTY_KEY
,
guid
);
}
catch
(
EntityNotFoundException
e
)
{
}
catch
(
EntityNotFoundException
e
)
{
new
AtlasBaseException
(
AtlasErrorCode
.
RELATIONSHIP_GUID_NOT_FOUND
,
guid
);
throw
new
AtlasBaseException
(
AtlasErrorCode
.
RELATIONSHIP_GUID_NOT_FOUND
,
guid
);
}
}
return
ret
;
return
ret
;
...
...
This diff is collapsed.
Click to expand it.
typesystem/src/test/resources/atlas-application.properties
View file @
024fd221
...
@@ -139,3 +139,7 @@ atlas.authentication.method.file=true
...
@@ -139,3 +139,7 @@ atlas.authentication.method.file=true
atlas.authentication.method.ldap.type
=
none
atlas.authentication.method.ldap.type
=
none
# atlas.authentication.method.file.filename=users-credentials.properties
# atlas.authentication.method.file.filename=users-credentials.properties
atlas.authentication.method.kerberos
=
false
atlas.authentication.method.kerberos
=
false
######### Gremlin Search Configuration #########
# Set to false to disable gremlin search.
atlas.search.gremlin.enable
=
true
\ No newline at end of file
This diff is collapsed.
Click to expand it.
webapp/src/test/java/org/apache/atlas/notification/NotificationHookConsumerIT.java
View file @
024fd221
...
@@ -21,6 +21,11 @@ package org.apache.atlas.notification;
...
@@ -21,6 +21,11 @@ package org.apache.atlas.notification;
import
org.apache.atlas.EntityAuditEvent
;
import
org.apache.atlas.EntityAuditEvent
;
import
org.apache.atlas.kafka.NotificationProvider
;
import
org.apache.atlas.kafka.NotificationProvider
;
import
org.apache.atlas.notification.hook.HookNotification
;
import
org.apache.atlas.notification.hook.HookNotification
;
import
org.apache.atlas.notification.hook.HookNotification.HookNotificationMessage
;
import
org.apache.atlas.notification.hook.HookNotification.EntityDeleteRequest
;
import
org.apache.atlas.notification.hook.HookNotification.EntityPartialUpdateRequest
;
import
org.apache.atlas.notification.hook.HookNotification.EntityCreateRequest
;
import
org.apache.atlas.notification.hook.HookNotification.EntityUpdateRequest
;
import
org.apache.atlas.typesystem.Referenceable
;
import
org.apache.atlas.typesystem.Referenceable
;
import
org.apache.atlas.typesystem.persistence.Id
;
import
org.apache.atlas.typesystem.persistence.Id
;
import
org.apache.atlas.web.integration.BaseResourceIT
;
import
org.apache.atlas.web.integration.BaseResourceIT
;
...
@@ -31,6 +36,7 @@ import org.testng.annotations.Test;
...
@@ -31,6 +36,7 @@ import org.testng.annotations.Test;
import
java.util.List
;
import
java.util.List
;
import
static
java
.
lang
.
Thread
.
sleep
;
import
static
org
.
testng
.
Assert
.
assertEquals
;
import
static
org
.
testng
.
Assert
.
assertEquals
;
public
class
NotificationHookConsumerIT
extends
BaseResourceIT
{
public
class
NotificationHookConsumerIT
extends
BaseResourceIT
{
...
@@ -54,8 +60,9 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
...
@@ -54,8 +60,9 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
notificationInterface
.
close
();
notificationInterface
.
close
();
}
}
private
void
sendHookMessage
(
HookNotification
.
HookNotificationMessage
message
)
throws
Notification
Exception
{
private
void
sendHookMessage
(
HookNotification
Message
message
)
throws
NotificationException
,
Interrupted
Exception
{
notificationInterface
.
send
(
NotificationInterface
.
NotificationType
.
HOOK
,
message
);
notificationInterface
.
send
(
NotificationInterface
.
NotificationType
.
HOOK
,
message
);
sleep
(
1000
);
}
}
@Test
@Test
...
@@ -71,8 +78,7 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
...
@@ -71,8 +78,7 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
entity
.
set
(
DESCRIPTION
,
randomString
());
entity
.
set
(
DESCRIPTION
,
randomString
());
entity
.
set
(
QUALIFIED_NAME
,
dbName
);
entity
.
set
(
QUALIFIED_NAME
,
dbName
);
entity
.
set
(
CLUSTER_NAME
,
randomString
());
entity
.
set
(
CLUSTER_NAME
,
randomString
());
sendHookMessage
(
new
HookNotification
.
EntityCreateRequest
(
TEST_USER
,
entity
));
sendHookMessage
(
new
EntityCreateRequest
(
TEST_USER
,
entity
));
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
@Override
@Override
public
boolean
evaluate
()
throws
Exception
{
public
boolean
evaluate
()
throws
Exception
{
...
@@ -91,8 +97,7 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
...
@@ -91,8 +97,7 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
entity
.
set
(
QUALIFIED_NAME
,
dbName
);
entity
.
set
(
QUALIFIED_NAME
,
dbName
);
entity
.
set
(
CLUSTER_NAME
,
randomString
());
entity
.
set
(
CLUSTER_NAME
,
randomString
());
sendHookMessage
(
new
HookNotification
.
EntityCreateRequest
(
TEST_USER
,
entity
));
sendHookMessage
(
new
EntityCreateRequest
(
TEST_USER
,
entity
));
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
@Override
@Override
public
boolean
evaluate
()
throws
Exception
{
public
boolean
evaluate
()
throws
Exception
{
...
@@ -103,8 +108,7 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
...
@@ -103,8 +108,7 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
//Assert that user passed in hook message is used in audit
//Assert that user passed in hook message is used in audit
Referenceable
instance
=
atlasClientV1
.
getEntity
(
DATABASE_TYPE_BUILTIN
,
QUALIFIED_NAME
,
(
String
)
entity
.
get
(
QUALIFIED_NAME
));
Referenceable
instance
=
atlasClientV1
.
getEntity
(
DATABASE_TYPE_BUILTIN
,
QUALIFIED_NAME
,
(
String
)
entity
.
get
(
QUALIFIED_NAME
));
List
<
EntityAuditEvent
>
events
=
List
<
EntityAuditEvent
>
events
=
atlasClientV1
.
getEntityAuditEvents
(
instance
.
getId
().
_getId
(),
(
short
)
1
);
atlasClientV1
.
getEntityAuditEvents
(
instance
.
getId
().
_getId
(),
(
short
)
1
);
assertEquals
(
events
.
size
(),
1
);
assertEquals
(
events
.
size
(),
1
);
assertEquals
(
events
.
get
(
0
).
getUser
(),
TEST_USER
);
assertEquals
(
events
.
get
(
0
).
getUser
(),
TEST_USER
);
}
}
...
@@ -122,8 +126,7 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
...
@@ -122,8 +126,7 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
final
Referenceable
newEntity
=
new
Referenceable
(
DATABASE_TYPE_BUILTIN
);
final
Referenceable
newEntity
=
new
Referenceable
(
DATABASE_TYPE_BUILTIN
);
newEntity
.
set
(
"owner"
,
randomString
());
newEntity
.
set
(
"owner"
,
randomString
());
sendHookMessage
(
sendHookMessage
(
new
EntityPartialUpdateRequest
(
TEST_USER
,
DATABASE_TYPE_BUILTIN
,
QUALIFIED_NAME
,
dbName
,
newEntity
));
new
HookNotification
.
EntityPartialUpdateRequest
(
TEST_USER
,
DATABASE_TYPE_BUILTIN
,
QUALIFIED_NAME
,
dbName
,
newEntity
));
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
@Override
@Override
public
boolean
evaluate
()
throws
Exception
{
public
boolean
evaluate
()
throws
Exception
{
...
@@ -152,8 +155,7 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
...
@@ -152,8 +155,7 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
final
String
newName
=
"db"
+
randomString
();
final
String
newName
=
"db"
+
randomString
();
newEntity
.
set
(
QUALIFIED_NAME
,
newName
);
newEntity
.
set
(
QUALIFIED_NAME
,
newName
);
sendHookMessage
(
sendHookMessage
(
new
EntityPartialUpdateRequest
(
TEST_USER
,
DATABASE_TYPE_BUILTIN
,
QUALIFIED_NAME
,
dbName
,
newEntity
));
new
HookNotification
.
EntityPartialUpdateRequest
(
TEST_USER
,
DATABASE_TYPE_BUILTIN
,
QUALIFIED_NAME
,
dbName
,
newEntity
));
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
@Override
@Override
public
boolean
evaluate
()
throws
Exception
{
public
boolean
evaluate
()
throws
Exception
{
...
@@ -179,8 +181,7 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
...
@@ -179,8 +181,7 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
final
String
dbId
=
atlasClientV1
.
createEntity
(
entity
).
get
(
0
);
final
String
dbId
=
atlasClientV1
.
createEntity
(
entity
).
get
(
0
);
sendHookMessage
(
sendHookMessage
(
new
EntityDeleteRequest
(
TEST_USER
,
DATABASE_TYPE_BUILTIN
,
QUALIFIED_NAME
,
dbName
));
new
HookNotification
.
EntityDeleteRequest
(
TEST_USER
,
DATABASE_TYPE_BUILTIN
,
QUALIFIED_NAME
,
dbName
));
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
@Override
@Override
public
boolean
evaluate
()
throws
Exception
{
public
boolean
evaluate
()
throws
Exception
{
...
@@ -209,7 +210,7 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
...
@@ -209,7 +210,7 @@ public class NotificationHookConsumerIT extends BaseResourceIT {
newEntity
.
set
(
CLUSTER_NAME
,
randomString
());
newEntity
.
set
(
CLUSTER_NAME
,
randomString
());
//updating unique attribute
//updating unique attribute
sendHookMessage
(
new
HookNotification
.
EntityUpdateRequest
(
TEST_USER
,
newEntity
));
sendHookMessage
(
new
EntityUpdateRequest
(
TEST_USER
,
newEntity
));
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
waitFor
(
MAX_WAIT_TIME
,
new
Predicate
()
{
@Override
@Override
public
boolean
evaluate
()
throws
Exception
{
public
boolean
evaluate
()
throws
Exception
{
...
...
This diff is collapsed.
Click to expand it.
webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
View file @
024fd221
...
@@ -842,7 +842,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
...
@@ -842,7 +842,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
@Test
@Test
public
void
testPartialUpdate
()
throws
Exception
{
public
void
testPartialUpdate
ByGuid
()
throws
Exception
{
String
dbName
=
"db"
+
randomString
();
String
dbName
=
"db"
+
randomString
();
String
tableName
=
"table"
+
randomString
();
String
tableName
=
"table"
+
randomString
();
Referenceable
hiveDBInstance
=
createHiveDBInstanceBuiltIn
(
dbName
);
Referenceable
hiveDBInstance
=
createHiveDBInstanceBuiltIn
(
dbName
);
...
@@ -878,30 +878,63 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
...
@@ -878,30 +878,63 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
LOG
.
debug
(
"Updating entity= {}"
,
tableUpdated
);
LOG
.
debug
(
"Updating entity= {}"
,
tableUpdated
);
EntityResult
entityResult
=
atlasClientV1
.
updateEntity
(
guid
,
tableUpdated
);
EntityResult
entityResult
=
atlasClientV1
.
updateEntity
(
guid
,
tableUpdated
);
assertEquals
(
entityResult
.
getUpdateEntities
().
size
(),
1
);
assertEquals
(
entityResult
.
getUpdateEntities
().
size
(),
2
);
assertEquals
(
entityResult
.
getUpdateEntities
().
get
(
0
),
guid
);
assertEquals
(
entityResult
.
getUpdateEntities
().
get
(
1
),
guid
);
Referenceable
entity
=
atlasClientV1
.
getEntity
(
guid
);
Referenceable
entity
=
atlasClientV1
.
getEntity
(
guid
);
List
<
Referenceable
>
refs
=
(
List
<
Referenceable
>)
entity
.
get
(
"columns"
);
List
<
Referenceable
>
refs
=
(
List
<
Referenceable
>)
entity
.
get
(
"columns"
);
Assert
.
assertTrue
(
refs
.
get
(
0
).
equalsContents
(
columns
.
get
(
0
)));
Assert
.
assertTrue
(
refs
.
get
(
0
).
equalsContents
(
columns
.
get
(
0
)));
}
@Test
public
void
testPartialUpdateByUniqueAttributes
()
throws
Exception
{
String
dbName
=
"db"
+
randomString
();
String
tableName
=
"table"
+
randomString
();
Referenceable
hiveDBInstance
=
createHiveDBInstanceBuiltIn
(
dbName
);
Id
dbId
=
createInstance
(
hiveDBInstance
);
Referenceable
hiveTableInstance
=
createHiveTableInstanceBuiltIn
(
dbName
,
tableName
,
dbId
);
Id
tableId
=
createInstance
(
hiveTableInstance
);
final
String
guid
=
tableId
.
_getId
();
try
{
Assert
.
assertNotNull
(
UUID
.
fromString
(
guid
));
}
catch
(
IllegalArgumentException
e
)
{
Assert
.
fail
(
"Response is not a guid, "
+
guid
);
}
String
colName
=
"col1"
+
randomString
();
final
List
<
Referenceable
>
columns
=
new
ArrayList
<>();
Map
<
String
,
Object
>
values
=
new
HashMap
<>();
values
.
put
(
NAME
,
colName
);
values
.
put
(
"comment"
,
"col1 comment"
);
values
.
put
(
QUALIFIED_NAME
,
"default.table.col1@"
+
colName
);
values
.
put
(
"comment"
,
"col1 comment"
);
values
.
put
(
"type"
,
"string"
);
values
.
put
(
"owner"
,
"user1"
);
values
.
put
(
"position"
,
0
);
values
.
put
(
"description"
,
"col1"
);
values
.
put
(
"table"
,
tableId
);
//table is a required reference, can't be null
Referenceable
ref
=
new
Referenceable
(
BaseResourceIT
.
COLUMN_TYPE_BUILTIN
,
values
);
columns
.
add
(
ref
);
//Update by unique attribute
//Update by unique attribute
values
.
put
(
"type"
,
"int"
);
values
.
put
(
"type"
,
"int"
);
ref
=
new
Referenceable
(
BaseResourceIT
.
COLUMN_TYPE_BUILTIN
,
values
);
ref
=
new
Referenceable
(
BaseResourceIT
.
COLUMN_TYPE_BUILTIN
,
values
);
columns
.
set
(
0
,
ref
);
columns
.
set
(
0
,
ref
);
tableUpdated
=
new
Referenceable
(
BaseResourceIT
.
HIVE_TABLE_TYPE_BUILTIN
,
new
HashMap
<
String
,
Object
>()
{{
Referenceable
tableUpdated
=
new
Referenceable
(
BaseResourceIT
.
HIVE_TABLE_TYPE_BUILTIN
,
new
HashMap
<
String
,
Object
>()
{{
put
(
"columns"
,
columns
);
put
(
"columns"
,
columns
);
}});
}});
LOG
.
debug
(
"Updating entity= {}"
,
tableUpdated
);
LOG
.
debug
(
"Updating entity= {}"
,
tableUpdated
);
entityResult
=
atlasClientV1
.
updateEntity
(
BaseResourceIT
.
HIVE_TABLE_TYPE_BUILTIN
,
AtlasClient
.
REFERENCEABLE_ATTRIBUTE_NAME
,
EntityResult
entityResult
=
atlasClientV1
.
updateEntity
(
BaseResourceIT
.
HIVE_TABLE_TYPE_BUILTIN
,
AtlasClient
.
REFERENCEABLE_ATTRIBUTE_NAME
,
(
String
)
hiveTableInstance
.
get
(
QUALIFIED_NAME
),
tableUpdated
);
(
String
)
hiveTableInstance
.
get
(
QUALIFIED_NAME
),
tableUpdated
);
assertEquals
(
entityResult
.
getUpdateEntities
().
size
(),
2
);
assertEquals
(
entityResult
.
getUpdateEntities
().
size
(),
2
);
assertEquals
(
entityResult
.
getUpdateEntities
().
get
(
1
),
guid
);
assertEquals
(
entityResult
.
getUpdateEntities
().
get
(
1
),
guid
);
entity
=
atlasClientV1
.
getEntity
(
guid
);
Referenceable
entity
=
atlasClientV1
.
getEntity
(
guid
);
refs
=
(
List
<
Referenceable
>)
entity
.
get
(
"columns"
);
List
<
Referenceable
>
refs
=
(
List
<
Referenceable
>)
entity
.
get
(
"columns"
);
Assert
.
assertTrue
(
refs
.
get
(
0
).
getValuesMap
().
equals
(
values
));
Assert
.
assertTrue
(
refs
.
get
(
0
).
getValuesMap
().
equals
(
values
));
Assert
.
assertEquals
(
refs
.
get
(
0
).
get
(
"type"
),
"int"
);
Assert
.
assertEquals
(
refs
.
get
(
0
).
get
(
"type"
),
"int"
);
...
...
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