use of org.jboss.tools.hibernate.runtime.spi.IProperty in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateSpecialRootClass.
@Test
public void testCreateSpecialRootClass() {
Property target = new Property();
PersistentClass pc = new RootClass(null);
target.setPersistentClass(pc);
IProperty property = facadeFactory.createProperty(target);
IPersistentClass specialRootClass = facadeFactory.createSpecialRootClass(property);
Assert.assertNotNull(specialRootClass);
Object object = ((IFacade) specialRootClass).getTarget();
Assert.assertNotNull(object);
Assert.assertTrue(object instanceof RootClass);
Assert.assertSame(property, specialRootClass.getProperty());
}
use of org.jboss.tools.hibernate.runtime.spi.IProperty in project jbosstools-hibernate by jbosstools.
the class Cfg2HbmToolFacadeTest method testGetPropertyTag.
public void testGetPropertyTag() throws Exception {
RootClass rc = new RootClass();
Property p = new Property();
Mappings m = (Mappings) Proxy.newProxyInstance(FACADE_FACTORY.getClassLoader(), new Class[] { Mappings.class }, new TestInvocationHandler());
SimpleValue sv = new SimpleValue(m);
sv.setTypeName("foobar");
p.setValue(sv);
p.setPersistentClass(rc);
rc.setVersion(p);
IProperty property = new AbstractPropertyFacade(FACADE_FACTORY, p) {
};
Assert.assertEquals("version", cfg2HbmToolFacade.getTag(property));
}
use of org.jboss.tools.hibernate.runtime.spi.IProperty in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetPropertyIterator.
@Test
public void testGetPropertyIterator() {
Component componentTarget = new Component(null, new RootClass());
valueFacade = FACADE_FACTORY.createValue(componentTarget);
Iterator<IProperty> iter = valueFacade.getPropertyIterator();
Assert.assertFalse(iter.hasNext());
Property propertyTarget = new Property();
componentTarget.addProperty(propertyTarget);
valueFacade = FACADE_FACTORY.createValue(componentTarget);
iter = valueFacade.getPropertyIterator();
Assert.assertTrue(iter.hasNext());
IProperty propertyFacade = iter.next();
Assert.assertSame(propertyTarget, ((IFacade) propertyFacade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IProperty in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetPropertyIterator.
@Test
public void testGetPropertyIterator() {
Component componentTarget = new Component(null, new RootClass(null));
valueFacade = FACADE_FACTORY.createValue(componentTarget);
Iterator<IProperty> iter = valueFacade.getPropertyIterator();
Assert.assertFalse(iter.hasNext());
Property propertyTarget = new Property();
componentTarget.addProperty(propertyTarget);
valueFacade = FACADE_FACTORY.createValue(componentTarget);
iter = valueFacade.getPropertyIterator();
Assert.assertTrue(iter.hasNext());
IProperty propertyFacade = iter.next();
Assert.assertSame(propertyTarget, ((IFacade) propertyFacade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IProperty in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateProperty.
@Test
public void testCreateProperty() {
Property property = new Property();
IProperty facade = facadeFactory.createProperty(property);
Assert.assertSame(property, ((IFacade) facade).getTarget());
}
Aggregations