params.add(new CompoundVariable("4")); params.add(new CompoundVariable("")); params.add(new CompoundVariable("default")); variable.setParameters(params); String match = variable.execute(result, null); assertEquals("default", match); } public void testComma() throws Exception { params = new LinkedList(); params.add(new CompoundVariable("<value,? field=\"(pinposition\\d+)\">(\\d+)</value>")); params.add(new CompoundVariable("$1$")); params.add(new CompoundVariable("3")); variable.setParameters(params); String match = variable.execute(result, null); assertEquals("pinposition3", match); } public void testVariableExtraction3() throws Exception { params = new LinkedList(); params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>")); params.add(new CompoundVariable("_$1$")); params.add(new CompoundVariable("2")); variable.setParameters(params); String match = variable.execute(result, null); assertEquals("_pinposition2", match); }
params.add(new CompoundVariable("<value,? field=\"(pinposition\\d+)\">(\\d+)</value>")); params.add(new CompoundVariable("$1$")); params.add(new CompoundVariable("3")); variable.setParameters(params); String match = variable.execute(result, null); assertEquals("pinposition3", match); } public void testVariableExtraction3() throws Exception { params = new LinkedList(); params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>")); params.add(new CompoundVariable("_$1$")); params.add(new CompoundVariable("2")); variable.setParameters(params); String match = variable.execute(result, null); assertEquals("_pinposition2", match); } public void testVariableExtraction4() throws Exception { params = new LinkedList(); params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>")); params.add(new CompoundVariable("$2$, ")); params.add(new CompoundVariable(".333")); variable.setParameters(params); String match = variable.execute(result, null); assertEquals("1, ", match); }
Clone fragments detected by clone detection tool
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/TestRegexFunction.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
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
		}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0