use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreatePersistentClass.
@Test
public void testCreatePersistentClass() {
PersistentClass persistentClass = new RootClass(null);
IPersistentClass facade = facadeFactory.createPersistentClass(persistentClass);
Assert.assertSame(persistentClass, ((IFacade) facade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateSpecialRootClass.
@Test
public void testCreateSpecialRootClass() {
Property property = new Property();
Mappings m = (Mappings) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { Mappings.class }, new TestInvocationHandler());
property.setValue(new SimpleValue(m));
IProperty propertyFacade = new AbstractPropertyFacade(facadeFactory, property) {
};
IPersistentClass specialRootClass = facadeFactory.createSpecialRootClass(propertyFacade);
Assert.assertSame(property, ((IFacade) specialRootClass.getProperty()).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreatePersistentClass.
@Test
public void testCreatePersistentClass() {
PersistentClass persistentClass = new RootClass();
IPersistentClass facade = facadeFactory.createPersistentClass(persistentClass);
Assert.assertSame(persistentClass, ((IFacade) facade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class Cfg2HbmToolFacadeTest method testGetPersistentClassTag.
@Test
public void testGetPersistentClassTag() {
PersistentClass target = new RootClass();
IPersistentClass persistentClass = new AbstractPersistentClassFacade(FACADE_FACTORY, target) {
};
Assert.assertEquals("class", cfg2HbmToolFacade.getTag(persistentClass));
}
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_0.internal.test.Foo", persistentClassFacade.getClassName());
}
Aggregations