Author: bdelacretaz
Date: Thu Mar 10 13:11:51 2011
New Revision: 1080208
URL: http://svn.apache.org/viewvc?rev=1080208&view=rev
Log:
SLING-1981 - remove dependency on commons-io, which was not used much
Modified:
sling/trunk/testing/tools/pom.xml
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RequestExecutor.java
Modified: sling/trunk/testing/tools/pom.xml
URL:
http://svn.apache.org/viewvc/sling/trunk/testing/tools/pom.xml?rev=1080208&r1=1080207&r2=1080208&view=diff
==============================================================================
--- sling/trunk/testing/tools/pom.xml (original)
+++ sling/trunk/testing/tools/pom.xml Thu Mar 10 13:11:51 2011
@@ -48,11 +48,6 @@
<version>1.1</version>
</dependency>
<dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.0.1</version>
- </dependency>
- <dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.0.1</version>
@@ -79,4 +74,4 @@
<scope>compile</scope>
</dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
Modified:
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RequestExecutor.java
URL:
http://svn.apache.org/viewvc/sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RequestExecutor.java?rev=1080208&r1=1080207&r2=1080208&view=diff
==============================================================================
---
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RequestExecutor.java
(original)
+++
sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RequestExecutor.java
Thu Mar 10 13:11:51 2011
@@ -20,11 +20,11 @@ import static org.junit.Assert.assertEqu
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
+import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;
import java.util.regex.Pattern;
-import org.apache.commons.io.LineIterator;
import org.apache.http.HttpEntity;
import org.apache.http.HttpException;
import org.apache.http.HttpHost;
@@ -178,14 +178,14 @@ public class RequestExecutor {
* Regexps are automatically prefixed/suffixed with .* so as
* to have match partial lines.
*/
- public RequestExecutor assertContentRegexp(String... regexp) {
+ public RequestExecutor assertContentRegexp(String... regexp) throws
IOException {
assertNotNull(this.toString(), response);
nextPattern:
for(String expr : regexp) {
final Pattern p = Pattern.compile(".*" + expr + ".*");
- final LineIterator it = new LineIterator(new
StringReader(content));
- while(it.hasNext()) {
- final String line = it.nextLine();
+ final BufferedReader br = new BufferedReader(new
StringReader(content));
+ String line = null;
+ while( (line = br.readLine()) != null) {
if(p.matcher(line).matches()) {
continue nextPattern;
}