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 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 ServiceImplTest method testSimpleValue.
@Test
public void testSimpleValue() {
IValue simpleValue = service.newSimpleValue();
Assert.assertNotNull(simpleValue);
Object target = ((IFacade) simpleValue).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof SimpleValue);
}
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());
StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder();
ssrb.applySetting(Environment.DIALECT, "org.hibernate.dialect.H2Dialect");
StandardServiceRegistry ssr = ssrb.build();
MetadataSources metadataSources = new MetadataSources(ssr);
MetadataImplementor metadata = (MetadataImplementor) metadataSources.buildMetadata();
targetValue = new SimpleValue(metadata);
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 ServiceImplTest method testNewList.
@Test
public void testNewList() {
IPersistentClass persistentClass = service.newRootClass();
IValue list = service.newList(persistentClass);
Assert.assertNotNull(list);
Object target = ((IFacade) list).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof org.hibernate.mapping.List);
}
Aggregations