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


Java ConfigTestElement类代码示例

本文整理汇总了Java中org.apache.jmeter.config.ConfigTestElement的典型用法代码示例。如果您正苦于以下问题:Java ConfigTestElement类的具体用法?Java ConfigTestElement怎么用?Java ConfigTestElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: SamplePackage

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
public SamplePackage(
        List<ConfigTestElement> configs,
        List<SampleListener> listeners,
        List<Timer> timers,
        List<Assertion> assertions, 
        List<PostProcessor> postProcessors, 
        List<PreProcessor> preProcessors,
        List<Controller> controllers) {
    this.configs = configs;
    this.sampleListeners = listeners;
    this.timers = timers;
    this.assertions = assertions;
    this.postProcessors = postProcessors;
    this.preProcessors = preProcessors;
    this.controllers = controllers;
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:17,代码来源:SamplePackage.java

示例2: saveTransactionControllerConfigs

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
private void saveTransactionControllerConfigs(TransactionController tc) {
    List<ConfigTestElement> configs = new LinkedList<>();
    List<Controller> controllers = new LinkedList<>();
    List<SampleListener> listeners = new LinkedList<>();
    List<Timer> timers = new LinkedList<>();
    List<Assertion> assertions = new LinkedList<>();
    LinkedList<PostProcessor> posts = new LinkedList<>();
    LinkedList<PreProcessor> pres = new LinkedList<>();
    for (int i = stack.size(); i > 0; i--) {
        addDirectParentControllers(controllers, stack.get(i - 1));
        for (Object item : testTree.list(stack.subList(0, i))) {
            if (item instanceof SampleListener) {
                listeners.add((SampleListener) item);
            }
            if (item instanceof Assertion) {
                assertions.add((Assertion) item);
            }
        }
    }

    SamplePackage pack = new SamplePackage(configs, listeners, timers, assertions,
            posts, pres, controllers);
    pack.setSampler(new TransactionSampler(tc, tc.getName()));
    pack.setRunningVersion(true);
    transactionControllerConfigMap.put(tc, pack);
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:27,代码来源:TestCompiler.java

示例3: configureWithConfigElements

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
private void configureWithConfigElements(Sampler sam, List<ConfigTestElement> configs) {
    sam.clearTestElementChildren();
    for (ConfigTestElement config  : configs) {
        if (!(config instanceof NoConfigMerge)) 
        {
            if(sam instanceof ConfigMergabilityIndicator) {
                if(((ConfigMergabilityIndicator)sam).applies(config)) {
                    sam.addTestElement(config);
                }
            } else {
                // Backward compatibility
                sam.addTestElement(config);
            }
        }
    }
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:17,代码来源:TestCompiler.java

示例4: initilizeElement

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
@Override
public TestElement initilizeElement() {
	ConfigTestElement ele = new ConfigTestElement();
	this.baseElement(ele, "LDAP Request Defaults");
	
	ele.setProperty(this.createArgs());
	ele.setProperty("base_entry_dn", EMPTY_STRING);
	ele.setProperty("port", EMPTY_STRING);
	ele.setProperty("rootdn", EMPTY_STRING);
	ele.setProperty("servername", EMPTY_STRING);
	ele.setProperty("test", "add");
	ele.setProperty("user_defined", false);
	
	
	return ele;
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:17,代码来源:LDAPConfigInitializer.java

示例5: initilizeElement

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
@Override
public TestElement initilizeElement() {
	ConfigTestElement ele = new ConfigTestElement();
	this.baseElement(ele, "LDAP Extended Request Defaults");
	
	ele.setProperty(LDAPExtSampler.ATTRIBS, EMPTY_STRING);
	ele.setProperty(LDAPExtSampler.COMPAREDN, EMPTY_STRING);
	ele.setProperty(LDAPExtSampler.COMPAREFILT, EMPTY_STRING);
	ele.setProperty(LDAPExtSampler.CONNTO, EMPTY_STRING);
	ele.setProperty(LDAPExtSampler.COUNTLIM, 0l);
	ele.setProperty(LDAPExtSampler.DEREF, false);
	ele.setProperty(LDAPExtSampler.MODDDN, EMPTY_STRING);
	ele.setProperty(LDAPExtSampler.NEWDN, EMPTY_STRING);
	ele.setProperty(LDAPExtSampler.PARSEFLAG, false);
	ele.setProperty(LDAPExtSampler.PORT, EMPTY_STRING);
	ele.setProperty(LDAPExtSampler.RETOBJ, false);
	ele.setProperty(LDAPExtSampler.ROOTDN, EMPTY_STRING);
	ele.setProperty(LDAPExtSampler.SCOPE, 2);
	ele.setProperty(LDAPExtSampler.SECURE, false);
	ele.setProperty(LDAPExtSampler.SERVERNAME, EMPTY_STRING);
	ele.setProperty(LDAPExtSampler.TIMELIM, EMPTY_STRING);
	ele.setProperty(LDAPExtSampler.USERDN, EMPTY_STRING);
	ele.setProperty(LDAPExtSampler.USERPW, EMPTY_STRING);
	
	return ele;
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:27,代码来源:LDAPExtendedConfigInitializer.java

示例6: initilizeElement

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
@Override
public TestElement initilizeElement() {
	ConfigTestElement ele = new ConfigTestElement();
	this.baseElement(ele, "FTP Request Defaults");
	
	ele.setProperty(FTPSampler.BINARY_MODE, false);
	ele.setProperty(FTPSampler.REMOTE_FILENAME, EMPTY_STRING);
	ele.setProperty(FTPSampler.INPUT_DATA, EMPTY_STRING);
	ele.setProperty(FTPSampler.LOCAL_FILENAME, EMPTY_STRING);
	ele.setProperty(FTPSampler.PORT, EMPTY_STRING);
	ele.setProperty(FTPSampler.SAVE_RESPONSE, false);
	ele.setProperty(FTPSampler.SERVER, EMPTY_STRING);
	ele.setProperty(FTPSampler.UPLOAD_FILE, false);
	
	return ele;
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:17,代码来源:FTPConfigInitializer.java

示例7: initilizeElement

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
@Override
public TestElement initilizeElement() {
	TCPSampler ele = new TCPSampler();
	this.baseElement(ele, "TCP Sampler");
	
	ele.setProperty(ConfigTestElement.PASSWORD, EMPTY_STRING);
	ele.setProperty(ConfigTestElement.USERNAME, EMPTY_STRING);
	ele.setCloseConnection(false);
	ele.setProperty(TCPSampler.NODELAY, false);
	ele.setPort(0);
	ele.setProperty(TCPSampler.RE_USE_CONNECTION, true);
	ele.setRequestData(EMPTY_STRING);
	ele.setServer(EMPTY_STRING);
	ele.setTimeout(0);
	//ele.setClassname(TCPClientImpl.class.getSimpleName());
	ele.setCloseConnection(false);
	
	return ele;
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:20,代码来源:TCPSamplerInitializer.java

示例8: initilizeElement

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
@Override
public TestElement initilizeElement() {
	LDAPSampler ele = new LDAPSampler();
	
	Arguments args = (Arguments) new ArgumentsInitializer().initilizeElement();
	ele.setArguments(args);
	
	ele.setProperty(ConfigTestElement.USERNAME, EMPTY_STRING);
	ele.setProperty(ConfigTestElement.PASSWORD, EMPTY_STRING);
	ele.setProperty("base_entry_dn", EMPTY_STRING);
	ele.setProperty("port", EMPTY_STRING);
	ele.setProperty("rootdn", EMPTY_STRING);
	ele.setProperty("servername", EMPTY_STRING);
	ele.setProperty("test", "add");
	ele.setProperty("user_defined", false);
	
	this.baseElement(ele, "LDAP Request");		
	return ele;
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:20,代码来源:LDAPSamplerInitializer.java

示例9: initilizeElement

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
@Override
public TestElement initilizeElement() {
	ConfigTestElement ele = new ConfigTestElement();
	this.baseElement(ele, "HTTP Request Defaults");
	ArgumentsInitializer argsIniter = new ArgumentsInitializer();
	
	ele.setProperty(HTTPSampler.CONCURRENT_POOL, "6");
	ele.setProperty(HTTPSampler.CONNECT_TIMEOUT, EMPTY_STRING);
	ele.setProperty(HTTPSampler.CONTENT_ENCODING, EMPTY_STRING);
	ele.setProperty(HTTPSampler.DOMAIN, EMPTY_STRING);
	ele.setProperty(HTTPSampler.PATH, EMPTY_STRING);
	ele.setProperty(HTTPSampler.PORT, EMPTY_STRING);
	ele.setProperty(HTTPSampler.PROTOCOL, EMPTY_STRING);
	ele.setProperty(HTTPSampler.RESPONSE_TIMEOUT, EMPTY_STRING);
	

	TestElementProperty argProp = new TestElementProperty(HTTPSampler.ARGUMENTS, argsIniter.initilizeElement());
	ele.setProperty(argProp);
	
	return ele;
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:22,代码来源:HTTPDefaultsInitializer.java

示例10: httpDefaultsTest

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
@Test
public void httpDefaultsTest() {
	HTTPDefaultsInitializer initer = new HTTPDefaultsInitializer();
	ConfigTestElement ele = (ConfigTestElement) initer.initilizeElement();
	
	ModelTester.testBasicFields("HTTP Request Defaults", ele);
	
	Assert.assertTrue("6".equals(ele.getPropertyAsString(HTTPSampler.CONCURRENT_POOL)));
	Assert.assertTrue("".equals(ele.getPropertyAsString(HTTPSampler.CONNECT_TIMEOUT)));
	Assert.assertTrue("".equals(ele.getPropertyAsString(HTTPSampler.CONTENT_ENCODING)));
	Assert.assertTrue("".equals(ele.getPropertyAsString(HTTPSampler.DOMAIN)));
	Assert.assertTrue("".equals(ele.getPropertyAsString(HTTPSampler.PATH)));
	Assert.assertTrue("".equals(ele.getPropertyAsString(HTTPSampler.PORT)));
	Assert.assertTrue("".equals(ele.getPropertyAsString(HTTPSampler.PROTOCOL)));
	Assert.assertTrue("".equals(ele.getPropertyAsString(HTTPSampler.RESPONSE_TIMEOUT)));
	Assert.assertTrue(ele.getProperty(HTTPSampler.ARGUMENTS) != null);		
	
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:19,代码来源:HTTPModelTest.java

示例11: ftpConfigTest

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
@Test
public void ftpConfigTest() {
	FTPConfigInitializer initer = new FTPConfigInitializer();
	ConfigTestElement ele = (ConfigTestElement) initer.initilizeElement();
	
	ModelTester.testBasicFields("FTP Request Defaults", ele);
	
	Assert.assertFalse(ele.getPropertyAsBoolean(FTPSampler.BINARY_MODE));
	Assert.assertTrue("".equals(ele.getPropertyAsString(FTPSampler.REMOTE_FILENAME)));
	Assert.assertTrue("".equals(ele.getPropertyAsString(FTPSampler.INPUT_DATA)));
	Assert.assertTrue("".equals(ele.getPropertyAsString(FTPSampler.LOCAL_FILENAME)));
	Assert.assertTrue("".equals(ele.getPropertyAsString(FTPSampler.PORT)));
	Assert.assertFalse(ele.getPropertyAsBoolean(FTPSampler.SAVE_RESPONSE));
	Assert.assertTrue("".equals(ele.getPropertyAsString(FTPSampler.SERVER)));
	Assert.assertFalse(ele.getPropertyAsBoolean(FTPSampler.UPLOAD_FILE));
	
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:18,代码来源:ModelTest.java

示例12: ldapExtendedConfigTest

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
@Test
public void ldapExtendedConfigTest() {
	LDAPExtendedConfigInitializer initer = new LDAPExtendedConfigInitializer();
	ConfigTestElement ele = (ConfigTestElement) initer.initilizeElement();
	
	ModelTester.testBasicFields("LDAP Extended Request Defaults", ele);
	
	Assert.assertSame("",ele.getPropertyAsString(LDAPExtSampler.ATTRIBS));
	Assert.assertSame("",ele.getPropertyAsString(LDAPExtSampler.COMPAREDN));
	Assert.assertSame("",ele.getPropertyAsString(LDAPExtSampler.COMPAREFILT));
	Assert.assertSame("",ele.getPropertyAsString(LDAPExtSampler.CONNTO));
	Assert.assertTrue(0 == ele.getPropertyAsLong(LDAPExtSampler.COUNTLIM));
	Assert.assertFalse(ele.getPropertyAsBoolean(LDAPExtSampler.DEREF));
	Assert.assertSame("",ele.getPropertyAsString(LDAPExtSampler.MODDDN));
	Assert.assertSame("",ele.getPropertyAsString(LDAPExtSampler.NEWDN));
	Assert.assertFalse(ele.getPropertyAsBoolean(LDAPExtSampler.PARSEFLAG));
	Assert.assertSame("",ele.getPropertyAsString(LDAPExtSampler.PORT));
	Assert.assertFalse(ele.getPropertyAsBoolean(LDAPExtSampler.RETOBJ));
	Assert.assertSame("",ele.getPropertyAsString(LDAPExtSampler.ROOTDN));
	Assert.assertTrue(ele.getPropertyAsInt(LDAPExtSampler.SCOPE) ==  2);
	Assert.assertFalse("",ele.getPropertyAsBoolean(LDAPExtSampler.SECURE));
	Assert.assertSame("",ele.getPropertyAsString(LDAPExtSampler.SERVERNAME));
	Assert.assertSame("",ele.getPropertyAsString(LDAPExtSampler.TIMELIM));
	Assert.assertSame("",ele.getPropertyAsString(LDAPExtSampler.USERDN));
	Assert.assertSame("",ele.getPropertyAsString(LDAPExtSampler.USERPW));
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:27,代码来源:ModelTest.java

示例13: ldapSamplerTest

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
@Test
public void ldapSamplerTest() {	
	LDAPSamplerInitializer initer = new LDAPSamplerInitializer();
	LDAPSampler ele = (LDAPSampler) initer.initilizeElement();
	
	ModelTester.testBasicFields("LDAP Request", ele);
	
	Assert.assertSame("",ele.getPropertyAsString(ConfigTestElement.USERNAME));
	Assert.assertSame("",ele.getPropertyAsString(ConfigTestElement.PASSWORD));
	Assert.assertSame("",ele.getBaseEntryDN());
	Assert.assertSame("",ele.getPort());
	Assert.assertSame("",ele.getRootdn());
	Assert.assertSame("",ele.getServername());
	Assert.assertSame("add",ele.getTest());
	Assert.assertFalse(ele.getUserDefinedTest());
	
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:18,代码来源:ModelTest.java

示例14: saveTransactionControllerConfigs

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
private void saveTransactionControllerConfigs(TransactionController tc) {
    List<ConfigTestElement> configs = new LinkedList<ConfigTestElement>();
    List<Controller> controllers = new LinkedList<Controller>();
    List<SampleListener> listeners = new LinkedList<SampleListener>();
    List<Timer> timers = new LinkedList<Timer>();
    List<Assertion> assertions = new LinkedList<Assertion>();
    LinkedList<PostProcessor> posts = new LinkedList<PostProcessor>();
    LinkedList<PreProcessor> pres = new LinkedList<PreProcessor>();
    for (int i = stack.size(); i > 0; i--) {
        addDirectParentControllers(controllers, stack.get(i - 1));
        for (Object item : testTree.list(stack.subList(0, i))) {
            if (item instanceof SampleListener) {
                listeners.add((SampleListener) item);
            }
            if (item instanceof Assertion) {
                assertions.add((Assertion) item);
            }
        }
    }

    SamplePackage pack = new SamplePackage(configs, listeners, timers, assertions,
            posts, pres, controllers);
    pack.setSampler(new TransactionSampler(tc, tc.getName()));
    pack.setRunningVersion(true);
    transactionControllerConfigMap.put(tc, pack);
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:27,代码来源:TestCompiler.java

示例15: configure

import org.apache.jmeter.config.ConfigTestElement; //导入依赖的package包/类
private void configure(HTTPSamplerBase sampler) throws Exception {
    sampler.addArgument("arg1", "val1");
    ConfigTestElement config = (ConfigTestElement) new HttpDefaultsGui().createTestElement();
    ((Arguments) config.getProperty(HTTPSamplerBase.ARGUMENTS).getObjectValue()).addArgument(new HTTPArgument(
            "config1", "configValue"));
    config.setRunningVersion(true);
    sampler.setRunningVersion(true);
    sampler.setRunningVersion(true);
    sampler.addTestElement(config);
    assertEquals("config1=configValue", sampler.getArguments().getArgument(1).toString());
    sampler.recoverRunningVersion();
    config.recoverRunningVersion();
    assertEquals(1, sampler.getArguments().getArgumentCount());
    sampler.addTestElement(config);
    assertEquals("config1=configValue", sampler.getArguments().getArgument(1).toString());
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:17,代码来源:PackageTest.java


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