assertEquals(yellCount2, Ext3Wrapper2.yellCount.get());
}
@Test
public void test_getExtension_WithWrapper() throws Exception {
WrappedExt impl1 = ExtensionLoader.getExtensionLoader(WrappedExt.class).getExtension("impl1", Arrays.asList("wrapper1", "wrapper2"));
assertThat(impl1, anyOf(instanceOf(Ext3Wrapper1.class), instanceOf(Ext3Wrapper2.class)));
WrappedExt impl2 = ExtensionLoader.getExtensionLoader(WrappedExt.class).getExtension("impl2", Arrays.asList("wrapper1", "wrapper2"));
assertThat(impl2, anyOf(instanceOf(Ext3Wrapper1.class), instanceOf(Ext3Wrapper2.class)));
int echoCount1 = Ext3Wrapper1.echoCount.get();
int echoCount2 = Ext3Wrapper2.echoCount.get();
int yellCount1 = Ext3Wrapper1.yellCount.get();
int yellCount2 = Ext3Wrapper2.yellCount.get();
Map<String, String> config = Utils.kv2Map("protocol", "p1", "host", "1.2.3.4", "port", "1010", "path", "path1");
assertEquals("Ext3Impl1-echo", impl1.echo(config, "ha"));
assertEquals(echoCount1 + 1, Ext3Wrapper1.echoCount.get());
assertEquals(echoCount2 + 1, Ext3Wrapper2.echoCount.get());
assertEquals(yellCount1, Ext3Wrapper1.yellCount.get());
assertEquals(yellCount2, Ext3Wrapper2.yellCount.get());
assertEquals("Ext3Impl2-yell", impl2.yell(config, "ha"));
assertEquals(echoCount1 + 1, Ext3Wrapper1.echoCount.get());
assertEquals(echoCount2 + 1, Ext3Wrapper2.echoCount.get());
assertEquals(yellCount1 + 1, Ext3Wrapper1.yellCount.get());
assertEquals(yellCount2 + 1, Ext3Wrapper2.yellCount.get());
}