Package com.example

Examples of com.example.Counter


        Registry r = buildRegistry(ReloadAwareModule.class);

        assertEquals(ReloadAwareModule.counterInstantiations, 0);
        assertEquals(ReloadAwareModule.counterReloads, 0);

        Counter counter = r.proxy(Counter.class, CounterImpl.class);

        assertEquals(ReloadAwareModule.counterInstantiations, 0);

        assertEquals(counter.increment(), 1);
        assertEquals(counter.increment(), 2);

        assertEquals(ReloadAwareModule.counterInstantiations, 1);

        URL classURL = CounterImpl.class.getResource("CounterImpl.class");

        File classFile = new File(classURL.toURI());

        touch(classFile);

        assertEquals(ReloadAwareModule.counterInstantiations, 1);
        assertEquals(ReloadAwareModule.counterReloads, 0);

        fireUpdateCheck(r);

        assertEquals(ReloadAwareModule.counterInstantiations, 2);
        assertEquals(ReloadAwareModule.counterReloads, 1);

        // Check that internal state has reset

        assertEquals(counter.increment(), 1);

        r.shutdown();
    }
View Full Code Here


        Registry r = buildRegistry(ReloadAwareModule.class);

        assertEquals(ReloadAwareModule.counterInstantiations, 0);
        assertEquals(ReloadAwareModule.counterReloads, 0);

        Counter counter = r.proxy(Counter.class, CounterImpl.class);

        assertEquals(ReloadAwareModule.counterInstantiations, 0);

        assertEquals(counter.increment(), 1);
        assertEquals(counter.increment(), 2);

        assertEquals(ReloadAwareModule.counterInstantiations, 1);

        URL classURL = CounterImpl.class.getResource("CounterImpl.class");

        File classFile = new File(classURL.toURI());

        touch(classFile);

        assertEquals(ReloadAwareModule.counterInstantiations, 1);
        assertEquals(ReloadAwareModule.counterReloads, 0);

        fireUpdateCheck(r);

        assertEquals(ReloadAwareModule.counterInstantiations, 2);
        assertEquals(ReloadAwareModule.counterReloads, 1);

        // Check that internal state has reset

        assertEquals(counter.increment(), 1);

        r.shutdown();
    }
View Full Code Here

TOP

Related Classes of com.example.Counter

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.