@Test
public void testSimpleTypeObjectExpressions() throws Exception {
ModelNode description = createDescription(ModelType.OBJECT, ModelType.LONG);
description.get(EXPRESSIONS_ALLOWED).set(true);
TypeConverter converter = getConverter(description);
assertMapType(assertCast(TabularType.class, converter.getOpenType()), SimpleType.STRING, SimpleType.LONG);
ModelNode node = new ModelNode();
node.get("one").set(new ValueExpression("${this.should.not.exist.!!!!!:1}"));
node.get("two").set(new ValueExpression("${this.should.not.exist.!!!!!:2}"));
TabularData tabularData = assertCast(TabularData.class, converter.fromModelNode(node));
Assert.assertEquals(2, tabularData.size());
Assert.assertEquals((long) 1, tabularData.get(new Object[] {"one"}).get("value"));
Assert.assertEquals((long) 2, tabularData.get(new Object[] {"two"}).get("value"));
}
LegacyTypeConverterUnitTestCase.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:wildfly-core
作者:
评论列表
文章目录