Search in sources :

Example 6 with ArrayType

use of org.hibernate.type.ArrayType 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, false);
    typeFacade = FACADE_FACTORY.createType(bagType);
    Assert.assertFalse(typeFacade.isArrayType());
    ArrayType arrayType = new ArrayType(null, null, String.class, false);
    typeFacade = FACADE_FACTORY.createType(arrayType);
    Assert.assertTrue(typeFacade.isArrayType());
}
Also used : ArrayType(org.hibernate.type.ArrayType) BagType(org.hibernate.type.BagType) ClassType(org.hibernate.type.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) Test(org.junit.Test)

Example 7 with ArrayType

use of org.hibernate.type.ArrayType 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());
}
Also used : ArrayType(org.hibernate.type.ArrayType) BagType(org.hibernate.type.BagType) ClassType(org.hibernate.type.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) Test(org.junit.Test)

Example 8 with ArrayType

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(null, "foo", "bar", String.class, false);
    typeFacade = FACADE_FACTORY.createType(arrayType);
    Assert.assertNull(typeFacade.toString(new String[] { "foo", "bar" }));
}
Also used : ArrayType(org.hibernate.type.ArrayType) ClassType(org.hibernate.type.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) Test(org.junit.Test)

Example 9 with ArrayType

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, null, String.class, false);
    typeFacade = FACADE_FACTORY.createType(arrayType);
    Assert.assertEquals(String[].class, typeFacade.getReturnedClass());
}
Also used : ArrayType(org.hibernate.type.ArrayType) ClassType(org.hibernate.type.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) Test(org.junit.Test)

Example 10 with ArrayType

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, null, String.class, false);
    typeFacade = FACADE_FACTORY.createType(arrayType);
    Assert.assertTrue(typeFacade.isCollectionType());
}
Also used : ArrayType(org.hibernate.type.ArrayType) ClassType(org.hibernate.type.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) Test(org.junit.Test)

Aggregations

ArrayType (org.hibernate.type.ArrayType)56 ClassType (org.hibernate.type.ClassType)56 IType (org.jboss.tools.hibernate.runtime.spi.IType)56 Test (org.junit.Test)56 BagType (org.hibernate.type.BagType)8