本文整理汇总了Java中com.alibaba.dubbo.registry.common.route.ParseUtils.interpolate方法的典型用法代码示例。如果您正苦于以下问题:Java ParseUtils.interpolate方法的具体用法?Java ParseUtils.interpolate怎么用?Java ParseUtils.interpolate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alibaba.dubbo.registry.common.route.ParseUtils
的用法示例。
在下文中一共展示了ParseUtils.interpolate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testInterpolateCollMap_NormalCase
import com.alibaba.dubbo.registry.common.route.ParseUtils; //导入方法依赖的package包/类
@Test
public void testInterpolateCollMap_NormalCase() throws Exception {
List<String> expressions = new ArrayList<String>();
expressions.add("xx$var1");
expressions.add("yy${var2}zz");
Map<String, String> params = new HashMap<String, String>();
params.put("var1", "CAT");
params.put("var2", "DOG");
List<String> interpolate = ParseUtils.interpolate(expressions, params);
List<String> expected = new ArrayList<String>();
expected.add("xxCAT");
expected.add("yyDOGzz");
assertEquals(expected, interpolate);
}
示例2: testInterpolateVariable
import com.alibaba.dubbo.registry.common.route.ParseUtils; //导入方法依赖的package包/类
@Test
public void testInterpolateVariable() throws Exception {
Map<String, String> params = new HashMap<String, String>();
params.put("consumer.address", "10.20.130.230");
String regexp = ParseUtils.interpolate("xx$consumer.address", params);
assertEquals("xx10.20.130.230", regexp);
}
示例3: testInterpolateVariableWithParentheses
import com.alibaba.dubbo.registry.common.route.ParseUtils; //导入方法依赖的package包/类
@Test
public void testInterpolateVariableWithParentheses() throws Exception {
Map<String, String> params = new HashMap<String, String>();
params.put("consumer.address", "10.20.130.230");
String regexp = ParseUtils.interpolate("xx${consumer.address}yy", params);
assertEquals("xx10.20.130.230yy", regexp);
}
示例4: testInterpolateDot
import com.alibaba.dubbo.registry.common.route.ParseUtils; //导入方法依赖的package包/类
@Test
public void testInterpolateDot() throws Exception {
String regexp = ParseUtils.interpolate("com.alibaba.morgan.MemberService",
new HashMap<String, String>());
assertEquals("com.alibaba.morgan.MemberService", regexp);
}
示例5: testInterpolateWildcard
import com.alibaba.dubbo.registry.common.route.ParseUtils; //导入方法依赖的package包/类
@Test
public void testInterpolateWildcard() throws Exception {
String regexp = ParseUtils.interpolate("com.alibaba.morgan.*",
new HashMap<String, String>());
assertEquals("com.alibaba.morgan.*", regexp);
}
示例6: testInterpolateSequence
import com.alibaba.dubbo.registry.common.route.ParseUtils; //导入方法依赖的package包/类
@Test
public void testInterpolateSequence() throws Exception {
String regexp = ParseUtils.interpolate("1.0.[0-9]", new HashMap<String, String>());
assertEquals("1.0.[0-9]", regexp.toString());
}