use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetLazy.
@Test
public void testSetLazy() {
Collection collectionTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, collectionTarget) {
};
valueFacade.setLazy(true);
assertTrue(collectionTarget.isLazy());
valueFacade.setLazy(false);
assertFalse(collectionTarget.isLazy());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsMap.
@Test
public void testIsMap() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isMap());
Map map = new Map(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, map) {
};
assertTrue(valueFacade.isMap());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetAssociatedClass.
@Test
public void testSetAssociatedClass() {
RootClass rootClassTarget = new RootClass(DummyMetadataBuildingContext.INSTANCE);
IPersistentClass rootClassFacade = FACADE_FACTORY.createPersistentClass(rootClassTarget);
OneToMany oneToManyTarget = new OneToMany(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, oneToManyTarget) {
};
assertNull(oneToManyTarget.getAssociatedClass());
valueFacade.setAssociatedClass(rootClassFacade);
assertSame(rootClassTarget, oneToManyTarget.getAssociatedClass());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testAddColumn.
@Test
public void testAddColumn() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
simpleValueTarget.setTable(new Table());
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
Iterator<?> columnIterator = simpleValueTarget.getColumnIterator();
assertFalse(columnIterator.hasNext());
Column columnTarget = new Column();
IColumn columnFacade = FACADE_FACTORY.createColumn(columnTarget);
valueFacade.addColumn(columnFacade);
columnIterator = simpleValueTarget.getColumnIterator();
assertTrue(columnIterator.hasNext());
assertSame(columnTarget, columnIterator.next());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetOwner.
@Test
public void testGetOwner() {
RootClass rc = new RootClass(DummyMetadataBuildingContext.INSTANCE);
Component componentTarget = new Component(DummyMetadataBuildingContext.INSTANCE, rc);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, componentTarget) {
};
assertSame(rc, ((IFacade) valueFacade.getOwner()).getTarget());
}
Aggregations