Examples of CookieManager

The implementation conforms to RFC 2965, section 3.3. @version %I%, %E% @author Edward Wang @since 1.6

  • org.apache.jmeter.protocol.http.control.CookieManager
    This class provides an interface to the netscape cookies file to pass cookies along with a request. Now uses Commons HttpClient parsing and matching code (since 2.1.2)

  • Examples of org.apache.jmeter.protocol.http.control.CookieManager

      /************************************************************
       *  Main processing method for the Daemon object
       ***********************************************************/
      public void run()
      {
        CookieManager cookieManager = new CookieManager();
        running = true;
        try
        {
          log.info("Creating Daemon Socket...");
          MainSocket = new ServerSocket(daemonPort);
    View Full Code Here

    Examples of org.apache.jmeter.protocol.http.control.CookieManager

          try
          {
            File tmp = FileDialoger.promptToOpenFile().getSelectedFile();
            if(tmp != null)
            {
              CookieManager manager = new CookieManager();
              manager.addFile(tmp.getAbsolutePath());
              Cookie cookie = manager.get(0);
              addCookieToTable(cookie);
              tableModel.fireTableDataChanged();

              if(tableModel.getRowCount() > 0)
              {
    View Full Code Here

    Examples of org.apache.jmeter.protocol.http.control.CookieManager

            new Long(cookie.getExpires())});
      }
     
      private CookieManager createCookieManager()
      {
        CookieManager cookieManager = new CookieManager();
        for(int i = 0;i < tableModel.getRowCount();i++)
        {
          Cookie cookie = createCookie(tableModel.getRowData(i));
          cookieManager.add(cookie);
        }
        return cookieManager;
      }
    View Full Code Here

    Examples of org.apache.jmeter.protocol.http.control.CookieManager

       *
       *@return   !ToDo (Return description)
       ***************************************/
      public TestElement createTestElement()
      {
        CookieManager cookieManager = createCookieManager();
        configureTestElement(cookieManager);
        return cookieManager;
      }
    View Full Code Here

    Examples of org.apache.jmeter.protocol.http.control.CookieManager

            } else if (action.equals(LOAD_COMMAND)) {
                try {
                    final String [] _txt={".txt"}; //$NON-NLS-1$
                    final JFileChooser chooser = FileDialoger.promptToOpenFile(_txt);
                    if (chooser != null) {
                        CookieManager manager = new CookieManager();
                        manager.addFile(chooser.getSelectedFile().getAbsolutePath());
                        for (int i = 0; i < manager.getCookieCount() ; i++){
                            addCookieToTable(manager.get(i));
                        }
                        tableModel.fireTableDataChanged();

                        if (tableModel.getRowCount() > 0) {
                            deleteButton.setEnabled(true);
    View Full Code Here

    Examples of org.apache.jmeter.protocol.http.control.CookieManager

        public void modifyTestElement(TestElement cm) {
            GuiUtils.stopTableEditing(cookieTable);
            cm.clear();
            configureTestElement(cm);
            if (cm instanceof CookieManager) {
                CookieManager cookieManager = (CookieManager) cm;
                for (int i = 0; i < tableModel.getRowCount(); i++) {
                    Cookie cookie = createCookie(tableModel.getRowData(i));
                    cookieManager.add(cookie);
                }
                cookieManager.setClearEachIteration(clearEachIteration.isSelected());
                cookieManager.setCookiePolicy(policy.getText());
                cookieManager.setImplementation(handlerMap.get(selectHandlerPanel.getSelectedItem()));
            }
        }
    View Full Code Here

    Examples of org.apache.jmeter.protocol.http.control.CookieManager

            }
        }

        @Override
        public TestElement createTestElement() {
            CookieManager cookieManager = new CookieManager();
            modifyTestElement(cookieManager);
            return cookieManager;
        }
    View Full Code Here

    Examples of org.apache.jmeter.protocol.http.control.CookieManager

        @Override
        public void configure(TestElement el) {
            super.configure(el);

            CookieManager cookieManager = (CookieManager) el;
            populateTable(cookieManager);
            clearEachIteration.setSelected((cookieManager).getClearEachIteration());
            policy.setText(cookieManager.getPolicy());
            String fullImpl = cookieManager.getImplementation();
            selectHandlerPanel.setSelectedItem(fullImpl.substring(fullImpl.lastIndexOf('.') + 1));
        }
    View Full Code Here

    Examples of org.apache.jmeter.protocol.http.control.CookieManager

         * {@inheritDoc}
         */
        @Override
        public boolean isFiltered(String path,TestElement sampler) {
            String ipAddr = getIpAddress(path);
            CookieManager cm = getCookieManager(ipAddr);
            ((HTTPSampler)sampler).setCookieManager(cm);
            return false;
        }
    View Full Code Here

    Examples of org.apache.jmeter.protocol.http.control.CookieManager

            return false;
        }

        protected CookieManager getCookieManager(String ipAddr)
        {
            CookieManager cm = null;
            // First have to release the cookie we were using so other
            // threads stuck in wait can move on
            synchronized(managersInUse)
            {
                if(lastUsed != null)
                {
                    managersInUse.remove(lastUsed);
                    managersInUse.notify();
                }
            }
            // let notified threads move on and get lock on managersInUse
            if(lastUsed != null)
            {
                Thread.yield();
            }
            // here is the core routine to find appropriate cookie manager and
            // check it's not being used.  If used, wait until whoever's using it gives
            // it up
            synchronized(managersInUse)
            {
                cm = cookieManagers.get(ipAddr);
                if(cm == null)
                {
                    cm = new CookieManager();
                    cm.testStarted();
                    cookieManagers.put(ipAddr,cm);
                }
                while(managersInUse.contains(cm))
                {
                    try {
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. All rights reserved.
    All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.