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); } public void testDefaultValue() 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")); params.add(new CompoundVariable("")); params.add(new CompoundVariable("No Value Found")); variable.setParameters(params); String match = variable.execute(result, null); assertEquals("No Value Found", match);
params.add(new CompoundVariable("$1$")); params.add(new CompoundVariable("ALL")); params.add(new CompoundVariable("_")); variable.setParameters(params); String match = variable.execute(result, null); assertEquals("pinposition1_pinposition2_pinposition3", match); } public void testVariableExtraction6() throws Exception { params = new LinkedList(); params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>")); params.add(new CompoundVariable("$2$")); 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);
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("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
1
params.add(new CompoundVariable("$1$"));
2
			params.add(new CompoundVariable("$2$, "));
2
			params.add(new CompoundVariable("ALL"));
3
			params.add(new CompoundVariable(".333"));
3
			params.add(new CompoundVariable("_"));
4
			variable.setParameters(params);
4
			variable.setParameters(params);
5
			String match = variable.execute(result, null);
5
			String match = variable.execute(result, null);
6
			assertEquals("1, ", match);
6
			assertEquals("pinposition1_pinposition2_pinposition3", match);
7
		}
7
		}
8
		public void testDefaultValue() throws Exception {
8
		public void testVariableExtraction6() 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("$2$, "));
11
			params.add(new CompoundVariable("$2$"));
12
			params.add(new CompoundVariable(".333"));
12
			params.add(new CompoundVariable("4"));
13
			params.add(new CompoundVariable(""));
13
			params.add(new CompoundVariable(""));
14
			params.add(new CompoundVariable("No Value Found"));
14
			params.add(new CompoundVariable("default"));
15
			variable.setParameters(params);
15
			variable.setParameters(params);
16
			String match = variable.execute(result, null);
16
			String match = variable.execute(result, null);
17
			assertEquals("No Value Found", match);
17
			assertEquals("default", match);
18
		
18
		
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