Package org.reactfx.inhibeans.value

Examples of org.reactfx.inhibeans.value.CountingListener


                fireValueChangedEvent();
            }
        }

        A a = new A();
        CountingListener counter = new CountingListener(a);
        Guard g = a.block();
        a.set("x");
        assertEquals(0, counter.get());
        Guard h = a.block();
        g.close();
        assertEquals(0, counter.get());
        g.close();
        assertEquals(0, counter.get());
        h.close();
        assertEquals(1, counter.get());
    }
View Full Code Here


public class IndicatorTest {

    @Test
    public void test() {
        Indicator indicator = new Indicator();
        CountingListener counter = new CountingListener(indicator);

        Guard g = indicator.on();

        assertEquals(1, counter.get());

        indicator.onWhile(() -> {});

        assertEquals(1, counter.get());

        g.close();

        assertEquals(2, counter.get());
    }
View Full Code Here

TOP

Related Classes of org.reactfx.inhibeans.value.CountingListener

Copyright © 2018 www.massapicom. 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.