Package org.apache.jmeter.exceptions

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


        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

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

    throws IllegalUserActionException, IllegalAccessException, ClassNotFoundException, InstantiationException {
    JMeter driver = new JMeter();
        PluginManager.install(this, false);

    if (testFile == null) {
      throw new IllegalUserActionException();
    }
    if (logFile == null) {
      driver.run(testFile.getArgument(), null);
    } else {
      driver.run(testFile.getArgument(), logFile.getArgument());
View Full Code Here

     */
    public void setFilename(String f) throws IOException, IllegalUserActionException
    {
        if (inTest)
        {
            throw new IllegalUserActionException(JMeterUtils.getResString("busy_testing"));
        }
        try
        {
            setFilenameProperty(f);
            loadExistingFile();
View Full Code Here

  public JMeterTreeNode addComponent(Object component, JMeterTreeNode node)
       throws IllegalUserActionException
  {
    if(node.getUserObject() instanceof AbstractConfigGui)
    {
      throw new IllegalUserActionException("This node cannot hold sub-elements");
    }
    JMeterTreeNode newNode = new JMeterTreeNode((JMeterGUIComponent)component, this);
    this.insertNodeInto(newNode, node, node.getChildCount());
    return newNode;
  }
View Full Code Here

     */
    // Does not appear to be used externally; called by #loadProjectFile()
    public static boolean insertLoadedTree(final int id, final HashTree tree, final boolean merging) throws IllegalUserActionException {
        // convertTree(tree);
        if (tree == null) {
            throw new IllegalUserActionException("Empty TestPlan - see log file");
        }
        final boolean isTestPlan = tree.getArray()[0] instanceof TestPlan;

        // If we are loading a new test plan, initialize the tree with the testplan node we are loading
        final GuiPackage guiInstance = GuiPackage.getInstance();
        if(isTestPlan && !merging) {
            // Why does this not call guiInstance.clearTestPlan() ?
            // Is there a reason for not clearing everything?
            guiInstance.clearTestPlan((TestElement)tree.getArray()[0]);
        }

        if (merging){ // Check if target of merge is reasonable
            final TestElement te = (TestElement)tree.getArray()[0];
            if (!(te instanceof WorkBench || te instanceof TestPlan)){// These are handled specially by addToTree
                final boolean ok = MenuFactory.canAddTo(guiInstance.getCurrentNode(), te);
                if (!ok){
                    String name = te.getName();
                    String className = te.getClass().getName();
                    className = className.substring(className.lastIndexOf('.')+1);
                    throw new IllegalUserActionException("Can't merge "+name+" ("+className+") here");
                }
            }
        }
        final HashTree newTree = guiInstance.addSubTree(tree);
        guiInstance.updateCurrentGui();
View Full Code Here

        return getCurrentSubTree(current);
    }

    public JMeterTreeNode addComponent(TestElement component, JMeterTreeNode node) throws IllegalUserActionException {
        if (node.getUserObject() instanceof AbstractConfigGui) {
            throw new IllegalUserActionException("This node cannot hold sub-elements");
        }

        GuiPackage guiPackage = GuiPackage.getInstance();
        if (guiPackage != null) {
            // The node can be added in non GUI mode at startup
View Full Code Here

  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

  }

  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);
      if (SaveService.isSaveTestPlanFormat20()) {
        OldSaveService.saveSubTree(subTree, ostream);
                log.info("saveSubTree");
      } else {
        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

TOP

Related Classes of org.apache.jmeter.exceptions.IllegalUserActionException

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.