use of org.jboss.tools.hibernate.runtime.spi.IColumn 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.IColumn 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.IColumn in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewColumn.
@Test
public void testNewColumn() {
IColumn column = service.newColumn("foo");
Assert.assertNotNull(column);
Object target = ((IFacade) column).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof Column);
Assert.assertEquals("foo", ((Column) target).getName());
}
use of org.jboss.tools.hibernate.runtime.spi.IColumn 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.IColumn 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));
}
Aggregations