void testMissingPath0() throws Exception { URL url = new URL("http://d.e.f/goo.html"); man.addCookieFromHeader("test=moo", url); String s = man.getCookieHeaderForURL(new URL("http://d.e.f/")); assertNotNull(s); assertEquals("test=moo", s); } /** Tests missing cookie path for a non-trivial URL fetch from the * domain. Note that this fails prior to a fix for BUG 38256 */ public void testMissingPath1() throws Exception { URL url = new URL("http://d.e.f/moo.html"); man.addCookieFromHeader("test=moo", url); String s = man.getCookieHeaderForURL(new URL("http://d.e.f/goo.html")); assertNotNull(s); assertEquals("test=moo", s); } /** Tests explicit root path with a trivial URL fetch from the domain */ public void testRootPath0() throws Exception { URL url = new URL("http://d.e.f/goo.html"); man.addCookieFromHeader("test=moo;path=/", url); String s = man.getCookieHeaderForURL(new URL("http://d.e.f/")); assertNotNull(s); assertEquals("test=moo", s);
void testMissingPath1() throws Exception { URL url = new URL("http://d.e.f/moo.html"); man.addCookieFromHeader("test=moo", url); String s = man.getCookieHeaderForURL(new URL("http://d.e.f/goo.html")); assertNotNull(s); assertEquals("test=moo", s); } /** Tests explicit root path with a trivial URL fetch from the domain */ public void testRootPath0() throws Exception { URL url = new URL("http://d.e.f/goo.html"); man.addCookieFromHeader("test=moo;path=/", url); String s = man.getCookieHeaderForURL(new URL("http://d.e.f/")); assertNotNull(s); assertEquals("test=moo", s); } /** Tests explicit root path with a non-trivial URL fetch from the domain */ public void testRootPath1() throws Exception { URL url = new URL("http://d.e.f/moo.html"); man.addCookieFromHeader("test=moo;path=/", url); String s = man.getCookieHeaderForURL(new URL("http://d.e.f/goo.html")); assertNotNull(s); assertEquals("test=moo", s);
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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void testMissingPath0() throws Exception {
2
 			URL url = new URL("http://d.e.f/goo.html");
3
 			man.addCookieFromHeader("test=moo", url);
4
 			String s = man.getCookieHeaderForURL(new URL("http://d.e.f/"));
5
 			assertNotNull(s);
6
 			assertEquals("test=moo", s);
7
 		}
8
 		
9
 		/** Tests missing cookie path for a non-trivial URL fetch from the 
10
 		 *  domain.  Note that this fails prior to a fix for BUG 38256
11
 		 */
12
 		public void testMissingPath1() throws Exception {
1
void testMissingPath1() throws Exception {
13
 			URL url = new URL("http://d.e.f/moo.html");
2
 			URL url = new URL("http://d.e.f/moo.html");
14
 			man.addCookieFromHeader("test=moo", url);
3
 			man.addCookieFromHeader("test=moo", url);
15
 			String s = man.getCookieHeaderForURL(new URL("http://d.e.f/goo.html"));
4
 			String s = man.getCookieHeaderForURL(new URL("http://d.e.f/goo.html"));
16
 			assertNotNull(s);
5
 			assertNotNull(s);
17
 			assertEquals("test=moo", s);
6
 			assertEquals("test=moo", s);
18
 		}
7
 		}
19
 		
8
 		
20
 		/** Tests explicit root path with a trivial URL fetch from the domain */
9
 		/** Tests explicit root path with a trivial URL fetch from the domain */
21
 		public void testRootPath0() throws Exception {
10
 		public void testRootPath0() throws Exception {
22
 			URL url = new URL("http://d.e.f/goo.html");
11
 			URL url = new URL("http://d.e.f/goo.html");
23
 			man.addCookieFromHeader("test=moo;path=/", url);
12
 			man.addCookieFromHeader("test=moo;path=/", url);
24
 			String s = man.getCookieHeaderForURL(new URL("http://d.e.f/"));
13
 			String s = man.getCookieHeaderForURL(new URL("http://d.e.f/"));
25
 			assertNotNull(s);
14
 			assertNotNull(s);
26
 			assertEquals("test=moo", s);
15
 			assertEquals("test=moo", s);
27
 		
16
 		}
17
 		
18
 		/** Tests explicit root path with a non-trivial URL fetch from the domain */
19
 		public void testRootPath1() throws Exception {
20
 			URL url = new URL("http://d.e.f/moo.html");
21
 			man.addCookieFromHeader("test=moo;path=/", url);
22
 			String s = man.getCookieHeaderForURL(new URL("http://d.e.f/goo.html"));
23
 			assertNotNull(s);
24
 			assertEquals("test=moo", s);
25
 		
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