use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetIndex.
@Test
public void testGetIndex() {
List valueTarget = new List(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueFacade.getIndex());
SimpleValue indexValue = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueTarget.setIndex(indexValue);
assertSame(indexValue, ((IFacade) valueFacade.getIndex()).getTarget());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetKey.
@Test
public void testSetKey() {
KeyValue keyValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
IValue keyValueFacade = new AbstractValueFacade(FACADE_FACTORY, keyValueTarget) {
};
Collection collectionTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
IValue collectionFacade = new AbstractValueFacade(FACADE_FACTORY, collectionTarget) {
};
assertNull(collectionTarget.getKey());
collectionFacade.setKey(keyValueFacade);
assertSame(keyValueTarget, collectionTarget.getKey());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsArray.
@Test
public void testIsArray() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertFalse(valueFacade.isArray());
Array arrayTarget = new Array(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, arrayTarget) {
};
assertTrue(valueFacade.isArray());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetKey.
@Test
public void testGetKey() {
Map valueTarget = new Map(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueFacade.getKey());
KeyValue keyValue = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueTarget.setKey(keyValue);
assertSame(keyValue, ((IFacade) valueFacade.getKey()).getTarget());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsIdentifierBag.
@Test
public void testIsIdentifierBag() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertFalse(valueFacade.isIdentifierBag());
IdentifierBag identifierBagTarget = new IdentifierBag(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, identifierBagTarget) {
};
assertTrue(valueFacade.isIdentifierBag());
}
Aggregations