Search in sources :

Example 11 with IValue

use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testSetIndex.

@Test
public void testSetIndex() {
    List valueTarget = new List(null, null);
    valueFacade = FACADE_FACTORY.createValue(valueTarget);
    Assert.assertNull(valueTarget.getIndex());
    SimpleValue indexTarget = new SimpleValue(null);
    IValue indexFacade = FACADE_FACTORY.createValue(indexTarget);
    valueFacade.setIndex(indexFacade);
    Assert.assertSame(indexTarget, valueTarget.getIndex());
}
Also used : IValue(org.jboss.tools.hibernate.runtime.spi.IValue) List(org.hibernate.mapping.List) SimpleValue(org.hibernate.mapping.SimpleValue) Test(org.junit.Test)

Example 12 with IValue

use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testGetElement.

@Test
public void testGetElement() {
    Bag bagValueTarget = new Bag(null, null);
    IValue bagValueFacade = FACADE_FACTORY.createValue(bagValueTarget);
    Assert.assertNull(bagValueFacade.getElement());
    SimpleValue simpleValueTarget = new SimpleValue(null);
    bagValueTarget.setElement(simpleValueTarget);
    Assert.assertSame(simpleValueTarget, ((IFacade) bagValueFacade.getElement()).getTarget());
}
Also used : IValue(org.jboss.tools.hibernate.runtime.spi.IValue) Bag(org.hibernate.mapping.Bag) IdentifierBag(org.hibernate.mapping.IdentifierBag) SimpleValue(org.hibernate.mapping.SimpleValue) Test(org.junit.Test)

Example 13 with IValue

use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testGetCollectionElement.

@Test
public void testGetCollectionElement() {
    valueTarget = new SimpleValue(null);
    valueFacade = FACADE_FACTORY.createValue(valueTarget);
    IValue collectionElement = valueFacade.getCollectionElement();
    Assert.assertNull(collectionElement);
    Set set = new Set(null, null);
    set.setElement(valueTarget);
    valueFacade = FACADE_FACTORY.createValue(set);
    collectionElement = valueFacade.getCollectionElement();
    Assert.assertNotNull(collectionElement);
    Assert.assertSame(valueTarget, ((IFacade) collectionElement).getTarget());
}
Also used : IValue(org.jboss.tools.hibernate.runtime.spi.IValue) Set(org.hibernate.mapping.Set) SimpleValue(org.hibernate.mapping.SimpleValue) Test(org.junit.Test)

Example 14 with IValue

use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testGetParentProperty.

@Test
public void testGetParentProperty() {
    Component componentTarget = new Component(null, new RootClass());
    IValue valueFacade = FACADE_FACTORY.createValue(componentTarget);
    Assert.assertNull(valueFacade.getParentProperty());
    componentTarget.setParentProperty("foobar");
    Assert.assertEquals("foobar", valueFacade.getParentProperty());
}
Also used : RootClass(org.hibernate.mapping.RootClass) IValue(org.jboss.tools.hibernate.runtime.spi.IValue) Component(org.hibernate.mapping.Component) Test(org.junit.Test)

Example 15 with IValue

use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testSetKey.

@Test
public void testSetKey() {
    KeyValue keyValueTarget = new SimpleValue(null);
    IValue keyValueFacade = FACADE_FACTORY.createValue(keyValueTarget);
    Collection collectionTarget = new Bag(null, null);
    IValue collectionFacade = FACADE_FACTORY.createValue(collectionTarget);
    Assert.assertNull(collectionTarget.getKey());
    collectionFacade.setKey(keyValueFacade);
    Assert.assertSame(keyValueTarget, collectionTarget.getKey());
}
Also used : KeyValue(org.hibernate.mapping.KeyValue) IValue(org.jboss.tools.hibernate.runtime.spi.IValue) Collection(org.hibernate.mapping.Collection) Bag(org.hibernate.mapping.Bag) IdentifierBag(org.hibernate.mapping.IdentifierBag) SimpleValue(org.hibernate.mapping.SimpleValue) Test(org.junit.Test)

Aggregations

IValue (org.jboss.tools.hibernate.runtime.spi.IValue)144 Test (org.junit.Test)105 SimpleValue (org.hibernate.mapping.SimpleValue)68 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)59 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)40 Bag (org.hibernate.mapping.Bag)20 Set (org.hibernate.mapping.Set)20 IProperty (org.jboss.tools.hibernate.runtime.spi.IProperty)20 ITable (org.jboss.tools.hibernate.runtime.spi.ITable)17 IdentifierBag (org.hibernate.mapping.IdentifierBag)16 KeyValue (org.hibernate.mapping.KeyValue)16 RootClass (org.hibernate.mapping.RootClass)16 Value (org.hibernate.mapping.Value)16 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)13 Collection (org.hibernate.mapping.Collection)8 Component (org.hibernate.mapping.Component)8 List (org.hibernate.mapping.List)8 PersistentClass (org.hibernate.mapping.PersistentClass)8 PrimitiveArray (org.hibernate.mapping.PrimitiveArray)8 Table (org.hibernate.mapping.Table)8