use of org.apache.atlas.model.typedef.AtlasTypesDef in project incubator-atlas by apache.
the class AtlasTypeDefGraphStoreTest method testGet.
@Test(priority = 1)
public void testGet() {
try {
AtlasTypesDef typesDef = typeDefStore.searchTypesDef(new SearchFilter());
assertNotNull(typesDef.getEnumDefs());
assertEquals(typesDef.getStructDefs().size(), 0);
assertNotNull(typesDef.getStructDefs());
assertEquals(typesDef.getClassificationDefs().size(), 0);
assertNotNull(typesDef.getClassificationDefs());
assertEquals(typesDef.getEntityDefs().size(), 0);
assertNotNull(typesDef.getEntityDefs());
} catch (AtlasBaseException e) {
fail("Search of types shouldn't have failed");
}
}
use of org.apache.atlas.model.typedef.AtlasTypesDef in project incubator-atlas by apache.
the class AtlasTypeDefGraphStoreTest method testUpdate.
@Test(dependsOnMethods = { "testCreateDept" }, dataProvider = "validUpdateDeptTypes")
public void testUpdate(AtlasTypesDef atlasTypesDef) {
try {
AtlasTypesDef updatedTypesDef = typeDefStore.updateTypesDef(atlasTypesDef);
assertNotNull(updatedTypesDef);
assertEquals(updatedTypesDef.getEnumDefs().size(), atlasTypesDef.getEnumDefs().size(), "EnumDefs update failed");
assertEquals(updatedTypesDef.getClassificationDefs().size(), atlasTypesDef.getClassificationDefs().size(), "ClassificationDef update failed");
assertEquals(updatedTypesDef.getStructDefs().size(), atlasTypesDef.getStructDefs().size(), "StructDef update failed");
assertEquals(updatedTypesDef.getEntityDefs().size(), atlasTypesDef.getEntityDefs().size(), "EntityDef update failed");
// Try another update round by name and GUID
for (AtlasEnumDef enumDef : updatedTypesDef.getEnumDefs()) {
AtlasEnumDef updated = typeDefStore.updateEnumDefByGuid(enumDef.getGuid(), enumDef);
assertNotNull(updated);
}
for (AtlasEnumDef enumDef : atlasTypesDef.getEnumDefs()) {
AtlasEnumDef updated = typeDefStore.updateEnumDefByName(enumDef.getName(), enumDef);
assertNotNull(updated);
}
// Try another update round by name and GUID
for (AtlasClassificationDef classificationDef : updatedTypesDef.getClassificationDefs()) {
AtlasClassificationDef updated = typeDefStore.updateClassificationDefByGuid(classificationDef.getGuid(), classificationDef);
assertNotNull(updated);
}
for (AtlasClassificationDef classificationDef : atlasTypesDef.getClassificationDefs()) {
AtlasClassificationDef updated = typeDefStore.updateClassificationDefByName(classificationDef.getName(), classificationDef);
assertNotNull(updated);
}
// Try another update round by name and GUID
for (AtlasStructDef structDef : updatedTypesDef.getStructDefs()) {
AtlasStructDef updated = typeDefStore.updateStructDefByGuid(structDef.getGuid(), structDef);
assertNotNull(updated);
}
for (AtlasStructDef structDef : atlasTypesDef.getStructDefs()) {
AtlasStructDef updated = typeDefStore.updateStructDefByName(structDef.getName(), structDef);
assertNotNull(updated);
}
// Try another update round by name and GUID
for (AtlasEntityDef entityDef : updatedTypesDef.getEntityDefs()) {
AtlasEntityDef updated = typeDefStore.updateEntityDefByGuid(entityDef.getGuid(), entityDef);
assertNotNull(updated);
}
for (AtlasEntityDef entityDef : atlasTypesDef.getEntityDefs()) {
AtlasEntityDef updated = typeDefStore.updateEntityDefByName(entityDef.getName(), entityDef);
assertNotNull(updated);
}
} catch (AtlasBaseException e) {
fail("TypeDef updates should've succeeded");
}
}
use of org.apache.atlas.model.typedef.AtlasTypesDef in project incubator-atlas by apache.
the class AtlasClientV2 method createEntityDef.
@Deprecated
public AtlasEntityDef createEntityDef(AtlasEntityDef entityDef) throws AtlasServiceException {
AtlasTypesDef atlasTypesDef = new AtlasTypesDef();
atlasTypesDef.getEntityDefs().add(entityDef);
AtlasTypesDef created = createAtlasTypeDefs(atlasTypesDef);
assert created != null;
assert created.getEntityDefs() != null;
return created.getEntityDefs().get(0);
}
use of org.apache.atlas.model.typedef.AtlasTypesDef in project incubator-atlas by apache.
the class AtlasClientV2 method createEnumDef.
@Deprecated
public AtlasEnumDef createEnumDef(AtlasEnumDef enumDef) throws AtlasServiceException {
AtlasTypesDef atlasTypesDef = new AtlasTypesDef();
atlasTypesDef.getEnumDefs().add(enumDef);
AtlasTypesDef created = createAtlasTypeDefs(atlasTypesDef);
assert created != null;
assert created.getEnumDefs() != null;
return created.getEnumDefs().get(0);
}
use of org.apache.atlas.model.typedef.AtlasTypesDef in project incubator-atlas by apache.
the class AtlasClientV2 method createStructDef.
@Deprecated
public AtlasStructDef createStructDef(AtlasStructDef structDef) throws AtlasServiceException {
AtlasTypesDef atlasTypesDef = new AtlasTypesDef();
atlasTypesDef.getStructDefs().add(structDef);
AtlasTypesDef created = createAtlasTypeDefs(atlasTypesDef);
assert created != null;
assert created.getStructDefs() != null;
return created.getStructDefs().get(0);
}
Aggregations