postActionPerformed(c.getClass(), e); } catch (IllegalUserActionException err) { String msg = err.getMessage(); if (msg == null) { msg = err.toString(); Throwable t = err.getCause(); if (t != null) { String cause = t.getMessage();
throw new IllegalUserActionException( "Option -"+ ((char)REPORT_AT_END_OPT)+" requires -"+((char)LOGFILE_OPT )+ " option"); System.out.println("Incorrect Usage:"+e.getMessage());//NOSONAR
private void addNode(JMeterTreeNode parent, JMeterTreeNode node) { try { // Add this node JMeterTreeNode newNode = GuiPackage.getInstance().getTreeModel().addComponent(node.getTestElement(), parent); // Add all the child nodes of the node we are adding for (int i = 0; i < node.getChildCount(); i++) { addNode(newNode, (JMeterTreeNode)node.getChildAt(i)); } } catch (IllegalUserActionException iuae) { log.error("Illegal user action while adding a tree node.", iuae); // $NON-NLS-1$ JMeterUtils.reportErrorToUser(iuae.getMessage()); } } }
@Override public void doAction(ActionEvent e) throws IllegalUserActionException { if (!commands.contains(e.getActionCommand())) { throw new IllegalUserActionException("Invalid user command:" + e.getActionCommand()); } if (e.getActionCommand().equals(ActionNames.SAVE_GRAPHICS)) { JMeterGUIComponent component = GuiPackage.getInstance().getCurrentGui(); // get the JComponent from the visualizer if (component instanceof Printable) { JComponent comp = ((Printable) component).getPrintableComponent(); saveImage(comp); } } if (e.getActionCommand().equals(ActionNames.SAVE_GRAPHICS_ALL)) { JMeterGUIComponent component = GuiPackage.getInstance().getCurrentGui(); JComponent comp = ((JComponent) component).getRootPane(); saveImage(comp); } }
JMeterUtils.reportErrorToUser(e.getMessage());
private void startNonGui(String testFile, String logFile, CLOption remoteStart, boolean generateReportDashboard) throws IllegalUserActionException, ConfigurationException { // add a system property so samplers can check to see if JMeter // is running in NonGui mode System.setProperty(JMETER_NON_GUI, "true");// $NON-NLS-1$ JMeter driver = new JMeter();// TODO - why does it create a new instance? driver.remoteProps = this.remoteProps; driver.remoteStop = this.remoteStop; driver.deleteResultFile = this.deleteResultFile; PluginManager.install(this, false); String remoteHostsString = null; if (remoteStart != null) { remoteHostsString = remoteStart.getArgument(); if (remoteHostsString == null) { remoteHostsString = JMeterUtils.getPropDefault( "remote_hosts", //$NON-NLS-1$ "127.0.0.1");//NOSONAR $NON-NLS-1$ } } if (testFile == null) { throw new IllegalUserActionException("Non-GUI runs require a test plan"); } driver.runNonGui(testFile, logFile, remoteStart != null, remoteHostsString, generateReportDashboard); }
log.info("Set http[s].proxyHost: {} Port: {}", h, p); } else if (parser.getArgumentById(PROXY_HOST) != null || parser.getArgumentById(PROXY_PORT) != null) { throw new IllegalUserActionException(JMeterUtils.getResString("proxy_cl_error"));// $NON-NLS-1$
throw new IllegalUserActionException("Cannot add think times", ex);
boolean fullSave = false; // are we saving the whole tree? if (!commands.contains(e.getActionCommand())) { throw new IllegalUserActionException("Invalid user command:" + e.getActionCommand()); } catch (Exception ex) { log.error("Error saving tree.", ex); throw new IllegalUserActionException("Couldn't save test plan to file: " + updateFile, ex);
throw new IllegalUserActionException("Empty TestPlan or error reading test plan - see log file"); String className = te.getClass().getName(); className = className.substring(className.lastIndexOf('.')+1); throw new IllegalUserActionException("Can't merge "+name+" ("+className+") here");
throw new IllegalUserActionException("This node cannot hold sub-elements");