summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2009-10-24 11:48:04 +0200
committerShawn O. Pearce <spearce@spearce.org>2009-10-31 16:09:12 -0700
commitd4e7b7060610678e863fbf091746ae1fcc240b0d (patch)
treeadf9cc70ce716e770450b2e4bf9aef0dda8d66fb /org.eclipse.jgit.test/tst/org/eclipse/jgit
parentfad60bddbbee7fd9f6fe5df8f00b5a348b6f387d (diff)
downloadjgit-d4e7b7060610678e863fbf091746ae1fcc240b0d.tar.gz
jgit-d4e7b7060610678e863fbf091746ae1fcc240b0d.zip
Move pure IO utility functions to a utility class of its own.
According the javadoc, and implied by the name of the class, NB is about network byte order. The purpose of moving the IO only, and non-byte order related functions to another class is to make it easier for new contributors to understand that they can use these functions in general and it's also makes it easier to understand where to put new IO related utility functions Change-Id: I4a9f6b39d5564bc8a694b366e7ff3cc758c5181b Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/TimeoutInputStreamTest.java12
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/TimeoutOutputStreamTest.java6
2 files changed, 9 insertions, 9 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/TimeoutInputStreamTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/TimeoutInputStreamTest.java
index cd16288b64..b854ae4e4e 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/TimeoutInputStreamTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/TimeoutInputStreamTest.java
@@ -50,7 +50,7 @@ import java.io.PipedOutputStream;
import java.util.Arrays;
import java.util.List;
-import org.eclipse.jgit.util.NB;
+import org.eclipse.jgit.util.IO;
import org.eclipse.jgit.util.io.InterruptTimer;
import org.eclipse.jgit.util.io.TimeoutInputStream;
@@ -115,7 +115,7 @@ public class TimeoutInputStreamTest extends TestCase {
final byte[] exp = new byte[] { 'a', 'b', 'c' };
final byte[] act = new byte[exp.length];
out.write(exp);
- NB.readFully(is, act, 0, act.length);
+ IO.readFully(is, act, 0, act.length);
assertTrue(Arrays.equals(exp, act));
}
@@ -123,16 +123,16 @@ public class TimeoutInputStreamTest extends TestCase {
final byte[] exp = new byte[] { 'a', 'b', 'c' };
final byte[] act = new byte[exp.length];
out.write(exp);
- NB.readFully(is, act, 0, 1);
- NB.readFully(is, act, 1, 1);
- NB.readFully(is, act, 2, 1);
+ IO.readFully(is, act, 0, 1);
+ IO.readFully(is, act, 1, 1);
+ IO.readFully(is, act, 2, 1);
assertTrue(Arrays.equals(exp, act));
}
public void testTimeout_readBuffer_Timeout() throws IOException {
beginRead();
try {
- NB.readFully(is, new byte[512], 0, 512);
+ IO.readFully(is, new byte[512], 0, 512);
fail("incorrectly read bytes");
} catch (InterruptedIOException e) {
// expected
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/TimeoutOutputStreamTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/TimeoutOutputStreamTest.java
index bba8640ff3..7563fc8c3b 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/TimeoutOutputStreamTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/TimeoutOutputStreamTest.java
@@ -51,7 +51,7 @@ import java.io.PipedOutputStream;
import java.util.Arrays;
import java.util.List;
-import org.eclipse.jgit.util.NB;
+import org.eclipse.jgit.util.IO;
import org.eclipse.jgit.util.io.InterruptTimer;
import org.eclipse.jgit.util.io.TimeoutOutputStream;
@@ -275,11 +275,11 @@ public class TimeoutOutputStreamTest extends TestCase {
}
void want(int cnt) throws IOException {
- NB.skipFully(this, PIPE_SIZE - cnt);
+ IO.skipFully(this, PIPE_SIZE - cnt);
}
void free(int cnt) throws IOException {
- NB.skipFully(this, cnt);
+ IO.skipFully(this, cnt);
}
}
}