@Override public StructType defineStructType(String name, boolean errorIfExists, AttributeDefinition... attrDefs) throws AtlasException { throw new AtlasException("Internal Error: define type called on TransientTypeSystem"); }
@Test public void testStructWithEmptyString() throws AtlasException{ try { assertTrue(getTypeSystem().getTypeNames().contains("t3")); Struct s = new Struct(invalidStructType.getName()); s.set("a", ""); ITypedStruct ts = invalidStructType.convert(s, Multiplicity.REQUIRED); } catch (AtlasException e){ String err = "org.apache.atlas.typesystem.types.ValueConversionException: Cannot convert value 'org.apache.atlas.typesystem.Struct@1ba02' to datatype t3"; Assert.assertEquals(e.toString(), err); } }
@Test public void testStructWithEmptyString() throws AtlasException{ try { assertTrue(getTypeSystem().getTypeNames().contains("t3")); Struct s = new Struct(invalidStructType.getName()); s.set("a", ""); ITypedStruct ts = invalidStructType.convert(s, Multiplicity.REQUIRED); } catch (AtlasException e){ String err = "org.apache.atlas.typesystem.types.ValueConversionException: Cannot convert value 'org.apache.atlas.typesystem.Struct@1ba02' to datatype t3"; Assert.assertEquals(e.toString(), err); } }
@Override public Map<String, IDataType> defineTypes(ImmutableList<EnumTypeDefinition> enumDefs, ImmutableList<StructTypeDefinition> structDefs, ImmutableList<HierarchicalTypeDefinition<TraitType>> traitDefs, ImmutableList<HierarchicalTypeDefinition<ClassType>> classDefs) throws AtlasException { throw new AtlasException("Internal Error: define type called on TransientTypeSystem"); }
@Override public Map<String, IDataType> defineTypes(ImmutableList<EnumTypeDefinition> enumDefs, ImmutableList<StructTypeDefinition> structDefs, ImmutableList<HierarchicalTypeDefinition<TraitType>> traitDefs, ImmutableList<HierarchicalTypeDefinition<ClassType>> classDefs) throws AtlasException { throw new AtlasException("Internal Error: define type called on TransientTypeSystem"); }
@Override public ClassType defineClassType(HierarchicalTypeDefinition<ClassType> classDef) throws AtlasException { throw new AtlasException("Internal Error: define type called on TransientTypeSystem"); }
@Override public void set(String attrName, Object val) throws AtlasException { throw new AtlasException("Get/Set not supported on an Id object"); }
public float getFloat(String attrName) throws AtlasException { throw new AtlasException("Get/Set not supported on an Id object"); }
public double getDouble(String attrName) throws AtlasException { throw new AtlasException("Get/Set not supported on an Id object"); }
public void setString(String attrName, String val) throws AtlasException { throw new AtlasException("Get/Set not supported on an Id object"); }
@Override public StructType defineStructType(String name, boolean errorIfExists, AttributeDefinition... attrDefs) throws AtlasException { throw new AtlasException("Internal Error: define type called on TransientTypeSystem"); }
public byte getByte(String attrName) throws AtlasException { throw new AtlasException("Get/Set not supported on an Id object"); }
public long getLong(String attrName) throws AtlasException { throw new AtlasException("Get/Set not supported on an Id object"); }
public BigInteger getBigInt(String attrName) throws AtlasException { throw new AtlasException("Get/Set not supported on an Id object"); }
public void setBigInt(String attrName, BigInteger val) throws AtlasException { throw new AtlasException("Get/Set not supported on an Id object"); }
public boolean isValueSet(String attrName) throws AtlasException { throw new AtlasException("Attributes not set on an Id object"); }
private void assertValidType(IDataType type) throws AtlasException { if (type == null) { throw new AtlasException("type is null."); } boolean validTypeCategory = (type instanceof ClassType) || (type instanceof TraitType) || (type instanceof EnumType) || (type instanceof StructType); if (!validTypeCategory) { throw new AtlasException("Category of the types should be one of ClassType | " + "TraitType | EnumType | StructType."); } }
@Override public void set(String attrName, Object val) throws AtlasException { throw new AtlasException("Get/Set not supported on an Id object"); }
@Override public Map<String, Object> getValuesMap() throws AtlasException { throw new AtlasException("Get/Set not supported on an Id object"); }
@Override public TraitType defineTraitType(HierarchicalTypeDefinition traitDef) throws AtlasException { throw new AtlasException("Internal Error: define type called on TransientTypeSystem"); }