use of org.apache.atlas.model.typedef.AtlasTypesDef in project atlas by apache.
the class ZipFileResourceTestUtils method loadModelFromResourcesJson.
public static void loadModelFromResourcesJson(String fileName, AtlasTypeDefStore typeDefStore, AtlasTypeRegistry typeRegistry) throws IOException, AtlasBaseException {
AtlasTypesDef typesFromJson = getAtlasTypesDefFromResourceFile(fileName);
createTypesAsNeeded(typesFromJson, typeDefStore, typeRegistry);
}
use of org.apache.atlas.model.typedef.AtlasTypesDef in project atlas by apache.
the class ZipFileResourceTestUtils method loadModelFromJson.
public static void loadModelFromJson(String fileName, AtlasTypeDefStore typeDefStore, AtlasTypeRegistry typeRegistry) throws IOException, AtlasBaseException {
AtlasTypesDef typesFromJson = getAtlasTypesDefFromFile(fileName);
createTypesAsNeeded(typesFromJson, typeDefStore, typeRegistry);
}
use of org.apache.atlas.model.typedef.AtlasTypesDef in project atlas by apache.
the class ZipSourceTest method examineContents_BehavesAsExpected.
@Test(dataProvider = "zipFileStocks")
public void examineContents_BehavesAsExpected(ZipSource zipSource) throws IOException, AtlasBaseException {
List<String> creationOrder = zipSource.getCreationOrder();
assertNotNull(creationOrder);
assertEquals(creationOrder.size(), 4);
AtlasTypesDef typesDef = zipSource.getTypesDef();
assertNotNull(typesDef);
assertEquals(typesDef.getEntityDefs().size(), 6);
useCreationOrderToFetchEntitiesWithExtInfo(zipSource, creationOrder);
useCreationOrderToFetchEntities(zipSource, creationOrder);
attemptToFetchNonExistentGuid_ReturnsNull(zipSource, "non-existent-guid");
verifyGuidRemovalOnImportComplete(zipSource, creationOrder.get(0));
}
use of org.apache.atlas.model.typedef.AtlasTypesDef in project atlas by apache.
the class ExportServiceTest method setupSampleData.
@BeforeClass
public void setupSampleData() throws AtlasBaseException {
entityStore = new AtlasEntityStoreV1(deleteHandler, typeRegistry, mockChangeNotifier, graphMapper);
;
AtlasTypesDef sampleTypes = TestUtilsV2.defineDeptEmployeeTypes();
AtlasTypesDef typesToCreate = AtlasTypeDefStoreInitializer.getTypesToCreate(sampleTypes, typeRegistry);
if (!typesToCreate.isEmpty()) {
typeDefStore.createTypesDef(typesToCreate);
}
AtlasEntity.AtlasEntitiesWithExtInfo hrDept = TestUtilsV2.createDeptEg2();
AtlasEntityStream entityStream = new AtlasEntityStream(hrDept);
entityStore.createOrUpdate(entityStream, false);
LOG.debug("==> setupSampleData: ", AtlasEntity.dumpObjects(hrDept.getEntities(), null).toString());
}
use of org.apache.atlas.model.typedef.AtlasTypesDef in project atlas by apache.
the class ExportService method processTypesDef.
private void processTypesDef(ExportContext context) {
AtlasTypesDef typesDef = context.result.getData().getTypesDef();
for (String entityType : context.entityTypes) {
AtlasEntityDef entityDef = typeRegistry.getEntityDefByName(entityType);
typesDef.getEntityDefs().add(entityDef);
}
for (String classificationType : context.classificationTypes) {
AtlasClassificationDef classificationDef = typeRegistry.getClassificationDefByName(classificationType);
typesDef.getClassificationDefs().add(classificationDef);
}
for (String structType : context.structTypes) {
AtlasStructDef structDef = typeRegistry.getStructDefByName(structType);
typesDef.getStructDefs().add(structDef);
}
for (String enumType : context.enumTypes) {
AtlasEnumDef enumDef = typeRegistry.getEnumDefByName(enumType);
typesDef.getEnumDefs().add(enumDef);
}
}
Aggregations