Search in sources :

Example 1 with Ext6

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"));
}
Also used : Ext6(com.alibaba.dubbo.common.extensionloader.ext6_inject.Ext6) URL(com.alibaba.dubbo.common.URL) Test(org.junit.Test)

Example 2 with Ext6

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());
}
Also used : Ext6Impl2(com.alibaba.dubbo.common.extensionloader.ext6_inject.impl.Ext6Impl2) Ext6(com.alibaba.dubbo.common.extensionloader.ext6_inject.Ext6) Test(org.junit.Test)

Aggregations

Ext6 (com.alibaba.dubbo.common.extensionloader.ext6_inject.Ext6)2 Test (org.junit.Test)2 URL (com.alibaba.dubbo.common.URL)1 Ext6Impl2 (com.alibaba.dubbo.common.extensionloader.ext6_inject.impl.Ext6Impl2)1