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