Package org.springframework.binding.value

Examples of org.springframework.binding.value.CommitTrigger.commit()


       
        BufferedValueModel buffer = new BufferedValueModel(wrapped, trigger1);
        buffer.setValue("change1");
        Object wrappedValue = wrapped.getValue();
        Object bufferedValue = buffer.getValue();
        trigger2.commit();
        assertEquals(
            "Changing the unrelated trigger2 to commit has no effect on the wrapped.",
            wrapped.getValue(),
            wrappedValue);
        assertSame(
View Full Code Here


            "Changing the unrelated trigger1 to revert has no effect on the buffer.",
            buffer.getValue(),
            bufferedValue);
       
        // Commit using trigger2.
        trigger2.commit();
        assertEquals(
            "Changing the current trigger2 to commit commits the buffered value.",
            buffer.getValue(),
            wrapped.getValue());
       
View Full Code Here

*/
public class CommitTriggerTests extends TestCase {

    public void testCommitTrigger() {
        CommitTrigger ct = new CommitTrigger();
        ct.commit();
        ct.revert();

        TestCommitTriggerListener l = new TestCommitTriggerListener();
        ct.addCommitTriggerListener(l);
        assertEquals(0, l.commits);
View Full Code Here

        TestCommitTriggerListener l = new TestCommitTriggerListener();
        ct.addCommitTriggerListener(l);
        assertEquals(0, l.commits);
        assertEquals(0, l.reverts);

        ct.commit();
        assertEquals(1, l.commits);
        ct.commit();
        assertEquals(2, l.commits);
        assertEquals(0, l.reverts);
        ct.revert();
View Full Code Here

        assertEquals(0, l.commits);
        assertEquals(0, l.reverts);

        ct.commit();
        assertEquals(1, l.commits);
        ct.commit();
        assertEquals(2, l.commits);
        assertEquals(0, l.reverts);
        ct.revert();
        assertEquals(2, l.commits);
        assertEquals(1, l.reverts);
View Full Code Here

        assertEquals(2, l.commits);
        assertEquals(1, l.reverts);
       
        ct.removeCommitTriggerListener(l);
       
        ct.commit();
        assertEquals(2, l.commits);
        ct.revert();
        assertEquals(1, l.reverts);       
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.