use of org.hibernate.type.ArrayType 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("foo", null, String.class, false);
typeFacade = FACADE_FACTORY.createType(arrayType);
Assert.assertEquals("foo", typeFacade.getRole());
}
use of org.hibernate.type.ArrayType 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("foo", "bar", String.class, false);
typeFacade = FACADE_FACTORY.createType(arrayType);
Assert.assertNull(typeFacade.toString(new String[] { "foo", "bar" }));
}
use of org.hibernate.type.ArrayType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testIsCollectionType.
@Test
public void testIsCollectionType() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertFalse(typeFacade.isCollectionType());
ArrayType arrayType = new ArrayType(null, null, String.class, false);
typeFacade = FACADE_FACTORY.createType(arrayType);
Assert.assertTrue(typeFacade.isCollectionType());
}
use of org.hibernate.type.ArrayType 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("foo", "bar", String.class, false);
typeFacade = FACADE_FACTORY.createType(arrayType);
Assert.assertEquals("[Ljava.lang.String;(foo)", typeFacade.getName());
}
use of org.hibernate.type.ArrayType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testGetReturnedClass.
@Test
public void testGetReturnedClass() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
Assert.assertEquals(Class.class, typeFacade.getReturnedClass());
ArrayType arrayType = new ArrayType(null, null, String.class, false);
typeFacade = FACADE_FACTORY.createType(arrayType);
Assert.assertEquals(String[].class, typeFacade.getReturnedClass());
}