File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jorphan/util/TestJorphanUtils.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jorphan/util/TestJorphanUtils.java | |||
Method name: void testSplit1()
|
Method name: void testSplit4()
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | String in = "a,bc,,"; // Test ignore trailing split characters↵ | 1 | String in = " , ,a ,bc"; // Test leading split characters↵ | |
2 | String out[] = JOrphanUtils.split(in, ",",true);// Ignore adjacent delimiters↵ | 2 | String out[] = JOrphanUtils.split(in, " ,",true);↵ | |
3 | assertEquals(2, out.length);↵ | 3 | assertEquals(2, out.length);↵ | |
4 | assertEquals("a", out[0]);↵ | 4 | assertEquals("a", out[0]);↵ | |
5 | assertEquals("bc", out[1]);↵ | 5 | assertEquals("bc", out[1]);↵ | |
6 | out = JOrphanUtils.split(in, ",",false);↵ | 6 | out = JOrphanUtils.split(in, " ,",false);↵ | |
7 | assertEquals("Should detect the trailing split chars; ", 4, out.length);↵ | 7 | assertEquals("Should detect the leading split chars; ", 4, out.length);↵ | |
8 | assertEquals("a", out[0]);↵ | 8 | assertEquals("", out[0]);↵ | |
9 | assertEquals("bc", out[1]);↵ | 9 | assertEquals("", out[1]);↵ | |
10 | assertEquals("", out[2]);↵ | 10 | assertEquals("a", out[2]);↵ | |
11 | assertEquals("", out[3]); | 11 | assertEquals("bc", out[3]); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 121 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String in = "a,bc,,"; |
| 1 | String in = " , ,a ,bc"; | ||||||||||
2 | String out[] = JOrphanUtils.split(in, ",", true); |
| 2 | String out[] = JOrphanUtils.split(in, " ,", true); | ||||||||||
3 | assertEquals(2, out.length); | 3 | assertEquals(2, out.length); | |||||||||||
4 | assertEquals("a", out[0]); | 4 | assertEquals("a", out[0]); | |||||||||||
5 | assertEquals("bc", out[1]); | 5 | assertEquals("bc", out[1]); | |||||||||||
6 | out = JOrphanUtils.split(in, ",", false); |
| 6 | out = JOrphanUtils.split(in, " ,", false); | ||||||||||
7 | assertEquals("Should detect the trailing split chars; ", 4, out.length); |
| 7 | assertEquals("Should detect the leading split chars; ", 4, out.length); | ||||||||||
8 | assertEquals("a", out[0]); |
| 8 | assertEquals("", out[0]); | ||||||||||
9 | assertEquals("bc", out[1]); |
| 9 | assertEquals("", out[1]); | ||||||||||
10 | assertEquals("", out[2]); |
| 10 | assertEquals("a", out[2]); | ||||||||||
11 | assertEquals("", out[3]); |
| 11 | assertEquals("bc", out[3]); |
Row | Violation |
---|