You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2006/02/15 19:50:38 UTC
svn commit: r378057 -
/jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java
Author: sebb
Date: Wed Feb 15 10:50:36 2006
New Revision: 378057
URL: http://svn.apache.org/viewcvs?rev=378057&view=rev
Log:
Log document usage; demote some class fields
Modified:
jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java
Modified: jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java
URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java?rev=378057&r1=378056&r2=378057&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java (original)
+++ jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java Wed Feb 15 10:50:36 2006
@@ -86,16 +86,6 @@
public static final String WSDL_URL = "WebserviceSampler.wsdl_url";
/**
- * size of File[] array
- */
- private int fileCount = -1;
-
- /**
- * List of files that have .xml extension
- */
- private File[] fileList = null;
-
- /**
* Random class for generating random numbers.
*/
private final Random RANDOM = new Random();
@@ -173,9 +163,8 @@
if (this.getXmlPathLoc() != null) {
File src = new File(this.getXmlPathLoc());
if (src.isDirectory() && src.list() != null) {
- fileList = src.listFiles(new JMeterFileFilter(new String[] { ".xml" }));
- this.fileCount = fileList.length;
- File one = fileList[RANDOM.nextInt(fileCount)];
+ File [] fileList = src.listFiles(new JMeterFileFilter(new String[] { ".xml" }));
+ File one = fileList[RANDOM.nextInt(fileList.length)];
// return the absolutePath of the file
return one.getAbsolutePath();
} else {
@@ -369,10 +358,13 @@
public org.w3c.dom.Element createDocument() {
if (getPropertyAsBoolean(MEMORY_CACHE)) {
String next = this.getRandomFileName();
- if (DOMPool.getDocument(next) != null) {
- return DOMPool.getDocument(next).getDocumentElement();
+ Document document = DOMPool.getDocument(next);
+ if (document != null) {
+ log.info("Reusing document with key: "+next);
+ return document.getDocumentElement();
} else {
Document doc = openDocument(next);
+ log.info("Created document with key: "+next);
return doc == null ? null : doc.getDocumentElement();
}
} else {
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org