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); } 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"));
void testVariableExtraction() throws Exception { params = new LinkedList(); params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>")); params.add(new CompoundVariable("$2$")); params.add(new CompoundVariable("2")); variable.setParameters(params); String match = variable.execute(result, null); assertEquals("5", match); } // Test with output variable name public void testVariableExtraction1a() throws Exception { params = new LinkedList(); params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>")); params.add(new CompoundVariable("$2$")); // template params.add(new CompoundVariable("2")); // match number params.add(new CompoundVariable("-")); // ALL separator params.add(new CompoundVariable("default"));
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
void testVariableExtraction4() throws Exception {
1
void testVariableExtraction() throws Exception {
2
			params = new LinkedList();
2
			params = new LinkedList();
3
			params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
3
			params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
4
			params.add(new CompoundVariable("$2$, "));
4
			params.add(new CompoundVariable("$2$"));
5
			params.add(new CompoundVariable(".333"));
5
			params.add(new CompoundVariable("2"));
6
			variable.setParameters(params);
6
			variable.setParameters(params);
7
			String match = variable.execute(result, null);
7
			String match = variable.execute(result, null);
8
			assertEquals("1, ", match);
8
			assertEquals("5", match);
9
		}
9
		}
10
		public void testDefaultValue
10
		// Test with output variable name
11
() throws Exception {
11
        public void testVariableExtraction1a() throws Exception {
12
			params = new LinkedList();
12
            params = new LinkedList();
13
			params.add(new CompoundVariable("<value,, field=\"(pinposition\\d+)\">(\\d+)</value>"));
13
            params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
14
			params.add(new CompoundVariable("$2$, "));
14
            params.add(new CompoundVariable("$2$"));
15
			
15
 // template
16
params.add(new CompoundVariable(".333"));
16
            params.add(new CompoundVariable("
17
			
17
2")); // match number
18
params.add(new CompoundVariable(""));
18
            params.add(new CompoundVariable("-"));
19
			
19
 // ALL separator
20
params.add(new CompoundVariable("No Value Found"));
20
            params.add(new CompoundVariable("default"));
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