当前位置: 首页>>代码示例>>Java>>正文


Java TestPlan.setFunctionalMode方法代码示例

本文整理汇总了Java中org.apache.jmeter.testelement.TestPlan.setFunctionalMode方法的典型用法代码示例。如果您正苦于以下问题:Java TestPlan.setFunctionalMode方法的具体用法?Java TestPlan.setFunctionalMode怎么用?Java TestPlan.setFunctionalMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.jmeter.testelement.TestPlan的用法示例。


在下文中一共展示了TestPlan.setFunctionalMode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTestPlan

import org.apache.jmeter.testelement.TestPlan; //导入方法依赖的package包/类
public TestPlan getTestPlan() {
    TestPlan testPlan = new TestPlan();

    testPlan.setProperty(TestElement.TEST_CLASS, TestPlan.class.getName());
    testPlan.setProperty(TestElement.GUI_CLASS, TestPlanGui.class.getName());
    testPlan.setProperty(TestElement.ENABLED, true);
    testPlan.setFunctionalMode(false);
    testPlan.setSerialized(true);
    Arguments arguments = new Arguments();
    arguments.setProperty(TestElement.GUI_CLASS, "org.apache.jmeter.protocol.http.gui.HTTPArgumentsPanel");
    arguments.setProperty(TestElement.TEST_CLASS, "org.apache.jmeter.config.Arguments");
    arguments.setName("User Defined Variables");
    arguments.setProperty(TestElement.ENABLED, true);
    testPlan.setUserDefinedVariables(arguments);
    testPlan.setTestPlanClasspath("");
    return testPlan;
}
 
开发者ID:lithiumtech,项目名称:mineraloil-jmeter,代码行数:18,代码来源:JMeterRunner.java

示例2: addSubTree

import org.apache.jmeter.testelement.TestPlan; //导入方法依赖的package包/类
/**
 * Adds the sub tree at the given node. Returns a boolean indicating whether
 * the added sub tree was a full test plan.
 */
public HashTree addSubTree(HashTree subTree, JMeterTreeNode current) throws IllegalUserActionException {
    Iterator<Object> iter = subTree.list().iterator();
    while (iter.hasNext()) {
        TestElement item = (TestElement) iter.next();
        if (item instanceof TestPlan) {
            TestPlan tp = (TestPlan) item;
            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) {
            current = (JMeterTreeNode) ((JMeterTreeNode) getRoot()).getChildAt(1);
            final TestElement testElement = ((TestElement) current.getUserObject());
            testElement.addTestElement(item);
            testElement.setName(item.getName());
            addSubTree(subTree.getTree(item), current);
        } else {
            addSubTree(subTree.getTree(item), addComponent(item, current));
        }
    }
    return getCurrentSubTree(current);
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:30,代码来源:JMeterTreeModel.java

示例3: modifyTestElement

import org.apache.jmeter.testelement.TestPlan; //导入方法依赖的package包/类
@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());
    }
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:13,代码来源:TestPlanGui.java

示例4: main

import org.apache.jmeter.testelement.TestPlan; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    JMeterUtils.setJMeterHome("src/test/resources/");
    JMeterUtils.loadJMeterProperties("src/test/resources/jmeter.properties");
    JMeterUtils.setProperty("saveservice_properties", "saveservice.properties");
    JMeterUtils.setProperty("search_paths", "ApacheJMeter_functions-2.9.jar");
    JMeterUtils.setLocale(Locale.JAPAN);
    
    JMeterEngine engine = new StandardJMeterEngine();
    HashTree config = new ListedHashTree();
    TestPlan testPlan = new TestPlan("websocket test");
    testPlan.setFunctionalMode(false);
    testPlan.setSerialized(false);
    testPlan.setProperty(new BooleanProperty(TestElement.ENABLED, true));
    testPlan.setUserDefinedVariables(new Arguments());

    ThreadGroup threadGroup = new ThreadGroup();
    threadGroup.setNumThreads(300);
    threadGroup.setRampUp(20);
    threadGroup.setDelay(0);
    threadGroup.setDuration(0);
    threadGroup.setProperty(new StringProperty(ThreadGroup.ON_SAMPLE_ERROR, "continue"));
    threadGroup.setScheduler(false);
    threadGroup.setName("Group1");
    threadGroup.setProperty(new BooleanProperty(TestElement.ENABLED, true));

    LoopController controller = new LoopController();
    controller.setLoops(10);
    controller.setContinueForever(false);
    controller.setProperty(new BooleanProperty(TestElement.ENABLED, true));
    threadGroup.setProperty(new TestElementProperty(ThreadGroup.MAIN_CONTROLLER, controller));

    CSVDataSet csvDataSet = new CSVDataSet();
    csvDataSet.setProperty(new StringProperty("filename", "src/test/resources/users.csv"));
    csvDataSet.setProperty(new StringProperty("variableNames", "USER_NAME"));
    csvDataSet.setProperty(new StringProperty("delimiter", ","));
    csvDataSet.setProperty(new StringProperty("shareMode", "shareMode.all"));
    csvDataSet.setProperty("quoted", false);
    csvDataSet.setProperty("recycle", true);
    csvDataSet.setProperty("stopThread", false);

    WebSocketSampler sampler = new WebSocketSampler();
    sampler.setName("WebSocket Test");
    sampler.setProperty(new BooleanProperty(TestElement.ENABLED, true));
    sampler.addNonEncodedArgument("name", "${USER_NAME}", "=");
    sampler.setContentEncoding("UTF-8");
    sampler.setProtocol("ws");
    sampler.setDomain("localhost");
    sampler.setPort(9090);
    sampler.setPath("/", "UTF-8");
    sampler.setSendMessage("${__RandomString(50,ABCDEFGHIJKLMNOPQRSTUVWXYZ)}");
    sampler.setRecvMessage("\"name\":\"${USER_NAME}\"");

    OnceOnlyController onceOnlyController = new OnceOnlyController();

    Summariser summariser = new Summariser();

    HashTree tpConfig = config.add(testPlan);
    HashTree tgConfig = tpConfig.add(threadGroup);
    HashTree oocConfig = tgConfig.add(onceOnlyController);
    oocConfig.add(csvDataSet);

    UniformRandomTimer randomTimer = new UniformRandomTimer();
    randomTimer.setRange(3000);
    HashTree samplerConfig = tgConfig.add(sampler);
    samplerConfig.add(summariser);
    tgConfig.add(randomTimer);

    engine.configure(config);
    engine.runTest();
}
 
开发者ID:kawasima,项目名称:jmeter-websocket,代码行数:71,代码来源:WebSocketSamplerTest.java


注:本文中的org.apache.jmeter.testelement.TestPlan.setFunctionalMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。