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 testCookieWithEquals()
|
Method name: void testCookieOrdering1()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | URL url = new URL("http://a.b.c/");↵ | 1 | URL url = new URL("http://order.now/sub1/moo.html");↵ | |
2 | man.addCookieFromHeader("NSCP_USER_LOGIN1_NEW=SHA=xxxxx", url);↵ | 2 | man.addCookieFromHeader("test1=moo1;path=/", url);↵ | |
3 | String s = man.getCookieHeaderForURL(url);↵ | 3 | man.addCookieFromHeader↵ | |
4 | assertNotNull(s);↵ | |||
5 | assertEquals("NSCP_USER_LOGIN1_NEW=SHA=xxxxx", s);↵ | |||
6 | Cookie c=man.get(0);↵ | |||
7 | assertEquals("NSCP_USER_LOGIN1_NEW",c.getName());↵ | |||
8 | assertEquals("SHA=xxxxx",c.getValue()↵ | 4 | ("test2=moo2;path=/sub1", url);↵ | |
5 | man.addCookieFromHeader("test2=moo3;path=/", url);↵ | |||
6 | assertEquals(3,man.getCookieCount());↵ | |||
7 | String s = man.getCookieHeaderForURL(url);↵ | |||
8 | assertNotNull(s);↵ | |||
9 | ); | 9 | assertEquals("test2=moo2; test1=moo1; test2=moo3", s); | |
See real code fragment | See real code fragment |
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 | 50 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | URL url = new URL("http://a.b.c/"); |
| 1 | URL url = new URL("http://order.now/sub1/moo.html"); | ||||||||||
2 | man.addCookieFromHeader("NSCP_USER_LOGIN1_NEW=SHA=xxxxx", url); |
| 2 | man.addCookieFromHeader("test1=moo1;path=/", url); | ||||||||||
| 3 | man.addCookieFromHeader("test2=moo2;path=/sub1", url); | ||||||||||||
| 4 | man.addCookieFromHeader("test2=moo3;path=/", url); | ||||||||||||
| 5 | assertEquals(3, man.getCookieCount()); | ||||||||||||
3 | String s = man.getCookieHeaderForURL(url); | 6 | String s = man.getCookieHeaderForURL(url); | |||||||||||
4 | assertNotNull(s); | 7 | assertNotNull(s); | |||||||||||
5 | assertEquals("NSCP_USER_LOGIN1_NEW=SHA=xxxxx", s); |
| 8 | assertEquals("test2=moo2; test1=moo1; test2=moo3", s); | ||||||||||
6 | Cookie c = man.get(0); | | ||||||||||||
7 | assertEquals("NSCP_USER_LOGIN1_NEW", c.getName()); | | ||||||||||||
8 | assertEquals("SHA=xxxxx", c.getValue()); | |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables url |