Search in sources :

Example 1 with ClassType

use of org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType in project jbosstools-hibernate by jbosstools.

the class TypeFacadeTest method testGetPrimitiveClass.

// TODO JBIDE-28154: Investigate failure
@Disabled
@Test
public void testGetPrimitiveClass() {
    IType typeFacade = null;
    ClassType classType = new ClassType();
    typeFacade = new TypeFacadeImpl(FACADE_FACTORY, classType) {
    };
    assertNull(typeFacade.getPrimitiveClass());
    IntegerType integerType = new IntegerType();
    typeFacade = new TypeFacadeImpl(FACADE_FACTORY, integerType) {
    };
    assertEquals(int.class, typeFacade.getPrimitiveClass());
}
Also used : IntegerType(org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.IntegerType) ClassType(org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 2 with ClassType

use of org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType in project jbosstools-hibernate by jbosstools.

the class TypeFacadeTest method testToString.

@Test
public void testToString() {
    IType typeFacade = null;
    ClassType classType = new ClassType();
    typeFacade = new TypeFacadeImpl(FACADE_FACTORY, classType) {
    };
    assertEquals(TypeFacadeTest.class.getName(), typeFacade.toString(TypeFacadeTest.class));
    ArrayType arrayType = new ArrayType("foo", "bar", String.class);
    typeFacade = new TypeFacadeImpl(FACADE_FACTORY, arrayType) {
    };
    assertNull(typeFacade.toString(new String[] { "foo", "bar" }));
}
Also used : ArrayType(org.hibernate.type.ArrayType) ClassType(org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) Test(org.junit.jupiter.api.Test)

Example 3 with ClassType

use of org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType in project jbosstools-hibernate by jbosstools.

the class TypeFacadeTest method testGetReturnedClass.

@Test
public void testGetReturnedClass() {
    IType typeFacade = null;
    ClassType classType = new ClassType();
    typeFacade = new TypeFacadeImpl(FACADE_FACTORY, classType) {
    };
    assertEquals(Class.class.getName(), typeFacade.getReturnedClassName());
    ArrayType arrayType = new ArrayType(null, null, String.class);
    typeFacade = new TypeFacadeImpl(FACADE_FACTORY, arrayType) {
    };
    assertEquals(String[].class.getName(), typeFacade.getReturnedClassName());
    EntityType entityType = new ManyToOneType((TypeConfiguration) null, "org.foo.bar");
    typeFacade = new TypeFacadeImpl(FACADE_FACTORY, entityType);
    assertEquals("org.foo.bar", typeFacade.getReturnedClassName());
}
Also used : ArrayType(org.hibernate.type.ArrayType) EntityType(org.hibernate.type.EntityType) ManyToOneType(org.hibernate.type.ManyToOneType) RootClass(org.hibernate.mapping.RootClass) ClassType(org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) Test(org.junit.jupiter.api.Test)

Example 4 with ClassType

use of org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType in project jbosstools-hibernate by jbosstools.

the class TypeFacadeTest method testGetRole.

@Test
public void testGetRole() {
    IType typeFacade = null;
    ClassType classType = new ClassType();
    typeFacade = new TypeFacadeImpl(FACADE_FACTORY, classType) {
    };
    assertNull(typeFacade.getRole());
    ArrayType arrayType = new ArrayType("foo", null, String.class);
    typeFacade = new TypeFacadeImpl(FACADE_FACTORY, arrayType) {
    };
    assertEquals("foo", typeFacade.getRole());
}
Also used : ArrayType(org.hibernate.type.ArrayType) ClassType(org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) Test(org.junit.jupiter.api.Test)

Example 5 with ClassType

use of org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType in project jbosstools-hibernate by jbosstools.

the class TypeFacadeTest method testIsInstanceOfPrimitiveType.

// TODO JBIDE-28154: Investigate failure
@Disabled
@Test
public void testIsInstanceOfPrimitiveType() {
    IType typeFacade = null;
    ClassType classType = new ClassType();
    typeFacade = new TypeFacadeImpl(FACADE_FACTORY, classType) {
    };
    assertFalse(typeFacade.isInstanceOfPrimitiveType());
    StringType stringType = new StringType();
    typeFacade = new TypeFacadeImpl(FACADE_FACTORY, stringType) {
    };
    assertFalse(typeFacade.isInstanceOfPrimitiveType());
    IntegerType integerType = new IntegerType();
    typeFacade = new TypeFacadeImpl(FACADE_FACTORY, integerType) {
    };
    assertTrue(typeFacade.isInstanceOfPrimitiveType());
}
Also used : IntegerType(org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.IntegerType) StringType(org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.StringType) ClassType(org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType) IType(org.jboss.tools.hibernate.runtime.spi.IType) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Aggregations

IType (org.jboss.tools.hibernate.runtime.spi.IType)15 ClassType (org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType)15 Test (org.junit.jupiter.api.Test)15 ArrayType (org.hibernate.type.ArrayType)7 EntityType (org.hibernate.type.EntityType)4 ManyToOneType (org.hibernate.type.ManyToOneType)4 Disabled (org.junit.jupiter.api.Disabled)4 IntegerType (org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.IntegerType)3 RootClass (org.hibernate.mapping.RootClass)2 BootstrapContextImpl (org.hibernate.boot.internal.BootstrapContextImpl)1 InFlightMetadataCollectorImpl (org.hibernate.boot.internal.InFlightMetadataCollectorImpl)1 MetadataBuildingContextRootImpl (org.hibernate.boot.internal.MetadataBuildingContextRootImpl)1 StandardServiceRegistry (org.hibernate.boot.registry.StandardServiceRegistry)1 StandardServiceRegistryBuilder (org.hibernate.boot.registry.StandardServiceRegistryBuilder)1 BootstrapContext (org.hibernate.boot.spi.BootstrapContext)1 InFlightMetadataCollector (org.hibernate.boot.spi.InFlightMetadataCollector)1 MetadataBuildingContext (org.hibernate.boot.spi.MetadataBuildingContext)1 MetadataBuildingOptions (org.hibernate.boot.spi.MetadataBuildingOptions)1 Component (org.hibernate.mapping.Component)1 AnyType (org.hibernate.type.AnyType)1