Revision 29517
Added by Jochen Schirrwagen almost 10 years ago
RuleLanguageTest.java | ||
---|---|---|
61 | 61 |
RuleLanguageVisitor v = parseValid(scriptBuilder.toString()); |
62 | 62 |
assertTrue(v.getPreprocessings().get(0).containsKey("dblookup")); |
63 | 63 |
} |
64 |
|
|
64 |
|
|
65 | 65 |
@Test |
66 | 66 |
public void testLookup(){ |
67 | 67 |
final String rule = "dc:relation = lookup(xpath:\"//proc:provenance\", \"name\");\r\n"; |
... | ... | |
384 | 384 |
assertEquals("//dc:identifier", r.getCondition().getApplyExpression()); |
385 | 385 |
} |
386 | 386 |
} |
387 |
|
|
387 |
|
|
388 | 388 |
@Test |
389 |
public void testCopy(){ |
|
390 |
final String rule = "dc:title = copy(\"dc:title\", \"//dc:title\", \"@*|node()\");\r\n"; |
|
391 |
scriptBuilder = new StringBuilder(); |
|
392 |
scriptBuilder.append(declareScript); |
|
393 |
scriptBuilder.append(rule); |
|
394 |
scriptBuilder.append(endScript); |
|
395 |
RuleLanguageVisitor v = parseValid(scriptBuilder.toString()); |
|
396 |
Set<IRule> s = v.getElementMappingRules().get("dc:title"); |
|
397 |
assertNotNull(s); |
|
398 |
assertEquals("dc:title", (s.toArray(new Rules[0]))[0].getTemplateMatch()); |
|
399 |
} |
|
400 |
|
|
401 |
@Test |
|
389 | 402 |
public void parseSetRule(){ |
390 | 403 |
final String rule = "dc:identifier = set(\"CONST\" , @type = \"ABC\"; , @lang = \"ger\";);"; |
391 | 404 |
scriptBuilder = new StringBuilder(); |
Also available in: Unified diff
implemented copy function that mimics the identify transform