use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewBag.
@Test
public void testNewBag() {
IPersistentClass persistentClass = service.newRootClass();
IValue bag = service.newBag(persistentClass);
Assert.assertNotNull(bag);
Object target = ((IFacade) bag).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof Bag);
}
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 ColumnFacadeTest method testGetValue.
public void testGetValue() throws Exception {
Value targetValue = null;
column.setValue(targetValue);
Assert.assertNull(columnFacade.getValue());
targetValue = new SimpleValue((MetadataImplementor) MetadataHelper.getMetadata(new Configuration()));
column.setValue(targetValue);
IValue value = columnFacade.getValue();
Assert.assertNotNull(value);
Assert.assertEquals(targetValue, ((IFacade) value).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testGetIdentifierValue.
@Test
public void testGetIdentifierValue() {
Table table = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(table);
IValue valueFacade = tableFacade.getIdentifierValue();
Assert.assertNull(valueFacade);
KeyValue value = new SimpleValue(null);
table.setIdentifierValue(value);
valueFacade = tableFacade.getIdentifierValue();
Assert.assertSame(value, ((IFacade) valueFacade).getTarget());
}
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());
}
Aggregations