Package com.oldratlee.cooma.ext5.impl

Examples of com.oldratlee.cooma.ext5.impl.Ext5Impl1


        assertTrue(ExtensionLoader.getExtensionLoader(Ext1.class).getExtension("impl2") instanceof Ext1Impl2);
    }
   
    @Test
    public void test_getExtension_WithWrapper() throws Exception {
        Ext5NoAdaptiveMethod impl1 = ExtensionLoader.getExtensionLoader(Ext5NoAdaptiveMethod.class).getExtension("impl1");
        assertThat(impl1, anyOf(instanceOf(Ext5Wrapper1.class), instanceOf(Ext5Wrapper2.class)));
       
        Ext5NoAdaptiveMethod impl2 = ExtensionLoader.getExtensionLoader(Ext5NoAdaptiveMethod.class).getExtension("impl2") ;
        assertThat(impl2, anyOf(instanceOf(Ext5Wrapper1.class), instanceOf(Ext5Wrapper2.class)));
       
       
        Config config = Config.fromKv("protocol", "p1", "host", "1.2.3.4", "port", "1010", "path", "path1");
        int echoCount1 = Ext5Wrapper1.echoCount.get();
        int echoCount2 = Ext5Wrapper2.echoCount.get();
        int yellCount1 = Ext5Wrapper1.yellCount.get();
        int yellCount2 = Ext5Wrapper2.yellCount.get();
       
        assertEquals("Ext5Impl1-echo", impl1.echo(config, "ha"));
        assertEquals(echoCount1 + 1, Ext5Wrapper1.echoCount.get());
        assertEquals(echoCount2 + 1, Ext5Wrapper2.echoCount.get());
        assertEquals(yellCount1, Ext5Wrapper1.yellCount.get());
        assertEquals(yellCount2, Ext5Wrapper2.yellCount.get());
       
        assertEquals("Ext5Impl2-yell", impl2.yell(config, "ha"));
        assertEquals(echoCount1 + 1, Ext5Wrapper1.echoCount.get());
        assertEquals(echoCount2 + 1, Ext5Wrapper2.echoCount.get());
        assertEquals(yellCount1 + 1, Ext5Wrapper1.yellCount.get());
        assertEquals(yellCount2 + 1, Ext5Wrapper2.yellCount.get());
    }
View Full Code Here

TOP

Related Classes of com.oldratlee.cooma.ext5.impl.Ext5Impl1

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.