use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testAddColumn.
@Test
public void testAddColumn() {
Table table = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(table);
Column column = new Column("foo");
IColumn columnFacade = FACADE_FACTORY.createColumn(column);
Assert.assertNull(table.getColumn(column));
tableFacade.addColumn(columnFacade);
Assert.assertSame(column, table.getColumn(column));
}
use of org.jboss.tools.hibernate.runtime.spi.ITable in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testHasDenormalizedTables.
@Test
public void testHasDenormalizedTables() throws Exception {
Table table = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(table);
Assert.assertFalse(tableFacade.hasDenormalizedTables());
Method method = Table.class.getDeclaredMethod("setHasDenormalizedTables", new Class[] {});
method.setAccessible(true);
method.invoke(table, new Object[] {});
Assert.assertTrue(tableFacade.hasDenormalizedTables());
}
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 testSetCollectionTable.
@Test
public void testSetCollectionTable() {
Table tableTarget = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(tableTarget);
Collection valueTarget = new Set(null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
Assert.assertNull(valueTarget.getCollectionTable());
valueFacade.setCollectionTable(tableFacade);
Assert.assertSame(tableTarget, valueTarget.getCollectionTable());
}
Aggregations