File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/util/CacheTestUtil.java | File path: /hibernate-distribution-3.3.2.GA/project/testing/src/main/java/org/hibernate/junit/UnitTestCase.java | |||
Method name: TestSuite createFailureExpectedSuite(Class)
|
Method name: TestSuite createFailureExpectedSuite(Class)
|
|||
Number of AST nodes: 18 | Number of AST nodes: 18 | |||
1 | TestSuite allTests = new TestSuite(testClass);↵ | 1 | TestSuite allTests = new TestSuite(testClass); ↵ | |
2 | Set failureExpected = new HashSet();↵ | 2 | Set failureExpected = new HashSet();↵ | |
3 | ↵ | |||
4 | Enumeration tests = allTests.tests();↵ | 3 | Enumeration tests = allTests.tests();↵ | |
5 | ↵ | |||
6 | while (tests.hasMoreElements()) {↵ | 4 | while (tests.hasMoreElements()) {↵ | |
7 | ↵ | |||
8 | Test t = (Test) tests.nextElement();↵ | 5 | Test t = (Test) tests.nextElement();↵ | |
9 | ↵ | |||
10 | if (t instanceof TestCase) {↵ | 6 | if (t instanceof TestCase) {↵ | |
11 | ↵ | |||
12 | String name = ((TestCase) t).getName();↵ | 7 | String name = ((TestCase) t).getName();↵ | |
13 | ↵ | |||
14 | if (name.endsWith("FailureExpected"))↵ | 8 | if (name.endsWith("FailureExpected"))↵ | |
15 | ↵ | |||
16 | failureExpected.add(name);↵ | 9 | failureExpected.add(name);↵ | |
17 | ↵ | |||
18 | } ↵ | 10 | } ↵ | |
19 | }↵ | |||
20 | ↵ | |||
21 | ↵ | |||
11 | }↵ | |||
12 | ↵ | |||
22 | TestSuite result = new TestSuite();↵ | 13 | TestSuite result = new TestSuite(); ↵ | |
23 | tests = allTests.tests();↵ | 14 | tests = allTests.tests(); ↵ | |
24 | while (tests.hasMoreElements()) {↵ | 15 | while (tests.hasMoreElements()) { ↵ | |
25 | Test t = (Test) tests.nextElement();↵ | 16 | Test t = (Test) tests.nextElement(); ↵ | |
26 | if (t instanceof TestCase) {↵ | 17 | if (t instanceof TestCase) { ↵ | |
27 | String name = ((TestCase) t).getName();↵ | 18 | String name = ((TestCase) t).getName(); ↵ | |
28 | if (!failureExpected.contains(name + "FailureExpected")) {↵ | 19 | if (!failureExpected.contains(name + "FailureExpected")) { ↵ | |
29 | result.addTest(t);↵ | 20 | result.addTest(t); ↵ | |
30 | }↵ | 21 | } ↵ | |
31 | } ↵ | 22 | } ↵ | |
32 | }↵ | 23 | }↵ | |
33 | ↵ | |||
34 | ↵ | |||
24 | ↵ | |||
35 | return result; | 25 | return result; | |
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.6 |
Clones location | Clones are in different classes |
Number of node comparisons | 49 |
Number of mapped statements | 18 |
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) | 2.4 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | TestSuite allTests = new TestSuite(testClass); | 1 | TestSuite allTests = new TestSuite(testClass); | |
2 | Set failureExpected = new HashSet(); | 2 | Set failureExpected = new HashSet(); | |
3 | Enumeration tests = allTests.tests(); | 3 | Enumeration tests = allTests.tests(); | |
4 | while (tests.hasMoreElements()) | 4 | while (tests.hasMoreElements()) | |
5 | Test t = (Test)tests.nextElement(); | 5 | Test t = (Test)tests.nextElement(); | |
6 | if (t instanceof TestCase) | 6 | if (t instanceof TestCase) | |
7 | String name = ((TestCase)t).getName(); | 7 | String name = ((TestCase)t).getName(); | |
8 | if (name.endsWith("FailureExpected")) | 8 | if (name.endsWith("FailureExpected")) | |
9 | failureExpected.add(name); | 9 | failureExpected.add(name); | |
10 | TestSuite result = new TestSuite(); | 10 | TestSuite result = new TestSuite(); | |
11 | tests = allTests.tests(); | 11 | tests = allTests.tests(); | |
12 | while (tests.hasMoreElements()) | 12 | while (tests.hasMoreElements()) | |
13 | Test t = (Test)tests.nextElement(); | 13 | Test t = (Test)tests.nextElement(); | |
14 | if (t instanceof TestCase) | 14 | if (t instanceof TestCase) | |
15 | String name = ((TestCase)t).getName(); | 15 | String name = ((TestCase)t).getName(); | |
16 | if (!failureExpected.contains(name + "FailureExpected")) | 16 | if (!failureExpected.contains(name + "FailureExpected")) | |
17 | result.addTest(t); | 17 | result.addTest(t); | |
18 | return result; | 18 | return result; |
Row | Violation |
---|