use of com.alibaba.dubbo.common.extensionloader.ext6_inject.Ext6 in project dubbo by alibaba.
the class ExtensionLoader_Adaptive_Test method test_getAdaptiveExtension_inject.
@Test
public void test_getAdaptiveExtension_inject() throws Exception {
LogUtil.start();
Ext6 ext = ExtensionLoader.getExtensionLoader(Ext6.class).getAdaptiveExtension();
URL url = new URL("p1", "1.2.3.4", 1010, "path1");
url = url.addParameters("ext6", "impl1");
assertEquals("Ext6Impl1-echo-Ext1Impl1-echo", ext.echo(url, "ha"));
Assert.assertTrue("can not find error.", LogUtil.checkNoError());
LogUtil.stop();
url = url.addParameters("simple.ext", "impl2");
assertEquals("Ext6Impl1-echo-Ext1Impl2-echo", ext.echo(url, "ha"));
}
use of com.alibaba.dubbo.common.extensionloader.ext6_inject.Ext6 in project dubbo by alibaba.
the class ExtensionLoader_Adaptive_Test method test_getAdaptiveExtension_InjectNotExtFail.
@Test
public void test_getAdaptiveExtension_InjectNotExtFail() throws Exception {
Ext6 ext = ExtensionLoader.getExtensionLoader(Ext6.class).getExtension("impl2");
Ext6Impl2 impl = (Ext6Impl2) ext;
assertNull(impl.getList());
}