use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsToOne.
@Test
public void testIsToOne() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isToOne());
ToOne toOne = new OneToOne(DummyMetadataBuildingContext.INSTANCE, null, new RootClass(DummyMetadataBuildingContext.INSTANCE));
valueFacade = new AbstractValueFacade(FACADE_FACTORY, toOne) {
};
assertTrue(valueFacade.isToOne());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetComponentClassName.
@Test
public void testGetComponentClassName() {
Component valueTarget = new Component(DummyMetadataBuildingContext.INSTANCE, new RootClass(DummyMetadataBuildingContext.INSTANCE));
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueFacade.getComponentClassName());
valueTarget.setComponentClassName("org.foo.Bar");
assertEquals("org.foo.Bar", valueFacade.getComponentClassName());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsDependantValue.
@Test
public void testIsDependantValue() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertFalse(valueFacade.isDependantValue());
DependantValue dependantValueTarget = new DependantValue(DummyMetadataBuildingContext.INSTANCE, null, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, dependantValueTarget) {
};
assertTrue(valueFacade.isDependantValue());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsComponent.
@Test
public void testIsComponent() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isComponent());
Component component = new Component(DummyMetadataBuildingContext.INSTANCE, new RootClass(DummyMetadataBuildingContext.INSTANCE));
valueFacade = new AbstractValueFacade(FACADE_FACTORY, component) {
};
assertTrue(valueFacade.isComponent());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetElement.
@Test
public void testGetElement() {
Bag bagValueTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
IValue bagValueFacade = new AbstractValueFacade(FACADE_FACTORY, bagValueTarget) {
};
assertNull(bagValueFacade.getElement());
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
bagValueTarget.setElement(simpleValueTarget);
assertSame(simpleValueTarget, ((IFacade) bagValueFacade.getElement()).getTarget());
}
Aggregations