use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class ConfigurationFacadeTest method testAddClass.
@Test
public void testAddClass() {
PersistentClass persistentClass = new RootClass(null);
persistentClass.setEntityName("Foo");
IPersistentClass persistentClassFacade = FACADE_FACTORY.createPersistentClass(persistentClass);
Assert.assertNull(configurationFacade.getClassMapping("Foo"));
configurationFacade = FACADE_FACTORY.createConfiguration(configuration);
configurationFacade.addClass(persistentClassFacade);
Assert.assertEquals(persistentClassFacade, configurationFacade.getClassMapping("Foo"));
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class ConfigurationFacadeTest method testGetClassMappings.
@Test
public void testGetClassMappings() {
configurationFacade = FACADE_FACTORY.createConfiguration(configuration);
Iterator<IPersistentClass> iterator = configurationFacade.getClassMappings();
Assert.assertFalse(iterator.hasNext());
configuration.configure();
configurationFacade = FACADE_FACTORY.createConfiguration(configuration);
iterator = configurationFacade.getClassMappings();
IPersistentClass persistentClassFacade = iterator.next();
Assert.assertEquals("org.jboss.tools.hibernate.runtime.v_5_0.internal.test.Foo", persistentClassFacade.getClassName());
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class ConfigurationFacadeTest method testGetClassMappings.
@Test
public void testGetClassMappings() {
configurationFacade = FACADE_FACTORY.createConfiguration(configuration);
Iterator<IPersistentClass> iterator = configurationFacade.getClassMappings();
Assert.assertFalse(iterator.hasNext());
configuration.configure();
configuration.buildMappings();
configurationFacade = FACADE_FACTORY.createConfiguration(configuration);
iterator = configurationFacade.getClassMappings();
IPersistentClass persistentClassFacade = iterator.next();
Assert.assertEquals("org.jboss.tools.hibernate.runtime.v_4_3.internal.test.Foo", persistentClassFacade.getClassName());
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewSet.
@Test
public void testNewSet() {
IPersistentClass persistentClass = service.newRootClass();
IValue set = service.newSet(persistentClass);
Assert.assertNotNull(set);
Object target = ((IFacade) set).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof Set);
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewJoinedSubclass.
@Test
public void testNewJoinedSubclass() {
IPersistentClass persistentClass = service.newRootClass();
IPersistentClass joinedSubclass = service.newJoinedSubclass(persistentClass);
Assert.assertNotNull(joinedSubclass);
Object target = ((IFacade) joinedSubclass).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof JoinedSubclass);
Assert.assertSame(persistentClass, joinedSubclass.getSuperclass());
Assert.assertSame(((IFacade) persistentClass).getTarget(), ((JoinedSubclass) target).getSuperclass());
}
Aggregations