File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/TestRegexFunction.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/TestTimeFunction.java | |||
Method name: void testVariableExtraction4()
|
Method name: void testYMD()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
1 | params = new LinkedList();↵ | |||
2 | params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));↵ | 1 | params.add(new CompoundVariable("↵ | |
3 | params.add(new CompoundVariable("$2$, "));↵ | 2 | YMD"));↵ | |
4 | params.add(new CompoundVariable(".333"));↵ | 3 | params.add(new CompoundVariable("NAME"));↵ | |
5 | variable.setParameters(params);↵ | 4 | variable.setParameters(params);↵ | |
6 | String match = variable.execute(result, null);↵ | 5 | value = variable.execute(result, null);↵ | |
7 | assertEquals("1, ", match↵ | 6 | assertEquals(8,value.length());↵ | |
8 | ); | 7 | assertEquals(value,vars.get("NAME")); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 42 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | params = new LinkedList(); | | |||||||||||||||
2 | params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>")); |
| 1 | params.add(new CompoundVariable("YMD")); | |||||||||||||
3 | params.add(new CompoundVariable("$2$, ")); |
| 2 | params.add(new CompoundVariable("NAME")); | |||||||||||||
4 | params.add(new CompoundVariable(".333")); | | |||||||||||||||
5 | variable.setParameters(params); |
| 3 | variable.setParameters(params); | |||||||||||||
|
| 4 | value = variable.execute(result, null); | ||||||||||||||
| 5 | assertEquals(8, value.length()); | |||||||||||||||
6 | String match = variable.execute(result, null); |
| | ||||||||||||||
7 | assertEquals("1, ", match); |
| 6 | assertEquals(value, vars.get("NAME")); |
Row | Violation |
---|---|
1 | Type org.apache.jmeter.functions.RegexFunction of variable variable does not match with type org.apache.jmeter.functions.Function of variable variable |
2 | Unmatched statement value=variable.execute(result,null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement String match=variable.execute(result,null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |