use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class JMeterPluginsUtilsTest method testCollectionPropertyToTableModelRows.
@Test
public void testCollectionPropertyToTableModelRows() {
System.out.println("collectionPropertyToTableModelRows");
String propname = "prop";
PowerTableModel modelSrc = getTestModel();
CollectionProperty propExp = JMeterPluginsUtils.tableModelRowsToCollectionProperty(modelSrc, propname);
PowerTableModel modelDst = getTestModel();
modelDst.clearData();
JMeterPluginsUtils.collectionPropertyToTableModelRows(propExp, modelDst);
CollectionProperty propRes = JMeterPluginsUtils.tableModelRowsToCollectionProperty(modelDst, propname);
assertEquals(propExp.toString(), propRes.toString());
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter-plugins by undera.
the class JMeterPluginsUtilsTest method testTableModelRowsToCollectionProperty.
@Test
public void testTableModelRowsToCollectionProperty() {
System.out.println("tableModelRowsToCollectionProperty");
PowerTableModel model = getTestModel();
String propname = "prop";
CollectionProperty result = JMeterPluginsUtils.tableModelRowsToCollectionProperty(model, propname);
assertEquals(2, result.size());
assertEquals("[[1, 2], [3, 4]]", result.toString());
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter by apache.
the class TestAuthManager method testFile.
@Test
public void testFile() throws Exception {
AuthManager am = new AuthManager();
CollectionProperty ao = am.getAuthObjects();
assertEquals(0, ao.size());
am.addFile(findTestPath("testfiles/TestAuth.txt"));
assertEquals(9, ao.size());
Authorization at;
at = am.getAuthForURL(new URL("http://a.b.c/"));
assertEquals("login", at.getUser());
assertEquals("password", at.getPass());
// same as above
at = am.getAuthForURL(new URL("http://a.b.c:80/"));
assertEquals("login", at.getUser());
assertEquals("password", at.getPass());
// not same
at = am.getAuthForURL(new URL("http://a.b.c:443/"));
assertNull(at);
at = am.getAuthForURL(new URL("http://a.b.c/1"));
assertEquals("login1", at.getUser());
assertEquals("password1", at.getPass());
assertEquals("", at.getDomain());
assertEquals("", at.getRealm());
at = am.getAuthForURL(new URL("http://d.e.f/"));
assertEquals("user", at.getUser());
assertEquals("pass", at.getPass());
assertEquals("domain", at.getDomain());
assertEquals("realm", at.getRealm());
at = am.getAuthForURL(new URL("https://j.k.l/"));
assertEquals("jkl", at.getUser());
assertEquals("pass", at.getPass());
at = am.getAuthForURL(new URL("https://j.k.l:443/"));
assertEquals("jkl", at.getUser());
assertEquals("pass", at.getPass());
at = am.getAuthForURL(new URL("https://l.m.n/"));
assertEquals("lmn443", at.getUser());
assertEquals("pass", at.getPass());
at = am.getAuthForURL(new URL("https://l.m.n:443/"));
assertEquals("lmn443", at.getUser());
assertEquals("pass", at.getPass());
at = am.getAuthForURL(new URL("https://l.m.n:8443/"));
assertEquals("lmn8443", at.getUser());
assertEquals("pass", at.getPass());
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter by apache.
the class HTTPFileArgs method asArray.
/**
* Get the current arguments as an array.
*
* @return an array of file arguments
*/
public HTTPFileArg[] asArray() {
CollectionProperty props = getHTTPFileArgsCollection();
final int size = props.size();
HTTPFileArg[] args = new HTTPFileArg[size];
for (int i = 0; i < size; i++) {
args[i] = (HTTPFileArg) props.get(i).getObjectValue();
}
return args;
}
use of org.apache.jmeter.testelement.property.CollectionProperty in project jmeter by apache.
the class HTTPFileArgs method clear.
/**
* Clear the files.
*/
@Override
public void clear() {
super.clear();
setProperty(new CollectionProperty(HTTP_FILE_ARGS, new ArrayList<HTTPFileArg>()));
}
Aggregations