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);
}
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;
}
}
}
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);
}
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);
}
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;
}
Aggregations