use of org.jboss.tools.hibernate.runtime.spi.IColumn in project jbosstools-hibernate by jbosstools.
the class ForeignKeyFacadeTest method testGetReferencedColumns.
@Test
public void testGetReferencedColumns() {
List<IColumn> list = foreignKeyFacade.getReferencedColumns();
Assert.assertTrue(list.isEmpty());
Assert.assertEquals("getReferencedColumns", methodName);
Assert.assertArrayEquals(new Object[] {}, arguments);
// recreate facade to reinitialize the instance variables
foreignKeyFacade = new AbstractForeignKeyFacade(FACADE_FACTORY, foreignKey) {
};
Column column = new Column();
ArrayList<Column> columns = new ArrayList<Column>();
columns.add(column);
foreignKey.addReferencedColumns(columns.iterator());
reset();
list = foreignKeyFacade.getReferencedColumns();
Assert.assertFalse(list.isEmpty());
Assert.assertEquals("getReferencedColumns", methodName);
Assert.assertArrayEquals(new Object[] {}, arguments);
}
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 ForeignKeyFacadeTest method testContainsColumn.
@Test
public void testContainsColumn() {
Column column = new Column();
IColumn columnFacade = FACADE_FACTORY.createColumn(column);
Assert.assertFalse(foreignKeyFacade.containsColumn(columnFacade));
Assert.assertEquals("containsColumn", methodName);
Assert.assertArrayEquals(new Object[] { column }, arguments);
foreignKey.addColumn(column);
reset();
Assert.assertTrue(foreignKeyFacade.containsColumn(columnFacade));
Assert.assertEquals("containsColumn", methodName);
Assert.assertArrayEquals(new Object[] { column }, arguments);
}
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 ValueFacadeTest method testGetColumnIterator.
@Test
public void testGetColumnIterator() {
SimpleValue valueTarget = new SimpleValue(null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
Iterator<IColumn> columnIterator = valueFacade.getColumnIterator();
Assert.assertFalse(columnIterator.hasNext());
Column columnTarget = new Column();
valueTarget.addColumn(columnTarget);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
columnIterator = valueFacade.getColumnIterator();
Assert.assertTrue(columnIterator.hasNext());
Assert.assertSame(columnTarget, ((IFacade) columnIterator.next()).getTarget());
}
Aggregations