use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsSimpleValue.
@Test
public void testIsSimpleValue() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertTrue(valueFacade.isSimpleValue());
valueTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isSimpleValue());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetTable.
@Test
public void testSetTable() {
Table tableTarget = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(tableTarget);
SimpleValue valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueTarget.getTable());
valueFacade.setTable(tableFacade);
assertSame(tableTarget, valueTarget.getTable());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsManyToOne.
@Test
public void testIsManyToOne() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isManyToOne());
ManyToOne manyToOne = new ManyToOne(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, manyToOne) {
};
assertTrue(valueFacade.isManyToOne());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetIndex.
@Test
public void testSetIndex() {
List valueTarget = new List(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueTarget.getIndex());
SimpleValue indexTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
IValue indexFacade = new AbstractValueFacade(FACADE_FACTORY, indexTarget) {
};
valueFacade.setIndex(indexFacade);
assertSame(indexTarget, valueTarget.getIndex());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetAssociatedClass.
@Test
public void testGetAssociatedClass() {
RootClass rootClass = new RootClass(DummyMetadataBuildingContext.INSTANCE);
OneToMany oneToManyTarget = new OneToMany(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, oneToManyTarget) {
};
assertNull(valueFacade.getAssociatedClass());
oneToManyTarget.setAssociatedClass(rootClass);
assertSame(rootClass, ((IFacade) valueFacade.getAssociatedClass()).getTarget());
}
Aggregations