1 | params.add(new CompoundVariable("4"));↵ | | 1 | params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));↵
|
2 | params.add(new CompoundVariable(""));↵ | | 2 | params.add(new CompoundVariable("_$1$"));↵
|
3 | params.add(new CompoundVariable("default"));↵ | | 3 | params.add(new CompoundVariable("2"));↵
|
4 | variable.setParameters(params);↵ | | 4 | variable.setParameters(params);↵
|
5 | String match = variable.execute(result, null);↵ | | 5 | String match = variable.execute(result, null);↵
|
6 | assertEquals("default", match);↵ | | 6 | assertEquals("_pinposition2", match);↵
|
7 | }↵ | | 7 | }↵
|
|
8 | public void testComma() throws Exception {↵ | | 8 | public void testVariableExtraction4() throws Exception {↵
|
9 | params = new LinkedList();↵ | | 9 | params = new LinkedList();↵
|
10 | params.add(new CompoundVariable("<value,? field=\"(pinposition\\d+)\">(\\d+)</value>"));↵ | | 10 | params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));↵
|
11 | params.add(new CompoundVariable("$1$"));↵ | | 11 | params.add(new CompoundVariable("$2$, "));↵
|
12 | params.add(new CompoundVariable("3"));↵ | | 12 | params.add(new CompoundVariable(".333"));↵
|
13 | variable.setParameters(params);↵ | | 13 | variable.setParameters(params);↵
|
14 | String match = variable.execute(result, null);↵ | | 14 | String match = variable.execute(result, null);↵
|
15 | assertEquals("pinposition3", match);↵ | | 15 | assertEquals("1, ", match);↵
|
16 | | | 16 |
|