use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetElement.
@Test
public void testSetElement() {
SimpleValue elementTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
IValue elementFacade = new AbstractValueFacade(FACADE_FACTORY, elementTarget) {
};
Set valueTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueTarget.getElement());
valueFacade.setElement(elementFacade);
assertSame(elementTarget, valueTarget.getElement());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsList.
@Test
public void testIsList() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isList());
valueTarget = new List(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertTrue(valueFacade.isList());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsBag.
@Test
public void testIsBag() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertFalse(valueFacade.isBag());
Bag bagTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, bagTarget) {
};
assertTrue(valueFacade.isBag());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetTypeName.
@Test
public void testSetTypeName() {
SimpleValue valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueTarget.getTypeName());
valueFacade.setTypeName("java.lang.Integer");
assertEquals("java.lang.Integer", valueTarget.getTypeName());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsInverse.
@Test
public void testIsInverse() {
Collection collectionTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, collectionTarget) {
};
assertFalse(valueFacade.isInverse());
collectionTarget.setInverse(true);
assertTrue(valueFacade.isInverse());
}
Aggregations