Search in sources :

Example 41 with ITypedReferenceableInstance

use of org.apache.atlas.typesystem.ITypedReferenceableInstance in project incubator-atlas by apache.

the class GraphBackedRepositorySoftDeleteTest method assertProcessForTestDeleteReference.

@Override
protected void assertProcessForTestDeleteReference(ITypedReferenceableInstance expected) throws Exception {
    ITypedReferenceableInstance process = repositoryService.getEntityDefinition(expected.getId()._getId());
    List<ITypedReferenceableInstance> outputs = (List<ITypedReferenceableInstance>) process.get(AtlasClient.PROCESS_ATTRIBUTE_OUTPUTS);
    List<ITypedReferenceableInstance> expectedOutputs = (List<ITypedReferenceableInstance>) process.get(AtlasClient.PROCESS_ATTRIBUTE_OUTPUTS);
    assertEquals(outputs.size(), expectedOutputs.size());
}
Also used : ITypedReferenceableInstance(org.apache.atlas.typesystem.ITypedReferenceableInstance) List(java.util.List)

Example 42 with ITypedReferenceableInstance

use of org.apache.atlas.typesystem.ITypedReferenceableInstance in project incubator-atlas by apache.

the class GraphBackedRepositorySoftDeleteTest method assertTableForTestDeleteReference.

@Override
protected void assertTableForTestDeleteReference(String tableId) throws Exception {
    ITypedReferenceableInstance table = repositoryService.getEntityDefinition(tableId);
    assertNotNull(table.get(NAME));
    assertNotNull(table.get("description"));
    assertNotNull(table.get("type"));
    assertNotNull(table.get("tableType"));
    assertNotNull(table.get("created"));
    Id dbId = (Id) table.get("database");
    assertNotNull(dbId);
    ITypedReferenceableInstance db = repositoryService.getEntityDefinition(dbId.getId()._getId());
    assertNotNull(db);
    assertEquals(db.getId().getState(), Id.EntityState.ACTIVE);
}
Also used : ITypedReferenceableInstance(org.apache.atlas.typesystem.ITypedReferenceableInstance) Id(org.apache.atlas.typesystem.persistence.Id)

Example 43 with ITypedReferenceableInstance

use of org.apache.atlas.typesystem.ITypedReferenceableInstance in project incubator-atlas by apache.

the class GraphBackedRepositorySoftDeleteTest method assertTestLowerBoundsIgnoredOnCompositeDeletedEntities.

@Override
protected void assertTestLowerBoundsIgnoredOnCompositeDeletedEntities(String hrDeptGuid) throws Exception {
    ITypedReferenceableInstance hrDept = repositoryService.getEntityDefinition(hrDeptGuid);
    Assert.assertEquals(hrDept.getId().getState(), EntityState.DELETED);
}
Also used : ITypedReferenceableInstance(org.apache.atlas.typesystem.ITypedReferenceableInstance)

Example 44 with ITypedReferenceableInstance

use of org.apache.atlas.typesystem.ITypedReferenceableInstance in project incubator-atlas by apache.

the class GraphBackedRepositorySoftDeleteTest method assertTestDeleteEntityWithTraits.

@Override
protected void assertTestDeleteEntityWithTraits(String guid) throws Exception {
    ITypedReferenceableInstance instance = repositoryService.getEntityDefinition(guid);
    assertTrue(instance.getTraits().contains(PII));
}
Also used : ITypedReferenceableInstance(org.apache.atlas.typesystem.ITypedReferenceableInstance)

Example 45 with ITypedReferenceableInstance

use of org.apache.atlas.typesystem.ITypedReferenceableInstance in project incubator-atlas by apache.

the class GraphBackedRepositorySoftDeleteTest method assertTestDisconnectMapReferenceFromClassType.

@Override
protected void assertTestDisconnectMapReferenceFromClassType(String mapOwnerGuid) throws Exception {
    ITypedReferenceableInstance mapOwnerInstance = repositoryService.getEntityDefinition(mapOwnerGuid);
    Map<String, ITypedReferenceableInstance> map = (Map<String, ITypedReferenceableInstance>) mapOwnerInstance.get("map");
    assertNotNull(map);
    assertEquals(map.size(), 1);
    Map<String, ITypedReferenceableInstance> biMap = (Map<String, ITypedReferenceableInstance>) mapOwnerInstance.get("biMap");
    assertNotNull(biMap);
    assertEquals(biMap.size(), 1);
}
Also used : ITypedReferenceableInstance(org.apache.atlas.typesystem.ITypedReferenceableInstance) Map(java.util.Map)

Aggregations

ITypedReferenceableInstance (org.apache.atlas.typesystem.ITypedReferenceableInstance)142 Test (org.testng.annotations.Test)54 List (java.util.List)34 ArrayList (java.util.ArrayList)30 Id (org.apache.atlas.typesystem.persistence.Id)28 Referenceable (org.apache.atlas.typesystem.Referenceable)22 AtlasVertex (org.apache.atlas.repository.graphdb.AtlasVertex)21 ImmutableList (com.google.common.collect.ImmutableList)20 ClassType (org.apache.atlas.typesystem.types.ClassType)19 HashMap (java.util.HashMap)16 AtlasException (org.apache.atlas.AtlasException)16 IReferenceableInstance (org.apache.atlas.typesystem.IReferenceableInstance)16 ITypedStruct (org.apache.atlas.typesystem.ITypedStruct)14 EntityResult (org.apache.atlas.model.legacy.EntityResult)12 IStruct (org.apache.atlas.typesystem.IStruct)10 Map (java.util.Map)9 CreateUpdateEntitiesResult (org.apache.atlas.CreateUpdateEntitiesResult)9 AtlasEntity (org.apache.atlas.model.instance.AtlasEntity)9 RepositoryException (org.apache.atlas.repository.RepositoryException)9 BeforeTest (org.testng.annotations.BeforeTest)9