コード例 #1
0
 @Override
 public void setUp() throws Exception {
   super.setUp();
   jmctx = JMeterContextService.getContext();
   man = new CookieManager();
   man.setThreadContext(jmctx);
   man.testStarted(); // This is needed in order to set up the cookie policy
 }
コード例 #2
0
 public void testRemoveCookie() throws Exception {
   man.setThreadContext(jmctx);
   Cookie c = new Cookie("id", "me", "127.0.0.1", "/", false, 0);
   man.add(c);
   assertEquals(1, man.getCookieCount());
   // This should be ignored, as there is no value
   Cookie d = new Cookie("id", "", "127.0.0.1", "/", false, 0);
   man.add(d);
   assertEquals(0, man.getCookieCount());
   man.add(c);
   man.add(c);
   assertEquals(1, man.getCookieCount());
   Cookie e = new Cookie("id", "me2", "127.0.0.1", "/", false, 0);
   man.add(e);
   assertEquals(1, man.getCookieCount());
 }