use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetOwner.
@Test
public void testGetOwner() {
RootClass rc = new RootClass();
Component componentTarget = new Component(null, rc);
valueFacade = FACADE_FACTORY.createValue(componentTarget);
assertSame(rc, ((IFacade) valueFacade.getOwner()).getTarget());
}
use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsToOne.
@Test
public void testIsToOne() {
valueTarget = new SimpleValue(null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertFalse(valueFacade.isToOne());
ToOne toOne = new OneToOne(null, null, new RootClass());
valueFacade = FACADE_FACTORY.createValue(toOne);
assertTrue(valueFacade.isToOne());
}
use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsEmbedded.
@Test
public void testIsEmbedded() {
valueTarget = new SimpleValue(null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertNull(valueFacade.isEmbedded());
Component component = new Component(null, new RootClass());
valueFacade = FACADE_FACTORY.createValue(component);
component.setEmbedded(true);
assertTrue(valueFacade.isEmbedded());
component.setEmbedded(false);
assertFalse(valueFacade.isEmbedded());
}
use of org.hibernate.mapping.RootClass 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();
assertFalse(iter.hasNext());
Property propertyTarget = new Property();
componentTarget.addProperty(propertyTarget);
valueFacade = FACADE_FACTORY.createValue(componentTarget);
iter = valueFacade.getPropertyIterator();
assertTrue(iter.hasNext());
IProperty propertyFacade = iter.next();
assertSame(propertyTarget, ((IFacade) propertyFacade).getTarget());
}
use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetAssociatedClass.
@Test
public void testGetAssociatedClass() {
RootClass rootClass = new RootClass();
OneToMany oneToManyTarget = new OneToMany(null, null);
valueFacade = FACADE_FACTORY.createValue(oneToManyTarget);
assertNull(valueFacade.getAssociatedClass());
oneToManyTarget.setAssociatedClass(rootClass);
assertSame(rootClass, ((IFacade) valueFacade.getAssociatedClass()).getTarget());
}
Aggregations