use of org.hibernate.type.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testIsArrayType.
@Test
public void testIsArrayType() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertFalse(typeFacade.isArrayType());
BagType bagType = new BagType(null, null, null, false);
typeFacade = FACADE_FACTORY.createType(bagType);
Assert.assertFalse(typeFacade.isArrayType());
ArrayType arrayType = new ArrayType(null, null, null, String.class, false);
typeFacade = FACADE_FACTORY.createType(arrayType);
Assert.assertTrue(typeFacade.isArrayType());
}
use of org.hibernate.type.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testIsIntegerType.
@Test
public void testIsIntegerType() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertFalse(typeFacade.isIntegerType());
IntegerType integerType = new IntegerType();
typeFacade = FACADE_FACTORY.createType(integerType);
Assert.assertTrue(typeFacade.isIntegerType());
}
use of org.hibernate.type.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testFromStringValue.
@Test
public void testFromStringValue() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertEquals(TypeFacadeTest.class, typeFacade.fromStringValue(TypeFacadeTest.class.getName()));
ArrayType arrayType = new ArrayType(null, "foo", "bar", String.class, false);
typeFacade = FACADE_FACTORY.createType(arrayType);
Assert.assertNull(typeFacade.fromStringValue("just a random string"));
}
use of org.hibernate.type.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testGetName.
@Test
public void testGetName() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertEquals("class", typeFacade.getName());
ArrayType arrayType = new ArrayType(null, "foo", "bar", String.class, false);
typeFacade = FACADE_FACTORY.createType(arrayType);
Assert.assertEquals("[Ljava.lang.String;(foo)", typeFacade.getName());
}
use of org.hibernate.type.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testIsEntityType.
@Test
public void testIsEntityType() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertFalse(typeFacade.isEntityType());
EntityType entityType = new ManyToOneType(null, null);
typeFacade = FACADE_FACTORY.createType(entityType);
Assert.assertTrue(entityType.isEntityType());
}
Aggregations