/** * Hack to allow TreeModel to be used in non-GUI and headless mode. * * @deprecated - only for use by JMeter class! * @param o - dummy */ @Deprecated public JMeterTreeModel(Object o) { this(new TestPlan()); }
/** * Set the classpath for the test plan. If the classpath is made up from * more then one path, the parts must be separated with * {@link TestPlan#CLASSPATH_SEPARATOR}. * * @param text * the classpath to be set */ public void setTestPlanClasspath(String text) { setProperty(CLASSPATHS,text); }
@Override public void modifyTestElement(TestElement plan) { super.configureTestElement(plan); if (plan instanceof TestPlan) { TestPlan tp = (TestPlan) plan; tp.setFunctionalMode(functionalMode.isSelected()); tp.setTearDownOnShutdown(tearDownOnShutdown.isSelected()); tp.setSerialized(serializedMode.isSelected()); tp.setUserDefinedVariables((Arguments) argsPanel.createTestElement()); tp.setTestPlanClasspathArray(browseJar.getFiles()); } }
@Override public void addTestElement(TestElement tg) { super.addTestElement(tg); if (tg instanceof AbstractThreadGroup && !isRunningVersion()) { addThreadGroup((AbstractThreadGroup) tg); } }
public void setFunctionalMode(boolean funcMode) { setProperty(new BooleanProperty(FUNCTIONAL_MODE, funcMode)); setGlobalFunctionalMode(funcMode); }
testPlan = new TestPlan("Create JMeter Script From Java Code"); testPlan.setProperty(TestElement.TEST_CLASS, TestPlan.class.getName()); testPlan.setProperty(TestElement.GUI_CLASS, TestPlanGui.class.getName()); testPlan.setUserDefinedVariables((Arguments) new ArgumentsPanel().createTestElement());
current = (JMeterTreeNode) ((JMeterTreeNode) getRoot()).getChildAt(0); final TestPlan userObject = (TestPlan) current.getUserObject(); userObject.addTestElement(item); userObject.setName(item.getName()); userObject.setFunctionalMode(tp.isFunctionalMode()); userObject.setSerialized(tp.isSerialized()); addSubTree(subTree.getTree(item), current); } else if (item instanceof WorkBench) {
TestPlan variables = new TestPlan(); variables.addParameter("T", Long.toString(deltaT)); // $NON-NLS-1$ ValueReplacer replacer = new ValueReplacer(variables); JMeterTreeNode mySelf = model.getNodeOf(this);
private Arguments getVariables() { Arguments args = (Arguments) getProperty(USER_DEFINED_VARIABLES).getObjectValue(); if (args == null) { args = new Arguments(); setUserDefinedVariables(args); } return args; }
/** * {@inheritDoc} */ @Override public void testStarted() { if (getBasedir() != null && getBasedir().length() > 0) { try { FileServer.getFileServer().setBasedir(FileServer.getFileServer().getBaseDir() + getBasedir()); } catch (IllegalStateException e) { log.error("Failed to set file server base dir with {}", getBasedir(), e); } } // we set the classpath String[] paths = this.getTestPlanClasspathArray(); for (String path : paths) { try { NewDriver.addURL(path); log.info("added {} to classpath", path); } catch (MalformedURLException e) { // TODO Should we continue the test or fail ? log.error("Error adding {} to classpath", path, e); } } }
public boolean saveSamplerData(SampleResult res) { return samplerData || TestPlan.getFunctionalMode() // as per 2.0 branch || (responseDataOnError && !res.isSuccessful()); }
Arguments args = tp.getArguments(); if (myClass.isInstance(args)) { if (ascending) {
public boolean saveResponseData(SampleResult res) { return responseData || TestPlan.getFunctionalMode() || (responseDataOnError && !res.isSuccessful()); }
public void setTearDownOnShutdown(boolean tearDown) { setProperty(TEARDOWN_ON_SHUTDOWN, tearDown, false); }
@Override public TestElement createTestElement() { TestPlan tp = new TestPlan(); modifyTestElement(tp); return tp; }
public void setBasedir(String b) { setProperty(BASEDIR, b); }
public void setUserDefinedVariables(Arguments vars) { setProperty(new TestElementProperty(USER_DEFINED_VARIABLES, vars)); }
public void setSerialized(boolean serializeTGs) { setProperty(new BooleanProperty(SERIALIZE_THREADGROUPS, serializeTGs)); }