use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetReferencedEntityName.
@Test
public void testSetReferencedEntityName() {
ManyToOne valueTarget = new ManyToOne(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueTarget.getReferencedEntityName());
valueFacade.setReferencedEntityName("Foo");
assertEquals("Foo", valueTarget.getReferencedEntityName());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetCollectionTable.
@Test
public void testGetCollectionTable() {
Table tableTarget = new Table();
Collection valueTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueFacade.getCollectionTable());
valueTarget.setCollectionTable(tableTarget);
assertSame(tableTarget, ((IFacade) valueFacade.getCollectionTable()).getTarget());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetParentProperty.
@Test
public void testGetParentProperty() {
Component componentTarget = new Component(DummyMetadataBuildingContext.INSTANCE, new RootClass(DummyMetadataBuildingContext.INSTANCE));
IValue valueFacade = new AbstractValueFacade(FACADE_FACTORY, componentTarget) {
};
assertNull(valueFacade.getParentProperty());
componentTarget.setParentProperty("foobar");
assertEquals("foobar", valueFacade.getParentProperty());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsSet.
@Test
public void testIsSet() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertFalse(valueFacade.isSet());
Set setTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, setTarget) {
};
assertTrue(valueFacade.isSet());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetFetchModeJoin.
@Test
public void testSetFetchModeJoin() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
assertNotEquals(FetchMode.JOIN, simpleValueTarget.getFetchMode());
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
valueFacade.setFetchModeJoin();
assertNotEquals(FetchMode.JOIN, simpleValueTarget.getFetchMode());
Collection collectionTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
assertNotEquals(FetchMode.JOIN, collectionTarget.getFetchMode());
valueFacade = new AbstractValueFacade(FACADE_FACTORY, collectionTarget) {
};
valueFacade.setFetchModeJoin();
assertEquals(FetchMode.JOIN, collectionTarget.getFetchMode());
ManyToOne manyToOneTarget = new ManyToOne(DummyMetadataBuildingContext.INSTANCE, null);
assertNotEquals(FetchMode.JOIN, manyToOneTarget.getFetchMode());
valueFacade = new AbstractValueFacade(FACADE_FACTORY, manyToOneTarget) {
};
valueFacade.setFetchModeJoin();
assertEquals(FetchMode.JOIN, manyToOneTarget.getFetchMode());
}
Aggregations