use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsOneToOne.
@Test
public void testIsOneToOne() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isOneToOne());
OneToOne oneToOne = new OneToOne(DummyMetadataBuildingContext.INSTANCE, null, new RootClass(DummyMetadataBuildingContext.INSTANCE));
valueFacade = new AbstractValueFacade(FACADE_FACTORY, oneToOne) {
};
assertTrue(valueFacade.isOneToOne());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetTable.
@Test
public void testGetTable() {
Table tableTarget = new Table();
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE, tableTarget);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
ITable tableFacade = valueFacade.getTable();
assertSame(tableTarget, ((IFacade) tableFacade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetEntityName.
@Test
public void testGetEntityName() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertNull(valueFacade.getEntityName());
RootClass pc = new RootClass(DummyMetadataBuildingContext.INSTANCE);
pc.setEntityName("foobar");
OneToOne oneToOneTarget = new OneToOne(DummyMetadataBuildingContext.INSTANCE, null, pc);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, oneToOneTarget) {
};
assertEquals("foobar", valueFacade.getEntityName());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsTypeSpecified.
@Test
public void testIsTypeSpecified() {
SimpleValue valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isTypeSpecified());
valueTarget.setTypeName("org.foo.Bar");
assertTrue(valueFacade.isTypeSpecified());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetCollectionElement.
@Test
public void testGetCollectionElement() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
IValue collectionElement = valueFacade.getCollectionElement();
assertNull(collectionElement);
Set set = new Set(DummyMetadataBuildingContext.INSTANCE, null);
set.setElement(valueTarget);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, set) {
};
collectionElement = valueFacade.getCollectionElement();
assertNotNull(collectionElement);
assertSame(valueTarget, ((IFacade) collectionElement).getTarget());
}
Aggregations