public static EnumTypeDefinition createEnumTypeDef(String name, EnumValue... enumValues) { return new EnumTypeDefinition(name, enumValues); }
public static EnumTypeDefinition createEnumTypeDef(String name, EnumValue... enumValues) { return new EnumTypeDefinition(name, enumValues); }
public EnumType defineEnumType(String name, String description, EnumValue... values) throws AtlasException { return defineEnumType(new EnumTypeDefinition(name, description, values)); }
public EnumType defineEnumType(String name, EnumValue... values) throws AtlasException { return defineEnumType(new EnumTypeDefinition(name, values)); }
public EnumType defineEnumType(String name, EnumValue... values) throws AtlasException { return defineEnumType(new EnumTypeDefinition(name, values)); }
public EnumType defineEnumType(String name, String description, EnumValue... values) throws AtlasException { return defineEnumType(new EnumTypeDefinition(name, description, values)); }
@Test(dataProvider = "enumTypeData", expectedExceptions = {IllegalArgumentException.class}) public void testEnumType(String name, EnumValue... values) { new EnumTypeDefinition(name, values); }
@Test(dataProvider = "enumTypeData", expectedExceptions = {IllegalArgumentException.class}) public void testEnumType(String name, EnumValue... values) { new EnumTypeDefinition(name, values); }
@Test public void testTypeUpdate() throws Exception { TypeSystem ts = getTypeSystem(); EnumTypeDefinition etd = new EnumTypeDefinition(newName(), new EnumValue("A", 1)); TypesDef typesDef = getTypesDef(etd); ts.defineTypes(typesDef); etd = new EnumTypeDefinition(etd.name, new EnumValue("A", 1), new EnumValue("B", 2)); typesDef = getTypesDef(etd); ts.updateTypes(typesDef); etd = new EnumTypeDefinition(etd.name, new EnumValue("A", 1)); typesDef = getTypesDef(etd); try { etd = new EnumTypeDefinition(etd.name, new EnumValue("A", 2)); typesDef = getTypesDef(etd); try {
@Test public void testUTFNames() throws Exception { TypeSystem ts = getTypeSystem(); String enumType = random(); EnumTypeDefinition orgLevelEnum = new EnumTypeDefinition(enumType, new EnumValue(random(), 1), new EnumValue(random(), 2)); String structName = random(); String attrType = random(); StructTypeDefinition structType = createStructTypeDef(structName, createRequiredAttrDef(attrType, DataTypes.STRING_TYPE)); String className = random(); HierarchicalTypeDefinition<ClassType> classType = createClassTypeDef(className, ImmutableSet.<String>of(), createRequiredAttrDef(attrType, DataTypes.STRING_TYPE)); String traitName = random(); HierarchicalTypeDefinition<TraitType> traitType = createTraitTypeDef(traitName, ImmutableSet.<String>of(), createRequiredAttrDef(attrType, DataTypes.INT_TYPE)); ts.defineTypes(ImmutableList.of(orgLevelEnum), ImmutableList.of(structType), ImmutableList.of(traitType), ImmutableList.of(classType)); }
@Test public void testUTFNames() throws Exception { TypeSystem ts = getTypeSystem(); String enumType = random(); EnumTypeDefinition orgLevelEnum = new EnumTypeDefinition(enumType, new EnumValue(random(), 1), new EnumValue(random(), 2)); String structName = random(); String attrType = random(); StructTypeDefinition structType = createStructTypeDef(structName, createRequiredAttrDef(attrType, DataTypes.STRING_TYPE)); String className = random(); HierarchicalTypeDefinition<ClassType> classType = createClassTypeDef(className, ImmutableSet.<String>of(), createRequiredAttrDef(attrType, DataTypes.STRING_TYPE)); String traitName = random(); HierarchicalTypeDefinition<TraitType> traitType = createTraitTypeDef(traitName, ImmutableSet.<String>of(), createRequiredAttrDef(attrType, DataTypes.INT_TYPE)); ts.defineTypes(ImmutableList.of(orgLevelEnum), ImmutableList.of(structType), ImmutableList.of(traitType), ImmutableList.of(classType)); }
@Test public void testTypeUpdate() throws Exception { TypeSystem ts = getTypeSystem(); EnumTypeDefinition etd = new EnumTypeDefinition(newName(), new EnumValue("A", 1)); TypesDef typesDef = getTypesDef(etd); ts.defineTypes(typesDef); etd = new EnumTypeDefinition(etd.name, new EnumValue("A", 1), new EnumValue("B", 2)); typesDef = getTypesDef(etd); ts.updateTypes(typesDef); etd = new EnumTypeDefinition(etd.name, new EnumValue("A", 1)); typesDef = getTypesDef(etd); try { etd = new EnumTypeDefinition(etd.name, new EnumValue("A", 2)); typesDef = getTypesDef(etd); try {