use of org.apache.stanbol.entityhub.servicesapi.model.UnsupportedTypeException in project stanbol by apache.
the class RepresentationTest method testGetFirstValueWithUnsupportedType.
@Test(expected = UnsupportedTypeException.class)
public void testGetFirstValueWithUnsupportedType() {
String field = "urn:the.field:used.for.this.Test";
Representation rep = createRepresentation(null);
Object value = getUnsupportedValueInstance();
if (value == null) {
// this test is not needed therefore return an dummy Exception
throw new UnsupportedTypeException(Object.class, "dummy exception to successfully complete this unnecessary test");
} else {
Class<?> unsupported = value.getClass();
rep.getFirst(field, unsupported);
}
}
use of org.apache.stanbol.entityhub.servicesapi.model.UnsupportedTypeException in project stanbol by apache.
the class RepresentationTest method testGetValueWithUnsupportedType.
@Test(expected = UnsupportedTypeException.class)
public void testGetValueWithUnsupportedType() {
String field = "urn:the.field:used.for.this.Test";
Representation rep = createRepresentation(null);
Object value = getUnsupportedValueInstance();
if (value == null) {
// this test is not needed therefore return an dummy Exception
throw new UnsupportedTypeException(Object.class, "dummy exception to successfully complete this unnecessary test");
} else {
Class<?> unsupported = value.getClass();
rep.get(field, unsupported);
}
}
Aggregations