Search in sources :

Example 61 with AtlasEntity

use of org.apache.atlas.model.instance.AtlasEntity in project incubator-atlas by apache.

the class ExportServiceTest method verifyExportForHrDataForConnected.

private void verifyExportForHrDataForConnected(ZipSource zipSource) throws IOException, AtlasBaseException {
    assertNotNull(zipSource.getCreationOrder());
    assertTrue(zipSource.getCreationOrder().size() == 2);
    assertTrue(zipSource.hasNext());
    AtlasEntity entity = zipSource.next();
    assertNotNull(entity);
    assertTrue(entity.getTypeName().equals("Department"));
    assertEquals(entity.getStatus(), AtlasEntity.Status.ACTIVE);
    verifyTypeDefs(zipSource);
}
Also used : AtlasEntity(org.apache.atlas.model.instance.AtlasEntity)

Example 62 with AtlasEntity

use of org.apache.atlas.model.instance.AtlasEntity in project incubator-atlas by apache.

the class ZipSourceTest method applyTransformation.

@Test(dataProvider = "zipFileStocks")
public void applyTransformation(ZipSource zipSource) throws IOException, AtlasBaseException {
    ImportTransforms transforms = getTransformForHiveDB();
    zipSource.setImportTransform(transforms);
    Assert.assertTrue(zipSource.hasNext());
    List<String> creationOrder = zipSource.getCreationOrder();
    for (int i = 0; i < creationOrder.size(); i++) {
        AtlasEntity e = zipSource.next();
        if (e.getTypeName().equals("hive_db")) {
            Object o = e.getAttribute("qualifiedName");
            String s = (String) o;
            assertNotNull(e);
            assertTrue(s.contains("@cl2"));
            break;
        }
    }
}
Also used : AtlasEntity(org.apache.atlas.model.instance.AtlasEntity) Test(org.testng.annotations.Test)

Example 63 with AtlasEntity

use of org.apache.atlas.model.instance.AtlasEntity in project incubator-atlas by apache.

the class ZipSourceTest method verifyGuidRemovalOnImportComplete.

private void verifyGuidRemovalOnImportComplete(ZipSource zipSource, String guid) {
    AtlasEntity e = zipSource.getByGuid(guid);
    assertNotNull(e);
    zipSource.onImportComplete(guid);
    e = zipSource.getByGuid(guid);
    Assert.assertNull(e);
}
Also used : AtlasEntity(org.apache.atlas.model.instance.AtlasEntity)

Example 64 with AtlasEntity

use of org.apache.atlas.model.instance.AtlasEntity in project incubator-atlas by apache.

the class ZipSourceTest method attemptToFetchNonExistentGuid_ReturnsNull.

private void attemptToFetchNonExistentGuid_ReturnsNull(ZipSource zipSource, String guid) {
    AtlasEntity e = zipSource.getByGuid(guid);
    Assert.assertNull(e);
}
Also used : AtlasEntity(org.apache.atlas.model.instance.AtlasEntity)

Example 65 with AtlasEntity

use of org.apache.atlas.model.instance.AtlasEntity in project incubator-atlas by apache.

the class ImportTransformsTest method getAtlasEntityWithExtInfo.

private AtlasEntityWithExtInfo getAtlasEntityWithExtInfo() {
    AtlasEntityWithExtInfo ret = new AtlasEntityWithExtInfo(getHiveTableAtlasEntity());
    Map<String, AtlasEntity> referredEntities = new HashMap<>();
    referredEntities.put("0", getHiveColumnAtlasEntity(1));
    referredEntities.put("1", getHiveColumnAtlasEntity(2));
    referredEntities.put("2", getHiveColumnAtlasEntity(3));
    ret.setReferredEntities(referredEntities);
    return ret;
}
Also used : AtlasEntityWithExtInfo(org.apache.atlas.model.instance.AtlasEntity.AtlasEntityWithExtInfo) HashMap(java.util.HashMap) AtlasEntity(org.apache.atlas.model.instance.AtlasEntity)

Aggregations

AtlasEntity (org.apache.atlas.model.instance.AtlasEntity)124 Test (org.testng.annotations.Test)58 EntityMutationResponse (org.apache.atlas.model.instance.EntityMutationResponse)43 AtlasEntityHeader (org.apache.atlas.model.instance.AtlasEntityHeader)36 HashMap (java.util.HashMap)25 BeforeTest (org.testng.annotations.BeforeTest)25 AtlasEntityWithExtInfo (org.apache.atlas.model.instance.AtlasEntity.AtlasEntityWithExtInfo)24 AtlasObjectId (org.apache.atlas.model.instance.AtlasObjectId)24 AtlasEntitiesWithExtInfo (org.apache.atlas.model.instance.AtlasEntity.AtlasEntitiesWithExtInfo)21 AtlasEntityType (org.apache.atlas.type.AtlasEntityType)17 ArrayList (java.util.ArrayList)16 AtlasBaseException (org.apache.atlas.exception.AtlasBaseException)14 Map (java.util.Map)12 List (java.util.List)11 AtlasTypesDef (org.apache.atlas.model.typedef.AtlasTypesDef)11 AtlasStruct (org.apache.atlas.model.instance.AtlasStruct)9 ITypedReferenceableInstance (org.apache.atlas.typesystem.ITypedReferenceableInstance)9 TestUtils.randomString (org.apache.atlas.TestUtils.randomString)7 AtlasEntityDef (org.apache.atlas.model.typedef.AtlasEntityDef)7 AtlasVertex (org.apache.atlas.repository.graphdb.AtlasVertex)7