use of org.jboss.tools.hibernate.runtime.spi.IProperty in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewSpecialRootClass.
@Test
public void testNewSpecialRootClass() {
IProperty property = service.newProperty();
IPersistentClass pc = service.newRootClass();
property.setPersistentClass(pc);
IPersistentClass specialRootClass = service.newSpecialRootClass(property);
Assert.assertNotNull(specialRootClass);
Object target = ((IFacade) specialRootClass).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof RootClass);
Assert.assertSame(property, specialRootClass.getProperty());
}
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());
}
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 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 ServiceImplTest method testNewSpecialRootClass.
@Test
public void testNewSpecialRootClass() {
IProperty property = service.newProperty();
IPersistentClass pc = service.newRootClass();
property.setPersistentClass(pc);
IPersistentClass specialRootClass = service.newSpecialRootClass(property);
Assert.assertNotNull(specialRootClass);
Object target = ((IFacade) specialRootClass).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof RootClass);
Assert.assertSame(property, specialRootClass.getProperty());
}
Aggregations