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


Java TestElementProperty类代码示例

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


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

示例1: sampleTest2

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的package包/类
@Test
public void sampleTest2() throws Exception {
 http2Req.testStarted();
 
 Arguments args = new Arguments();
       String text = "{\"header\":{\"applicationId\":\"HJS\"},\"initSession\":{}}";
       HTTPArgument arg = new HTTPArgument("", text.replaceAll("\n","\r\n"), false);
       arg.setAlwaysEncoded(false);
       args.addArgument(arg);
       http2Req.setProperty(new TestElementProperty(HTTP2Request.ARGUMENTS, args));

 URL url = new URL("https", "www.sprint.com", 443, "/apiservices/framework/initSession");
 
 HTTP2Connection connection = Mockito.mock(HTTP2Connection.class);
 
 Mockito.when(connection.isClosed()).thenReturn(true);
 Mockito.doNothing().when(connection).connect(Mockito.any(String.class), Mockito.any(Integer.class));
 Mockito.when(connection.getConnectionId()).thenReturn("10www.sprint.com443");
 
 HTTP2SampleResult sampleResult =new HTTP2SampleResult(url, "POST");
 http2Req.addConnection("10www.sprint.com443", connection);
 http2Req.setConnection(url, sampleResult);
 http2Req.setProperty(new BooleanProperty(HTTP2Request.SYNCREQUEST, true));
 HTTP2SampleResult sample = http2Req.sample(url, "POST", false, 0, http2Req.getConnection(), sampleResult);
 
}
 
开发者ID:Blazemeter,项目名称:jmeter-bzm-plugins,代码行数:27,代码来源:HTTP2RequestTest.java

示例2: createPostContentTest

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的package包/类
@Test
public void createPostContentTest() throws Exception {
 String text = "{\"header\":{\"applicationId\":\"HJS\"},\"initSession\":{}}";
 
 
 DataPostContent dataPostExp = new DataPostContent();
 dataPostExp.setDataPath("/apiservices/framework/initSession");
 dataPostExp.setPayload(text.getBytes());
 		 
 Arguments args = new Arguments();
       
       HTTPArgument arg = new HTTPArgument("", text.replaceAll("\n","\r\n"), false);
       arg.setAlwaysEncoded(false);
       args.addArgument(arg);
       http2Req.setProperty(new TestElementProperty(HTTP2Request.ARGUMENTS, args));
 http2Req.setProperty(HTTP2Request.PATH, "/apiservices/framework/initSession");
       DataPostContent dataPostRes = http2Req.createPostContent("POST");
       
       assertEquals(dataPostExp.getDataPath(), dataPostRes.getDataPath());     
       
}
 
开发者ID:Blazemeter,项目名称:jmeter-bzm-plugins,代码行数:22,代码来源:HTTP2RequestTest.java

示例3: getSendFileAsPostBodyTest

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的package包/类
@Test
public void getSendFileAsPostBodyTest(){
 HTTPFileArgs fileArgs = new HTTPFileArgs();
 http2Req.setProperty(new TestElementProperty("HTTPsampler.Files", fileArgs));
 boolean valueRes=http2Req.getSendFileAsPostBody();
 assertFalse(valueRes);		
}
 
开发者ID:Blazemeter,项目名称:jmeter-bzm-plugins,代码行数:8,代码来源:HTTP2RequestTest.java

示例4: marshal

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void marshal(Object arg0, HierarchicalStreamWriter writer, MarshallingContext context) {
    TestElementProperty prop = (TestElementProperty) arg0;
    writer.addAttribute(ConversionHelp.ATT_NAME, ConversionHelp.encode(prop.getName()));
    Class<?> clazz = prop.getObjectValue().getClass();
    writer.addAttribute(ConversionHelp.ATT_ELEMENT_TYPE,
            mapper().serializedClass(clazz));
    TestElement te = (TestElement)prop.getObjectValue();
    ConversionHelp.saveSpecialProperties(te,writer);
    for (JMeterProperty jmp : prop) {
        // Skip special properties if required
        if (!ConversionHelp.isSpecialProperty(jmp.getName()))
        {
            // Don't save empty comments
            if (!(TestElement.COMMENTS.equals(jmp.getName())
                    && jmp.getStringValue().isEmpty()))
            {
                writeItem(jmp, context, writer);
            }
        }
    }
    //TODO clazz is probably always the same as testclass
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:25,代码来源:TestElementPropertyConverter.java

示例5: initilizeElement

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的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

示例6: modifyTestElement

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的package包/类
@Override
public void modifyTestElement(TestElement element) {
    configureTestElement(element);
    element.setProperty(WebSocketSampler.DOMAIN, domain.getText());
    element.setProperty(WebSocketSampler.PATH, path.getText());
    element.setProperty(WebSocketSampler.PORT, port.getText());
    element.setProperty(WebSocketSampler.PROTOCOL, protocol.getText());
    element.setProperty(WebSocketSampler.CONTENT_ENCODING, contentEncoding.getText());

    Arguments args = (Arguments) argsPanel.createTestElement();
    HTTPArgument.convertArgumentsToHTTP(args);
    element.setProperty(new TestElementProperty(WebSocketSampler.ARGUMENTS, args));

    element.setProperty(WebSocketSampler.SEND_MESSAGE, sendMessage.getText());
    element.setProperty(WebSocketSampler.RECV_MESSAGE, recvMessage.getText());
}
 
开发者ID:kawasima,项目名称:jmeter-websocket,代码行数:17,代码来源:WebSocketSamplerGui.java

示例7: unwrapProperty

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的package包/类
private static Object unwrapProperty(PropertyDescriptor desc, JMeterProperty jprop, Class<?> type) {
    Object value;
    if(jprop instanceof TestElementProperty)
    {
        TestElement te = ((TestElementProperty)jprop).getElement();
        if(te instanceof TestBean)
        {
            prepare(te);
        }
        value = te;
    }
    else if(jprop instanceof MultiProperty)
    {
        value = unwrapCollection((MultiProperty)jprop,(String)desc.getValue(TableEditor.CLASSNAME));
    }
    // value was not provided, and this is allowed
    else if (jprop instanceof NullProperty &&
            // use negative condition so missing (null) value is treated as FALSE
            ! Boolean.TRUE.equals(desc.getValue(GenericTestBeanCustomizer.NOT_UNDEFINED))) {    
        value=null;
    } else {
        value = Converter.convert(jprop.getStringValue(), type);
    }
    return value;
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:26,代码来源:TestBeanHelper.java

示例8: convertCollection

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的package包/类
private Collection<Object> convertCollection(Collection<?> values)
{
    List<Object> l = new LinkedList<Object>();
    for(Object obj : values)
    {
        if(obj instanceof TestElementProperty)
        {
            l.add(((TestElementProperty)obj).getElement());
        }
        else
        {
            l.add(obj);
        }
    }
    return l;
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:17,代码来源:TableEditor.java

示例9: setUp

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的package包/类
@Override
protected void setUp() {
    Arguments args = new Arguments();
    args.addArgument("username", "mstover");
    args.addArgument("password", "pass");
    args.addArgument("action", "login");
    config = new HTTPNullSampler();
    config.setName("Full Config");
    config.setProperty(HTTPSamplerBase.DOMAIN, "www.lazer.com");
    config.setProperty(HTTPSamplerBase.PATH, "login.jsp");
    config.setProperty(HTTPSamplerBase.METHOD, HTTPConstants.POST);
    config.setProperty(new TestElementProperty(HTTPSamplerBase.ARGUMENTS, args));
    defaultConfig = new HTTPNullSampler();
    defaultConfig.setName("default");
    defaultConfig.setProperty(HTTPSamplerBase.DOMAIN, "www.xerox.com");
    defaultConfig.setProperty(HTTPSamplerBase.PATH, "default.html");
    partialConfig = new HTTPNullSampler();
    partialConfig.setProperty(HTTPSamplerBase.PATH, "main.jsp");
    partialConfig.setProperty(HTTPSamplerBase.METHOD, HTTPConstants.GET);
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:21,代码来源:UrlConfigTest.java

示例10: testRecovery

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的package包/类
public void testRecovery() throws Exception {
    ConfigTestElement config = new ConfigTestElement();
    config.addProperty(new StringProperty("name", "config"));
    config.setRunningVersion(true);
    LoginConfig loginConfig = new LoginConfig();
    loginConfig.setUsername("user1");
    loginConfig.setPassword("pass1");
    assertTrue(config.getProperty("login") instanceof NullProperty);
    // This test should work whether or not all Nulls are equal
    assertEquals(new NullProperty("login"), config.getProperty("login"));
    config.addProperty(new TestElementProperty("login", loginConfig));
    assertEquals(loginConfig.toString(), config.getPropertyAsString("login"));
    config.recoverRunningVersion();
    assertTrue(config.getProperty("login") instanceof NullProperty);
    assertEquals(new NullProperty("login"), config.getProperty("login"));
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:17,代码来源:PackageTest.java

示例11: testArguments

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的package包/类
public void testArguments() throws Exception {
    Arguments args = new Arguments();
    args.addArgument("arg1", "val1", "=");
    TestElementProperty prop = new TestElementProperty("args", args);
    ConfigTestElement te = new ConfigTestElement();
    te.addProperty(prop);
    te.setRunningVersion(true);
    Arguments config = new Arguments();
    config.addArgument("config1", "configValue", "=");
    TestElementProperty configProp = new TestElementProperty("args", config);
    ConfigTestElement te2 = new ConfigTestElement();
    te2.addProperty(configProp);
    te.addTestElement(te2);
    assertEquals(2, args.getArgumentCount());
    assertEquals("config1=configValue", args.getArgument(1).toString());
    te.recoverRunningVersion();
    te.addTestElement(te2);
    assertEquals(2, args.getArgumentCount());
    assertEquals("config1=configValue", args.getArgument(1).toString());

}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:22,代码来源:PackageTest.java

示例12: setHeaderManager

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的package包/类
public void setHeaderManager(HeaderManager value) {
	HeaderManager mgr = getHeaderManager();
	if (mgr != null) {
		value = mgr.merge(value, true);
		if (log.isDebugEnabled()) {
			log.debug("Existing HeaderManager '" + mgr.getName() + "' merged with '" + value.getName() + "'");
			for (int i = 0; i < value.getHeaders().size(); i++) {
				log.debug("    " + value.getHeader(i).getName() + "=" + value.getHeader(i).getValue());
			}
		}
	}
	setProperty(new TestElementProperty(HEADER_MANAGER, (TestElement) value));
}
 
开发者ID:Blazemeter,项目名称:jmeter-bzm-plugins,代码行数:14,代码来源:HlsSampler.java

示例13: setHeaderManager

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的package包/类
public void setHeaderManager(HeaderManager value) {
	HeaderManager mgr = getHeaderManager();
	if (mgr != null) {
		value = mgr.merge(value, true);
		if (log.isDebugEnabled()) {
			log.debug("Existing HeaderManager '" + mgr.getName() + "' merged with '" + value.getName() + "'");
			for (int i = 0; i < value.getHeaders().size(); i++) {
				log.debug("    " + value.getHeader(i).getName() + "=" + value.getHeader(i).getValue());
			}
		}
	}
	setProperty(new TestElementProperty(HEADER_MANAGER, value));
}
 
开发者ID:Blazemeter,项目名称:jmeter-bzm-plugins,代码行数:14,代码来源:WebSocketAbstractSampler.java

示例14: modifyTestElement

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的package包/类
@Override
public void modifyTestElement(TestElement te) {
    configureTestElement(te);
    if (te instanceof ConfigTestElement) {
    	ConfigTestElement configTestElement = (ConfigTestElement) te;
    	configTestElement.setProperty("WebSocketConnectionConfig.Server", webSocketConnectionConfigPanel.getServer());
    	configTestElement.setProperty("WebSocketConnectionConfig.Port", webSocketConnectionConfigPanel.getPort());
    	configTestElement.setProperty("WebSocketConnectionConfig.ConnectionTimeout", webSocketConnectionConfigPanel.getConnectionTimeout());
    	configTestElement.setProperty("WebSocketConnectionConfig.Protocol", webSocketConnectionConfigPanel.getProtocolSelected());
    	configTestElement.setProperty("WebSocketConnectionConfig.Path", webSocketConnectionConfigPanel.getPath());
    	configTestElement.setProperty("WebSocketConnectionConfig.Topic", webSocketConnectionConfigPanel.getTopic());
    	configTestElement.setProperty("WebSocketConnectionConfig.Encoding", webSocketConnectionConfigPanel.getContentEncoding());
    	configTestElement.setProperty("WebSocketConnectionConfig.Implementation", webSocketConnectionConfigPanel.getImplementation());
        configTestElement.setProperty("WebSocketConnectionConfig.CloseConnectionPattern", webSocketConnectionConfigPanel.getCloseConnectionPattern());
        configTestElement.setProperty("WebSocketConnectionConfig.ProtocolWSMQTTComboBox", webSocketConnectionConfigPanel.getProtocolWSMQTTComboBox());
        configTestElement.setProperty("WebSocketConnectionConfig.LogLevel", webSocketConnectionConfigPanel.getLogLevel());
        
        
        HTTPArgumentsPanel queryStringParameters = webSocketConnectionConfigPanel.getAttributePanel();
        if (queryStringParameters != null) {
        	configTestElement.setProperty(new TestElementProperty("WebSocketConnectionConfig.HTTPRequest.ARGUMENTS", (Arguments)queryStringParameters.createTestElement()));
        }
        
        ArgumentsPanel queryStringPatterns = webSocketConnectionConfigPanel.getPatternsPanel();
        if (queryStringPatterns != null) {
        	configTestElement.setProperty(new TestElementProperty("WebSocketConnectionConfig.ResponsePatterns.ARGUMENTS", (Arguments)queryStringPatterns.createTestElement()));
        }
    }
}
 
开发者ID:Blazemeter,项目名称:jmeter-bzm-plugins,代码行数:30,代码来源:WebSocketConnectionConfigGui.java

示例15: setHeaderManager

import org.apache.jmeter.testelement.property.TestElementProperty; //导入依赖的package包/类
public void setHeaderManager(HeaderManager value) {
    HeaderManager mgr = getHeaderManager();
    if (mgr != null) {
        value = mgr.merge(value, true);
        if (log.isDebugEnabled()) {
            log.debug("Existing HeaderManager '" + mgr.getName() + "' merged with '" + value.getName() + "'");
            for (int i = 0; i < value.getHeaders().size(); i++) {
                log.debug("    " + value.getHeader(i).getName() + "=" + value.getHeader(i).getValue());
            }
        }
    }
    setProperty(new TestElementProperty(HEADER_MANAGER, value));
}
 
开发者ID:Blazemeter,项目名称:jmeter-bzm-plugins,代码行数:14,代码来源:HTTP2Request.java


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