Examples of IllegalUserActionException


Examples of org.apache.jmeter.exceptions.IllegalUserActionException

    }

    public ReportTreeNode addComponent(TestElement component,
            ReportTreeNode node) throws IllegalUserActionException {
        if (node.getUserObject() instanceof AbstractConfigGui) {
            throw new IllegalUserActionException(
                    "This node cannot hold sub-elements");
        }
        component.setProperty(TestElement.GUI_CLASS, NameUpdater
                .getCurrentName(component
                        .getPropertyAsString(TestElement.GUI_CLASS)));
View Full Code Here

Examples of org.apache.jmeter.exceptions.IllegalUserActionException

    public void doAction(ActionEvent e) throws IllegalUserActionException {
        JMeterGUIComponent component = null;
        JComponent comp = null;
        if (!commands.contains(e.getActionCommand())) {
            throw new IllegalUserActionException("Invalid user command:" + e.getActionCommand());
        }
        if (e.getActionCommand().equals(SAVE_GRAPHICS)) {
            component = ReportGuiPackage.getInstance().getCurrentGui();
            // get the JComponent from the visualizer
            if (component instanceof Printable) {
View Full Code Here

Examples of org.apache.jmeter.exceptions.IllegalUserActionException

    }

    public void doAction(ActionEvent e) throws IllegalUserActionException {
        HashTree subTree = null;
        if (!commands.contains(e.getActionCommand())) {
            throw new IllegalUserActionException("Invalid user command:" + e.getActionCommand());
        }
        if (e.getActionCommand().equals(SAVE_AS)) {
            subTree = ReportGuiPackage.getInstance().getCurrentSubTree();
        } else {
            subTree = ReportGuiPackage.getInstance().getTreeModel().getReportPlan();
        }

        String updateFile = ReportGuiPackage.getInstance().getReportPlanFile();
        if (!SAVE.equals(e.getActionCommand()) || updateFile == null) {
            JFileChooser chooser = ReportFileDialoger.promptToSaveFile(ReportGuiPackage.getInstance().getTreeListener()
                    .getCurrentNode().getName()
                    + ".jmr");
            if (chooser == null) {
                return;
            }
            updateFile = chooser.getSelectedFile().getAbsolutePath();
            if (!e.getActionCommand().equals(SAVE_AS)) {
                ReportGuiPackage.getInstance().setReportPlanFile(updateFile);
            }
        }
        // TODO: doesn't putting this here mark the tree as
        // saved even though a failure may occur later?

        ReportActionRouter.getInstance().doActionNow(new ActionEvent(subTree, e.getID(), ReportCheckDirty.SUB_TREE_SAVED));
        try {
            convertSubTree(subTree);
        } catch (Exception err) {
        }
        FileOutputStream ostream = null;
        try {
            ostream = new FileOutputStream(updateFile);
            SaveService.saveTree(subTree, ostream);
            log.info("saveTree");
        } catch (Throwable ex) {
            ReportGuiPackage.getInstance().setReportPlanFile(null);
            log.error("", ex);
            throw new IllegalUserActionException("Couldn't save test plan to file: " + updateFile);
        } finally {
            JOrphanUtils.closeQuietly(ostream);
        }
    }
View Full Code Here

Examples of org.apache.jmeter.exceptions.IllegalUserActionException

            System.setProperty("https.proxyHost", h);// $NON-NLS-1$
            System.setProperty("http.proxyPort",  p);// $NON-NLS-1$
            System.setProperty("https.proxyPort", p);// $NON-NLS-1$
            log.info("Set http[s].proxyHost: " + h + " Port: " + p);
        } else if (parser.getArgumentById(PROXY_HOST) != null || parser.getArgumentById(PROXY_PORT) != null) {
            throw new IllegalUserActionException(JMeterUtils.getResString("proxy_cl_error"));// $NON-NLS-1$
        }

        if (parser.getArgumentById(NONPROXY_HOSTS) != null) {
            String n = parser.getArgumentById(NONPROXY_HOSTS).getArgument();
            System.setProperty("http.nonProxyHosts",  n );// $NON-NLS-1$
View Full Code Here

Examples of org.apache.jmeter.exceptions.IllegalUserActionException

                        "remote_hosts", //$NON-NLS-1$
                        "127.0.0.1");//$NON-NLS-1$
            }
        }
        if (testFile == null) {
            throw new IllegalUserActionException("Non-GUI runs require a test plan");
        }
        driver.runNonGui(testFile, logFile, remoteStart != null, remote_hosts_string);
    }
View Full Code Here

Examples of org.apache.jmeter.exceptions.IllegalUserActionException

  public JMeterTreeNode addComponent(JMeterComponentModel component, JMeterTreeNode node)
                 throws IllegalUserActionException
  {
    if((node.getUserObject() instanceof TestPlan) && !(component instanceof ThreadGroup))
    {
      throw new IllegalUserActionException("Only ThreadGroups can be added to Test Plan nodes");
    }
    if(node.getUserObject() instanceof ConfigElement)
    {
      throw new IllegalUserActionException("This node cannot hold sub-elements");
    }
    JMeterTreeNode newNode = new JMeterTreeNode(component);
    this.insertNodeInto(newNode, node, node.getChildCount());
    return newNode;
  }
View Full Code Here

Examples of org.apache.jmeter.exceptions.IllegalUserActionException

    public void doAction(ActionEvent e) throws IllegalUserActionException
    {
        HashTree subTree = null;
        if (!commands.contains(e.getActionCommand()))
        {
            throw new IllegalUserActionException("Invalid user command:" + e.getActionCommand());
        }
        if (e.getActionCommand().equals(SAVE_AS))
        {
            subTree = GuiPackage.getInstance().getCurrentSubTree();
        }
        else
        {
            subTree = GuiPackage.getInstance().getTreeModel().getTestPlan();
        }

        String updateFile = testPlanFile;
        if (!SAVE.equals(e.getActionCommand())
            || testPlanFile == null)
        {
            JFileChooser chooser =
                FileDialoger.promptToSaveFile(
                    GuiPackage
                        .getInstance()
                        .getTreeListener()
                        .getCurrentNode()
                        .getName()
                        + ".jmx");
            if (chooser == null)
            {
                return;
            }
            updateFile = chooser.getSelectedFile().getAbsolutePath();
            if (!e.getActionCommand().equals(SAVE_AS))
            {
                testPlanFile = updateFile;
            }
        }
        // TODO: doesn't putting this here mark the tree as
        // saved even though a failure may occur later?
       
        ActionRouter.getInstance().doActionNow(
            new ActionEvent(subTree, e.getID(), CheckDirty.SUB_TREE_SAVED));
        try
        {
            convertSubTree(subTree);
        }
        catch (Exception err)
        {
        }
        OutputStream writer = null;
        try
        {
            writer = new FileOutputStream(updateFile);
            SaveService.saveSubTree(subTree, writer);
        }
        catch (Throwable ex)
        {
            testPlanFile = null;
            log.error("", ex);
            throw new IllegalUserActionException(
                "Couldn't save test plan to file: " + updateFile);
        }
        finally
        {
            closeWriter(writer);
View Full Code Here

Examples of org.apache.jmeter.exceptions.IllegalUserActionException

        JMeterTreeNode node)
        throws IllegalUserActionException
    {
        if (node.getUserObject() instanceof AbstractConfigGui)
        {
            throw new IllegalUserActionException(
                    "This node cannot hold sub-elements");
        }
        component.setProperty(
            TestElement.GUI_CLASS,
            NameUpdater.getCurrentName(
View Full Code Here

Examples of org.apache.jmeter.exceptions.IllegalUserActionException

        }
        else if (
            parser.getArgumentById(PROXY_HOST) != null
                || parser.getArgumentById(PROXY_PORT) != null)
        {
            throw new IllegalUserActionException(
                JMeterUtils.getResString("proxy_cl_error"));
        }
    }
View Full Code Here

Examples of org.apache.jmeter.exceptions.IllegalUserActionException

        JMeter driver = new JMeter();
        PluginManager.install(this, false);

        if (testFile == null)
        {
            throw new IllegalUserActionException();
        }
        if (logFile == null)
        {
            driver.run(testFile.getArgument(), null, remoteStart != null);
        }
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.