use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetPropertyIterator.
@Test
public void testGetPropertyIterator() {
Component componentTarget = new Component(DummyMetadataBuildingContext.INSTANCE, new RootClass(DummyMetadataBuildingContext.INSTANCE));
valueFacade = new AbstractValueFacade(FACADE_FACTORY, componentTarget) {
};
Iterator<IProperty> iter = valueFacade.getPropertyIterator();
assertFalse(iter.hasNext());
Property propertyTarget = new Property();
componentTarget.addProperty(propertyTarget);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, componentTarget) {
};
iter = valueFacade.getPropertyIterator();
assertTrue(iter.hasNext());
IProperty propertyFacade = iter.next();
assertSame(propertyTarget, ((IFacade) propertyFacade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetForeignKeyName.
@Test
public void testGetForeignKeyName() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertNull(valueFacade.getForeignKeyName());
simpleValueTarget.setForeignKeyName("foobar");
assertEquals("foobar", valueFacade.getForeignKeyName());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetRole.
@Test
public void testSetRole() {
Collection collectionTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, collectionTarget) {
};
assertNull(collectionTarget.getRole());
valueFacade.setRole("foobar");
assertEquals("foobar", collectionTarget.getRole());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade 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.jboss.tools.hibernate.runtime.common.AbstractValueFacade 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(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueTarget.getCollectionTable());
valueFacade.setCollectionTable(tableFacade);
assertSame(tableTarget, valueTarget.getCollectionTable());
}
Aggregations