Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse2019-06-02 08:02:51 +0000
committerDavid Pursehouse2019-06-02 23:07:24 +0000
commitee747827b0d26cf770f44a33b201de31e81ca8ea (patch)
tree0ae0555ffb44f5c9adcb0b94a675ed3e90ac441e /org.eclipse.jgit.http.test/tst/org
parente0133b9440cf28cc8495e4af0546d1467edbb028 (diff)
downloadjgit-ee747827b0d26cf770f44a33b201de31e81ca8ea.tar.gz
jgit-ee747827b0d26cf770f44a33b201de31e81ca8ea.tar.xz
jgit-ee747827b0d26cf770f44a33b201de31e81ca8ea.zip
PacketLineIn: Add an iterator over strings in the input stream
Allows callers to read all lines in the input stream until the END marker is reached, without having to explicitly check for the END marker. Replace all remaining usage of the END marker with the new method. Change-Id: I51f419c7f569ab7ed01e1aaaf6b40ed8cdc2116b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.http.test/tst/org')
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java
index 4158049171..8ec2f51cff 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java
@@ -387,8 +387,7 @@ public class HttpClientTests extends HttpTestCase {
// What remains are capabilities - ensure that all of them are
// non-empty strings, and that we see END at the end.
- String s;
- while ((s = pckIn.readString()) != PacketLineIn.END) {
+ for (String s : pckIn.readStrings()) {
assertTrue(!s.isEmpty());
}
}
@@ -421,8 +420,7 @@ public class HttpClientTests extends HttpTestCase {
PacketLineIn pckIn = new PacketLineIn(c.getInputStream());
// Just check that we get what looks like a ref advertisement.
- String s;
- while ((s = pckIn.readString()) != PacketLineIn.END) {
+ for (String s : pckIn.readStrings()) {
assertTrue(s.matches("[0-9a-f]{40} [A-Za-z/]*"));
}

Back to the top