assertEquals(3,man.getCookieCount());
assertEquals("/sub1",man.get(0).getPath());
assertEquals("/sub1",man.get(1).getPath());
assertEquals("/",man.get(2).getPath());
String s = man.getCookieHeaderForURL(url);
assertNotNull(s);
org.apache.commons.httpclient.Cookie[] c = man.getCookiesForUrl(url);
assertEquals(3,man.getCookieCount());
assertEquals("/sub1",man.get(0).getPath()); // Defaults to caller URL
assertEquals("/sub1",man.get(1).getPath());
assertEquals("/",man.get(2).getPath());
String s = man.getCookieHeaderForURL(url);
assertNotNull(s);
org.apache.commons.httpclient.Cookie[] c = man.getCookiesForUrl(url);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/control/TestCookieManager.java
|
|
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/control/TestCookieManager.java
|
Method name: void testCookiePolicyNetscape()
|
|
Method name: void testCookieOrdering2()
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | assertEquals(3,man.getCookieCount());↵ | | 1 | assertEquals(3,man.getCookieCount());↵
|
2 | assertEquals("/sub1",man.get(0).getPath());↵ | | 2 | assertEquals("/sub1",man.get(0).getPath()); // Defaults to caller URL↵
|
3 | assertEquals("/sub1",man.get(1).getPath());↵ | | 3 | assertEquals("/sub1",man.get(1).getPath());↵
|
4 | assertEquals("/",man.get(2).getPath());↵ | | 4 | assertEquals("/",man.get(2).getPath());↵
|
5 | String s = man.getCookieHeaderForURL(url);↵ | | 5 | String s = man.getCookieHeaderForURL(url);↵
|
6 | assertNotNull(s);↵ | | 6 | assertNotNull(s);↵
|
7 | org.apache.commons.httpclient.Cookie[] c = man.getCookiesForUrl(url); | | 7 | org.apache.commons.httpclient.Cookie[] c = man.getCookiesForUrl(url);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
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 | 49 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
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 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | assertEquals(3, man.getCookieCount()); | | 5 | assertEquals(3, man.getCookieCount()); |
7 | assertEquals("/sub1", man.get(0).getPath()); | | 6 | assertEquals("/sub1", man.get(0).getPath()); |
8 | assertEquals("/sub1", man.get(1).getPath()); | | 7 | assertEquals("/sub1", man.get(1).getPath()); |
9 | assertEquals("/", man.get(2).getPath()); | | 8 | assertEquals("/", man.get(2).getPath()); |
10 | String s = man.getCookieHeaderForURL(url); | | 9 | String s = man.getCookieHeaderForURL(url); |
11 | assertNotNull(s); | | 10 | assertNotNull(s); |
12 | org.apache.commons.httpclient.Cookie[] c = man.getCookiesForUrl(url); | | 11 | org.apache.commons.httpclient.Cookie[] c = man.getCookiesForUrl(url); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables c, s , while Clone fragment #2 returns variables c, s |