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