use of org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testIsAnyType.
@Test
public void testIsAnyType() {
IType typeFacade = null;
// first try type that is not a any type
ClassType classType = new ClassType();
typeFacade = new TypeFacadeImpl(FACADE_FACTORY, classType) {
};
assertFalse(typeFacade.isAnyType());
// next try a any type
AnyType anyType = new AnyType(null, null, null, true);
typeFacade = new TypeFacadeImpl(FACADE_FACTORY, anyType) {
};
assertTrue(typeFacade.isAnyType());
}
use of org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testGetAssociatedEntityName.
@Test
public void testGetAssociatedEntityName() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = new TypeFacadeImpl(FACADE_FACTORY, classType) {
};
assertNull(typeFacade.getAssociatedEntityName());
EntityType entityType = new ManyToOneType((TypeConfiguration) null, "foo");
typeFacade = new TypeFacadeImpl(FACADE_FACTORY, entityType) {
};
assertEquals("foo", typeFacade.getAssociatedEntityName());
}
use of org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testIsComponentType.
// TODO JBIDE-28154: Investigate failure
@Disabled
@Test
public void testIsComponentType() {
IType typeFacade = null;
// first try type that is not a component type
ClassType classType = new ClassType();
typeFacade = new TypeFacadeImpl(FACADE_FACTORY, classType) {
};
assertFalse(typeFacade.isComponentType());
// next try a component type
StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder();
ssrb.applySetting(AvailableSettings.DIALECT, MockDialect.class.getName());
ssrb.applySetting(AvailableSettings.CONNECTION_PROVIDER, MockConnectionProvider.class.getName());
StandardServiceRegistry ssr = ssrb.build();
MetadataBuildingOptions mdbo = new MetadataBuilderImpl.MetadataBuildingOptionsImpl(ssr);
BootstrapContext btc = new BootstrapContextImpl(ssr, mdbo);
InFlightMetadataCollector ifmdc = new InFlightMetadataCollectorImpl(btc, mdbo);
MetadataBuildingContext mdbc = new MetadataBuildingContextRootImpl("JBoss Tools", btc, mdbo, ifmdc);
ComponentType componentType = new ComponentType(new Component(mdbc, new RootClass(mdbc)), new int[] {}, mdbc);
typeFacade = new TypeFacadeImpl(FACADE_FACTORY, componentType) {
};
assertTrue(typeFacade.isComponentType());
}
use of org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testIsOneToOne.
@Test
public void testIsOneToOne() {
IType typeFacade = null;
// first try type that is not a one to one type
ClassType classType = new ClassType();
typeFacade = new TypeFacadeImpl(FACADE_FACTORY, classType) {
};
assertFalse(typeFacade.isOneToOne());
// next try another type that is not a one to one type
EntityType entityType = new ManyToOneType((TypeConfiguration) null, null);
typeFacade = new TypeFacadeImpl(FACADE_FACTORY, entityType) {
};
assertFalse(entityType.isOneToOne());
// finally try a type that is a one to one type
OneToOneType oneToOneType = new OneToOneType(null, null, null, false, null, false, false, null, null, false);
typeFacade = new TypeFacadeImpl(FACADE_FACTORY, oneToOneType) {
};
assertTrue(oneToOneType.isOneToOne());
}
use of org.jboss.tools.hibernate.runtime.v_6_0.internal.legacy.ClassType in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testIsArrayType.
@Test
public void testIsArrayType() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = new TypeFacadeImpl(FACADE_FACTORY, classType) {
};
assertFalse(typeFacade.isArrayType());
BagType bagType = new BagType(null, null);
typeFacade = new TypeFacadeImpl(FACADE_FACTORY, bagType) {
};
assertFalse(typeFacade.isArrayType());
ArrayType arrayType = new ArrayType(null, null, String.class);
typeFacade = new TypeFacadeImpl(FACADE_FACTORY, arrayType) {
};
assertTrue(typeFacade.isArrayType());
}
Aggregations