jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1381356 - in /jmeter/trunk/test/src/org/apache/jmeter: protocol/http/parser/TestHTMLParser.java protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java resources/PackageTest.java
Date Wed, 05 Sep 2012 20:39:19 GMT
Author: pmouawad
Date: Wed Sep  5 20:39:19 2012
New Revision: 1381356

URL: http://svn.apache.org/viewvc?rev=1381356&view=rev
Log:
use indexOf(char)

Modified:
    jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java
    jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java
    jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java

Modified: jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java?rev=1381356&r1=1381355&r2=1381356&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java Wed Sep
 5 20:39:19 2012
@@ -250,7 +250,7 @@ public class TestHTMLParser extends JMet
                 boolean orderMatters) // Does the order matter?
                 throws Exception {
             String parserName = p.getClass().getName().substring("org.apache.jmeter.protocol.http.parser.".length());
-            String fname = file.substring(file.indexOf("/")+1);
+            String fname = file.substring(file.indexOf('/')+1);
             log.debug("file   " + file);
             File f = findTestFile(file);
             byte[] buffer = new byte[(int) f.length()];

Modified: jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java?rev=1381356&r1=1381355&r2=1381356&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java
(original)
+++ jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java
Wed Sep  5 20:39:19 2012
@@ -1021,15 +1021,15 @@ public class TestHTTPSamplersAgainstHttp
             throws IOException {
         // Check the Request URI sent to the mirror server, and
         // sent back by the mirror server
-        int indexFirstSpace = headersSent.indexOf(" ");
-        int indexSecondSpace = headersSent.indexOf(" ", headersSent.length() > indexFirstSpace
? indexFirstSpace + 1 : indexFirstSpace);
+        int indexFirstSpace = headersSent.indexOf(' ');
+        int indexSecondSpace = headersSent.indexOf(' ', headersSent.length() > indexFirstSpace
? indexFirstSpace + 1 : indexFirstSpace);
         if(indexFirstSpace <= 0 && indexSecondSpace <= 0 || indexFirstSpace
== indexSecondSpace) {
             fail("Could not find method and URI sent");
         }
         String methodSent = headersSent.substring(0, indexFirstSpace);
         assertEquals(expectedMethod, methodSent);
         String uriSent = headersSent.substring(indexFirstSpace + 1, indexSecondSpace);
-        int indexQueryStart = uriSent.indexOf("?");
+        int indexQueryStart = uriSent.indexOf('?');
         if(expectedQueryString != null && expectedQueryString.length() > 0) {
             // We should have a query string part
             if(indexQueryStart <= 0 || (indexQueryStart == uriSent.length() - 1)) {
@@ -1154,7 +1154,7 @@ public class TestHTTPSamplersAgainstHttp
             MatchResult match = localMatcher.getMatch();
             String matchString =  match.group(1);
             // Header may contain ;charset= , regexp extracts it so computed boundary is
wrong
-            int indexOf = matchString.indexOf(";");
+            int indexOf = matchString.indexOf(';');
             if(indexOf>=0) {
                 return matchString.substring(0, indexOf);
             } else {

Modified: jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java?rev=1381356&r1=1381355&r2=1381356&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java Wed Sep  5 20:39:19
2012
@@ -130,9 +130,9 @@ public class PackageTest extends TestCas
 	                 * parameters and check if there is a { in the output. A bit
 	                 * crude, but should be enough for now.
 	                 */
-	                if (val.indexOf("{0}") > 0 && val.indexOf("'") > 0) {
+	                if (val.indexOf("{0}") > 0 && val.indexOf('\'') > 0) {
 	                    String m = java.text.MessageFormat.format(val, DUMMY_PARAMS);
-	                    if (m.indexOf("{") > 0) {
+	                    if (m.indexOf('{') > 0) {
 	                        fails++;
 	                        System.out.println("Incorrect message format ? (input/output) for:
"+key);
 	                        System.out.println(val);
@@ -257,7 +257,7 @@ public class PackageTest extends TestCas
 			} else {
 				String absPath2 = file2.getAbsolutePath().replace('\\', '/'); // Fix up Windows paths
                 int indexOfOrg = absPath2.indexOf("/org");
-				int lastIndex = absPath2.lastIndexOf(".");
+				int lastIndex = absPath2.lastIndexOf('.');
 				set.add(absPath2.substring(indexOfOrg, lastIndex));
 			}
 		}



Mime
View raw message