Package org.apache.jmeter.engine

Examples of org.apache.jmeter.engine.JMeterEngine


            List<JMeterEngine> engines = new LinkedList<JMeterEngine>();
            tree.add(tree.getArray()[0], new ListenToTest(parent, (remoteStart && remoteStop) ? engines : null));
            println("Created the tree successfully using "+testFile);
            if (!remoteStart) {
                JMeterEngine engine = new StandardJMeterEngine();
                engine.configure(tree);
                long now=System.currentTimeMillis();
                println("Starting the test @ "+new Date(now)+" ("+now+")");
                engine.runTest();
                engines.add(engine);
            } else {
                java.util.StringTokenizer st = new java.util.StringTokenizer(remote_hosts_string, ",");//$NON-NLS-1$
                while (st.hasMoreElements()) {
                    String el = (String) st.nextElement();
                    println("Configuring remote engine for " + el);
                    log.info("Configuring remote engine for " + el);
                    JMeterEngine eng = doRemoteInit(el.trim(), tree);
                    if (null != eng) {
                        engines.add(eng);
                    } else {
                        println("Failed to configure "+el);
                    }
View Full Code Here


            }
        }
    }

    private JMeterEngine doRemoteInit(String hostName, HashTree testTree) {
        JMeterEngine engine = null;
        try {
            engine = new ClientJMeterEngine(hostName);
        } catch (Exception e) {
            log.fatalError("Failure connecting to remote host: "+hostName, e);
            System.err.println("Failure connecting to remote host: "+hostName+" "+e);
            return null;
        }
        engine.configure(testTree);
        if (!remoteProps.isEmpty()) {
            engine.setProperties(remoteProps);
        }
        return engine;
    }
View Full Code Here

     *            the DNS name or IP address of the remote testing engine
     *
     */
    private void doRemoteStop(String name, boolean now) {
        GuiPackage.getInstance().getMainFrame().showStoppingMessage(name);
        JMeterEngine engine = remoteEngines.get(name);
        engine.stopTest(now);
    }
View Full Code Here

     * @param name
     *            the DNS name or IP address of the remote testing engine
     *
     */
    private void doRemoteExit(String name) {
        JMeterEngine engine = remoteEngines.get(name);
        if (engine == null) {
            return;
        }
        // GuiPackage.getInstance().getMainFrame().showStoppingMessage(name);
        engine.exit();
    }
View Full Code Here

     * @param name
     *            the DNS name or IP address of the remote testing engine
     *
     */
    private void doRemoteStart(String name) {
        JMeterEngine engine = remoteEngines.get(name);
        if (engine != null) {
            try {
                engine.runTest();
            } catch (IllegalStateException e) {
                JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")); // $NON-NLS-1$
            } catch (JMeterEngineException e) {
                JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")); // $NON-NLS-1$
            }
View Full Code Here

    /**
     * Initializes remote engines
     */
    private void doRemoteInit(String name) {
        JMeterEngine engine = remoteEngines.get(name);
        if (engine == null) {
            try {
                log.info("Initialising remote engine: "+name);
                engine = new ClientJMeterEngine(name);
                remoteEngines.put(name, engine);
            } catch (Exception ex) {
                log.error("Failed to initialise remote engine", ex);
                JMeterUtils.reportErrorToUser(ex.getMessage(),
                        JMeterUtils.getResString("remote_error_init") + ": " + name); // $NON-NLS-1$ $NON-NLS-2$
                return;
            }
        } else {
            engine.reset();
        }
        initEngine(engine, name);
    }
View Full Code Here

            List<JMeterEngine> engines = new LinkedList<JMeterEngine>();
            tree.add(tree.getArray()[0], new ListenToTest(parent, (remoteStart && remoteStop) ? engines : null));
            println("Created the tree successfully using "+testFile);
            if (!remoteStart) {
                JMeterEngine engine = new StandardJMeterEngine();
                engine.configure(tree);
                long now=System.currentTimeMillis();
                println("Starting the test @ "+new Date(now)+" ("+now+")");
                engine.runTest();
                engines.add(engine);
            } else {
                java.util.StringTokenizer st = new java.util.StringTokenizer(remote_hosts_string, ",");//$NON-NLS-1$
                List<String> failingEngines = new ArrayList<String>(st.countTokens());
                while (st.hasMoreElements()) {
                    String el = (String) st.nextElement();
                    println("Configuring remote engine for " + el);
                    log.info("Configuring remote engine for " + el);
                    JMeterEngine eng = doRemoteInit(el.trim(), tree);
                    if (null != eng) {
                        engines.add(eng);
                    } else {
                        failingEngines.add(el);
                        println("Failed to configure "+el);
View Full Code Here

            }
        }
    }

    private JMeterEngine doRemoteInit(String hostName, HashTree testTree) {
        JMeterEngine engine = null;
        try {
            engine = new ClientJMeterEngine(hostName);
        } catch (Exception e) {
            log.fatalError("Failure connecting to remote host: "+hostName, e);
            System.err.println("Failure connecting to remote host: "+hostName+" "+e);
            return null;
        }
        engine.configure(testTree);
        if (!remoteProps.isEmpty()) {
            engine.setProperties(remoteProps);
        }
        return engine;
    }
View Full Code Here

              Summariser summer=new Summariser(summariserName);
        tree.add(tree.getArray()[0], summer);
            }
            tree.add(tree.getArray()[0], new ListenToTest());
            println("Created the tree successfully");
            JMeterEngine engine = null;
            if (!remoteStart)
            {
                engine = new StandardJMeterEngine();
                engine.configure(tree);
                println("Starting the test");
                engine.runTest();
            }
            else
            {
                String remote_hosts_string =
                    JMeterUtils.getPropDefault("remote_hosts", "127.0.0.1");
                java.util.StringTokenizer st =
                    new java.util.StringTokenizer(remote_hosts_string, ",");
                List engines = new LinkedList();
                while (st.hasMoreElements())
                {
                    String el = (String) st.nextElement();
          println("Configuring remote engine for "+el);
                    engines.add(doRemoteInit(el.trim(), tree));
                }
                println("Starting remote engines");
                Iterator iter = engines.iterator();
                while (iter.hasNext())
                {
                    engine = (JMeterEngine) iter.next();
                    engine.runTest();
                }
        println("Remote engines have been started");
            }
        }
        catch (Exception e)
View Full Code Here

      }
  }

  private JMeterEngine doRemoteInit(String hostName, HashTree testTree)
    {
        JMeterEngine engine = null;
        try
        {
            engine = new ClientJMeterEngine(hostName);
        }
        catch (Exception e)
        {
            log.fatalError("Failure connecting to remote host", e);
            System.exit(0);
        }
        engine.configure(testTree);
        return engine;
    }
View Full Code Here

TOP

Related Classes of org.apache.jmeter.engine.JMeterEngine

Copyright © 2018 www.massapicom. 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.