diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2017-09-05 03:13:15 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2017-09-05 03:13:15 +0000 |
commit | 8368b87ccd65ee13358e60ecdcfc1852e9b33d75 (patch) | |
tree | 2e22352ed00e4402c24ad627c5bd9e259d560239 /src/test/java/com/healthmarketscience/jackcess/TestUtil.java | |
parent | 32fc3f80769785495a3474654528529c2d874c02 (diff) | |
download | jackcess-8368b87ccd65ee13358e60ecdcfc1852e9b33d75.tar.gz jackcess-8368b87ccd65ee13358e60ecdcfc1852e9b33d75.zip |
implement a bunch of functions which really need unit tests; add support for calculated field expressions
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/exprs@1113 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/test/java/com/healthmarketscience/jackcess/TestUtil.java')
-rw-r--r-- | src/test/java/com/healthmarketscience/jackcess/TestUtil.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/test/java/com/healthmarketscience/jackcess/TestUtil.java b/src/test/java/com/healthmarketscience/jackcess/TestUtil.java index 3317c7f..7033f7a 100644 --- a/src/test/java/com/healthmarketscience/jackcess/TestUtil.java +++ b/src/test/java/com/healthmarketscience/jackcess/TestUtil.java @@ -383,19 +383,27 @@ public class TestUtil { // FIXME should really be using commons io FileUtils here, but don't want // to add dep for one simple test method - byte[] buf = new byte[1024]; OutputStream ostream = new FileOutputStream(dstFile); InputStream istream = new FileInputStream(srcFile); try { - int numBytes = 0; - while((numBytes = istream.read(buf)) >= 0) { - ostream.write(buf, 0, numBytes); - } + copyStream(istream, ostream); } finally { ostream.close(); } } + static void copyStream(InputStream istream, OutputStream ostream) + throws IOException + { + // FIXME should really be using commons io FileUtils here, but don't want + // to add dep for one simple test method + byte[] buf = new byte[1024]; + int numBytes = 0; + while((numBytes = istream.read(buf)) >= 0) { + ostream.write(buf, 0, numBytes); + } + } + static File createTempFile(boolean keep) throws Exception { File tmp = File.createTempFile("databaseTest", ".mdb"); if(keep) { |