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 FacadeFactoryTest method testCreateColumn.
@Test
public void testCreateColumn() {
Column column = new Column();
IColumn facade = facadeFactory.createColumn(column);
Assert.assertSame(column, ((IFacade) facade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IColumn in project jbosstools-hibernate by jbosstools.
the class ForeignKeyFacadeTest method testColumnIterator.
@Test
public void testColumnIterator() {
Column column = new Column();
foreignKey.addColumn(column);
reset();
Iterator<IColumn> iterator = foreignKeyFacade.columnIterator();
Assert.assertEquals("columnIterator", methodName);
Assert.assertArrayEquals(new Object[] {}, arguments);
IColumn columnFacade = iterator.next();
Assert.assertSame(column, ((IFacade) columnFacade).getTarget());
Assert.assertFalse(iterator.hasNext());
}
use of org.jboss.tools.hibernate.runtime.spi.IColumn in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testAddColumn.
@Test
public void testAddColumn() {
SimpleValue simpleValueTarget = new SimpleValue(null);
valueFacade = FACADE_FACTORY.createValue(simpleValueTarget);
Iterator<?> columnIterator = simpleValueTarget.getColumnIterator();
Assert.assertFalse(columnIterator.hasNext());
Column columnTarget = new Column();
IColumn columnFacade = FACADE_FACTORY.createColumn(columnTarget);
valueFacade.addColumn(columnFacade);
columnIterator = simpleValueTarget.getColumnIterator();
Assert.assertTrue(columnIterator.hasNext());
Assert.assertSame(columnTarget, columnIterator.next());
}
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());
}
Aggregations