use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetElementClassName.
@Test
public void testSetElementClassName() {
Array arrayTarget = new Array(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, arrayTarget) {
};
assertNull(arrayTarget.getElementClassName());
valueFacade.setElementClassName("foobar");
assertEquals("foobar", arrayTarget.getElementClassName());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetTypeParameters.
@Test
public void testGetTypeParameters() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertNull(simpleValueTarget.getTypeParameters());
Properties properties = new Properties();
valueFacade.setTypeParameters(properties);
assertSame(properties, simpleValueTarget.getTypeParameters());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetReferencedEntityName.
@Test
public void testGetReferencedEntityName() {
ManyToOne valueTarget = new ManyToOne(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueFacade.getReferencedEntityName());
valueTarget.setReferencedEntityName("Foo");
assertEquals("Foo", valueFacade.getReferencedEntityName());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetColumnIterator.
@Test
public void testGetColumnIterator() {
SimpleValue valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueTarget.setTable(new Table());
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
Iterator<IColumn> columnIterator = valueFacade.getColumnIterator();
assertFalse(columnIterator.hasNext());
Column columnTarget = new Column();
valueTarget.addColumn(columnTarget);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
columnIterator = valueFacade.getColumnIterator();
assertTrue(columnIterator.hasNext());
assertSame(columnTarget, ((IFacade) columnIterator.next()).getTarget());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsEmbedded.
@Test
public void testIsEmbedded() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueFacade.isEmbedded());
Component component = new Component(DummyMetadataBuildingContext.INSTANCE, new RootClass(DummyMetadataBuildingContext.INSTANCE));
valueFacade = new AbstractValueFacade(FACADE_FACTORY, component) {
};
component.setEmbedded(true);
assertTrue(valueFacade.isEmbedded());
component.setEmbedded(false);
assertFalse(valueFacade.isEmbedded());
}
Aggregations