Search in sources :

Example 1 with IntegerHolder

use of org.apache.tapestry5.integration.app1.data.IntegerHolder in project tapestry-5 by apache.

the class PropertyConduitSourceImplTest method not_operator.

@Test
public void not_operator() {
    PropertyConduit conduit = source.create(IntegerHolder.class, "! value");
    IntegerHolder holder = new IntegerHolder();
    assertEquals(conduit.get(holder), Boolean.TRUE);
    holder.setValue(99);
    assertEquals(conduit.get(holder), Boolean.FALSE);
}
Also used : IntegerHolder(org.apache.tapestry5.integration.app1.data.IntegerHolder) PropertyConduit(org.apache.tapestry5.beanmodel.PropertyConduit) InternalPropertyConduit(org.apache.tapestry5.beanmodel.internal.InternalPropertyConduit) PropBindingFactoryTest(org.apache.tapestry5.internal.bindings.PropBindingFactoryTest) Test(org.testng.annotations.Test)

Example 2 with IntegerHolder

use of org.apache.tapestry5.integration.app1.data.IntegerHolder in project tapestry-5 by apache.

the class PropertyConduitSourceImplTest method range_variable_from.

@Test
public void range_variable_from() {
    PropertyConduit pc = source.create(IntegerHolder.class, "value..99");
    IntegerHolder h = new IntegerHolder();
    h.setValue(72);
    IntegerRange ir = (IntegerRange) pc.get(h);
    assertEquals(ir, new IntegerRange(72, 99));
}
Also used : IntegerRange(org.apache.tapestry5.commons.util.IntegerRange) IntegerHolder(org.apache.tapestry5.integration.app1.data.IntegerHolder) PropertyConduit(org.apache.tapestry5.beanmodel.PropertyConduit) InternalPropertyConduit(org.apache.tapestry5.beanmodel.internal.InternalPropertyConduit) PropBindingFactoryTest(org.apache.tapestry5.internal.bindings.PropBindingFactoryTest) Test(org.testng.annotations.Test)

Example 3 with IntegerHolder

use of org.apache.tapestry5.integration.app1.data.IntegerHolder in project tapestry-5 by apache.

the class PropertyConduitSourceImplTest method range_variable_to.

@Test
public void range_variable_to() {
    PropertyConduit pc = source.create(IntegerHolder.class, "10..value");
    IntegerHolder h = new IntegerHolder();
    h.setValue(5);
    IntegerRange ir = (IntegerRange) pc.get(h);
    assertEquals(ir, new IntegerRange(10, 5));
}
Also used : IntegerRange(org.apache.tapestry5.commons.util.IntegerRange) IntegerHolder(org.apache.tapestry5.integration.app1.data.IntegerHolder) PropertyConduit(org.apache.tapestry5.beanmodel.PropertyConduit) InternalPropertyConduit(org.apache.tapestry5.beanmodel.internal.InternalPropertyConduit) PropBindingFactoryTest(org.apache.tapestry5.internal.bindings.PropBindingFactoryTest) Test(org.testng.annotations.Test)

Aggregations

PropertyConduit (org.apache.tapestry5.beanmodel.PropertyConduit)3 InternalPropertyConduit (org.apache.tapestry5.beanmodel.internal.InternalPropertyConduit)3 IntegerHolder (org.apache.tapestry5.integration.app1.data.IntegerHolder)3 PropBindingFactoryTest (org.apache.tapestry5.internal.bindings.PropBindingFactoryTest)3 Test (org.testng.annotations.Test)3 IntegerRange (org.apache.tapestry5.commons.util.IntegerRange)2