1 | void testVariableExtraction4() throws Exception {↵ | | 1 | void testVariableExtraction() throws Exception {↵
|
2 | params = new LinkedList();↵ | | 2 | params = new LinkedList();↵
|
3 | params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));↵ | | 3 | params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));↵
|
4 | params.add(new CompoundVariable("$2$, "));↵ | | 4 | params.add(new CompoundVariable("$2$"));↵
|
5 | params.add(new CompoundVariable(".333"));↵ | | 5 | params.add(new CompoundVariable("2"));↵
|
6 | variable.setParameters(params);↵ | | 6 | variable.setParameters(params);↵
|
7 | String match = variable.execute(result, null);↵ | | 7 | String match = variable.execute(result, null);↵
|
8 | assertEquals("1, ", match);↵ | | 8 | assertEquals("5", match);↵
|
9 | }↵ | | 9 | }↵
|
|
10 | public void testDefaultValue↵ | | 10 | // Test with output variable name↵
|
11 | () throws Exception {↵ | | 11 | public void testVariableExtraction1a() throws Exception {↵
|
12 | params = new LinkedList();↵ | | 12 | params = new LinkedList();↵
|
13 | params.add(new CompoundVariable("<value,, field=\"(pinposition\\d+)\">(\\d+)</value>"));↵ | | 13 | params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));↵
|
14 | params.add(new CompoundVariable("$2$, "));↵ | | 14 | params.add(new CompoundVariable("$2$"));↵
|
15 | ↵ | | 15 | // template↵
|
16 | params.add(new CompoundVariable(".333"));↵ | | 16 | params.add(new CompoundVariable("↵
|
17 | ↵ | | 17 | 2")); // match number↵
|
18 | params.add(new CompoundVariable(""));↵ | | 18 | params.add(new CompoundVariable("-"));↵
|
19 | ↵ | | 19 | // ALL separator↵
|
20 | params.add(new CompoundVariable("No Value Found")) | | 20 | params.add(new CompoundVariable("default"))
|