use of org.hibernate.mapping.BasicValue 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.hibernate.mapping.BasicValue 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());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetElement.
@Test
public void testSetElement() {
SimpleValue elementTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
IValue elementFacade = new AbstractValueFacade(FACADE_FACTORY, elementTarget) {
};
Set valueTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueTarget.getElement());
valueFacade.setElement(elementFacade);
assertSame(elementTarget, valueTarget.getElement());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsList.
@Test
public void testIsList() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isList());
valueTarget = new List(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertTrue(valueFacade.isList());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsBag.
@Test
public void testIsBag() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertFalse(valueFacade.isBag());
Bag bagTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, bagTarget) {
};
assertTrue(valueFacade.isBag());
}
Aggregations