本文整理汇总了Java中com.alibaba.dubbo.common.extensionloader.ext2.Ext2类的典型用法代码示例。如果您正苦于以下问题:Java Ext2类的具体用法?Java Ext2怎么用?Java Ext2使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Ext2类属于com.alibaba.dubbo.common.extensionloader.ext2包,在下文中一共展示了Ext2类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_urlHolder_getAdaptiveExtension_ExceptionWhenNotAdativeMethod
import com.alibaba.dubbo.common.extensionloader.ext2.Ext2; //导入依赖的package包/类
@Test
public void test_urlHolder_getAdaptiveExtension_ExceptionWhenNotAdativeMethod() throws Exception {
Ext2 ext = ExtensionLoader.getExtensionLoader(Ext2.class).getAdaptiveExtension();
Map<String, String> map = new HashMap<String, String>();
URL url = new URL("p1", "1.2.3.4", 1010, "path1", map);
try {
ext.bang(url, 33);
fail();
} catch (UnsupportedOperationException expected) {
assertThat(expected.getMessage(), containsString("method "));
assertThat(
expected.getMessage(),
containsString("of interface com.alibaba.dubbo.common.extensionloader.ext2.Ext2 is not adaptive method!"));
}
}
示例2: test_urlHolder_getAdaptiveExtension
import com.alibaba.dubbo.common.extensionloader.ext2.Ext2; //导入依赖的package包/类
@Test
public void test_urlHolder_getAdaptiveExtension() throws Exception {
Ext2 ext = ExtensionLoader.getExtensionLoader(Ext2.class).getAdaptiveExtension();
Map<String, String> map = new HashMap<String, String>();
map.put("ext2", "impl1");
URL url = new URL("p1", "1.2.3.4", 1010, "path1", map);
UrlHolder holder = new UrlHolder();
holder.setUrl(url);
String echo = ext.echo(holder, "haha");
assertEquals("Ext2Impl1-echo", echo);
}
示例3: test_getDefaultExtension_NULL
import com.alibaba.dubbo.common.extensionloader.ext2.Ext2; //导入依赖的package包/类
@Test
public void test_getDefaultExtension_NULL() throws Exception {
Ext2 ext = ExtensionLoader.getExtensionLoader(Ext2.class).getDefaultExtension();
assertNull(ext);
String name = ExtensionLoader.getExtensionLoader(Ext2.class).getDefaultExtensionName();
assertNull(name);
}