use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsPrimitiveArray.
@Test
public void testIsPrimitiveArray() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertFalse(valueFacade.isPrimitiveArray());
PrimitiveArray primitiveArrayTarget = new PrimitiveArray(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, primitiveArrayTarget) {
};
assertTrue(valueFacade.isPrimitiveArray());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsMap.
@Test
public void testIsMap() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isMap());
Map map = new Map(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, map) {
};
assertTrue(valueFacade.isMap());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testAddColumn.
@Test
public void testAddColumn() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
simpleValueTarget.setTable(new Table());
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
Iterator<?> columnIterator = simpleValueTarget.getColumnIterator();
assertFalse(columnIterator.hasNext());
Column columnTarget = new Column();
IColumn columnFacade = FACADE_FACTORY.createColumn(columnTarget);
valueFacade.addColumn(columnFacade);
columnIterator = simpleValueTarget.getColumnIterator();
assertTrue(columnIterator.hasNext());
assertSame(columnTarget, columnIterator.next());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsSimpleValue.
@Test
public void testIsSimpleValue() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertTrue(valueFacade.isSimpleValue());
valueTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isSimpleValue());
}
use of org.hibernate.mapping.BasicValue 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 BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueTarget.getTable());
valueFacade.setTable(tableFacade);
assertSame(tableTarget, valueTarget.getTable());
}
Aggregations