use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetCollectionTable.
@Test
public void testSetCollectionTable() {
Table tableTarget = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(tableTarget);
Collection valueTarget = new Set(null, null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
Assert.assertNull(valueTarget.getCollectionTable());
valueFacade.setCollectionTable(tableFacade);
Assert.assertSame(tableTarget, valueTarget.getCollectionTable());
}
use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetTable.
@Test
public void testGetTable() {
Table tableTarget = new Table();
valueTarget = new SimpleValue(null, tableTarget);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
ITable tableFacade = valueFacade.getTable();
Assert.assertSame(tableTarget, ((IFacade) tableFacade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetTable.
@Test
public void testSetTable() {
Table tableTarget = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(tableTarget);
SimpleValue valueTarget = new SimpleValue(null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
Assert.assertNull(valueTarget.getTable());
valueFacade.setTable(tableFacade);
Assert.assertSame(tableTarget, valueTarget.getTable());
}
use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testGetColumnIterator.
@Test
public void testGetColumnIterator() {
Table table = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(table);
Iterator<IColumn> columnIterator = tableFacade.getColumnIterator();
Assert.assertFalse(columnIterator.hasNext());
Column column = new Column("foo");
table.addColumn(column);
tableFacade = FACADE_FACTORY.createTable(table);
columnIterator = tableFacade.getColumnIterator();
IColumn columnFacade = columnIterator.next();
Assert.assertSame(column, ((IFacade) columnFacade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testGetComment.
@Test
public void testGetComment() {
Table table = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(table);
Assert.assertNull(tableFacade.getComment());
table.setComment("foo");
Assert.assertEquals("foo", tableFacade.getComment());
}
Aggregations