use of org.hibernate.type.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testIsOneToOne.
@Test
public void testIsOneToOne() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertFalse(typeFacade.isOneToOne());
EntityType entityType = new ManyToOneType(null, null);
typeFacade = FACADE_FACTORY.createType(entityType);
Assert.assertFalse(entityType.isOneToOne());
OneToOneType oneToOneType = new OneToOneType(null, null, null, false, null, false, false, null, null);
typeFacade = FACADE_FACTORY.createType(oneToOneType);
Assert.assertTrue(oneToOneType.isOneToOne());
}
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);
typeFacade = FACADE_FACTORY.createType(bagType);
Assert.assertFalse(typeFacade.isArrayType());
ArrayType arrayType = new ArrayType(null, null, null, String.class);
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 testGetRole.
@Test
public void testGetRole() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertNull(typeFacade.getRole());
ArrayType arrayType = new ArrayType(null, "foo", null, String.class);
typeFacade = FACADE_FACTORY.createType(arrayType);
Assert.assertEquals("foo", typeFacade.getRole());
}
use of org.hibernate.type.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testToString.
@Test
public void testToString() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertEquals(TypeFacadeTest.class.getName(), typeFacade.toString(TypeFacadeTest.class));
ArrayType arrayType = new ArrayType(null, "foo", "bar", String.class);
typeFacade = FACADE_FACTORY.createType(arrayType);
Assert.assertNull(typeFacade.toString(new String[] { "foo", "bar" }));
}
Aggregations