use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetIndex.
@Test
public void testSetIndex() {
List valueTarget = new List(null, null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
Assert.assertNull(valueTarget.getIndex());
SimpleValue indexTarget = new SimpleValue(null);
IValue indexFacade = FACADE_FACTORY.createValue(indexTarget);
valueFacade.setIndex(indexFacade);
Assert.assertSame(indexTarget, valueTarget.getIndex());
}
use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetElement.
@Test
public void testGetElement() {
Bag bagValueTarget = new Bag(null, null);
IValue bagValueFacade = FACADE_FACTORY.createValue(bagValueTarget);
Assert.assertNull(bagValueFacade.getElement());
SimpleValue simpleValueTarget = new SimpleValue(null);
bagValueTarget.setElement(simpleValueTarget);
Assert.assertSame(simpleValueTarget, ((IFacade) bagValueFacade.getElement()).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetCollectionElement.
@Test
public void testGetCollectionElement() {
valueTarget = new SimpleValue(null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
IValue collectionElement = valueFacade.getCollectionElement();
Assert.assertNull(collectionElement);
Set set = new Set(null, null);
set.setElement(valueTarget);
valueFacade = FACADE_FACTORY.createValue(set);
collectionElement = valueFacade.getCollectionElement();
Assert.assertNotNull(collectionElement);
Assert.assertSame(valueTarget, ((IFacade) collectionElement).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetParentProperty.
@Test
public void testGetParentProperty() {
Component componentTarget = new Component(null, new RootClass());
IValue valueFacade = FACADE_FACTORY.createValue(componentTarget);
Assert.assertNull(valueFacade.getParentProperty());
componentTarget.setParentProperty("foobar");
Assert.assertEquals("foobar", valueFacade.getParentProperty());
}
use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetKey.
@Test
public void testSetKey() {
KeyValue keyValueTarget = new SimpleValue(null);
IValue keyValueFacade = FACADE_FACTORY.createValue(keyValueTarget);
Collection collectionTarget = new Bag(null, null);
IValue collectionFacade = FACADE_FACTORY.createValue(collectionTarget);
Assert.assertNull(collectionTarget.getKey());
collectionFacade.setKey(keyValueFacade);
Assert.assertSame(keyValueTarget, collectionTarget.getKey());
}
Aggregations