summaryrefslogtreecommitdiffstats
path: root/archive/src
diff options
context:
space:
mode:
authorJorg Pleumann <>2009-03-31 14:13:24 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-31 14:13:24 -0700
commit206059bac7dbb60f56c3a81eef12e13b1eaac218 (patch)
tree2dddab7e94182757c152e5ccffa8b58477dd5e0f /archive/src
parent70729d531568e6d9014298439e017146bf2b23f2 (diff)
downloadlibcore-206059bac7dbb60f56c3a81eef12e13b1eaac218.zip
libcore-206059bac7dbb60f56c3a81eef12e13b1eaac218.tar.gz
libcore-206059bac7dbb60f56c3a81eef12e13b1eaac218.tar.bz2
AI 143684: am: CL 143654 am: CL 143467 Bringing archive down to zero failures and
zero broken tests. Original author: jorgp Merged from: //branches/cupcake/... Original author: android-build Merged from: //branches/donutburger/... Automated import of CL 143684
Diffstat (limited to 'archive/src')
-rw-r--r--archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java5
-rw-r--r--archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java12
-rw-r--r--archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPOutputStreamTest.java15
3 files changed, 21 insertions, 11 deletions
diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java
index 497b897..f813979 100644
--- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java
+++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java
@@ -491,8 +491,9 @@ public class JarFileTest extends TestCase {
ByteArrayOutputStream manOut = new ByteArrayOutputStream();
manifest.write(manOut);
byte[] manBytes = manOut.toByteArray();
- File file = new File(Support_PlatformFile.getNewPlatformFile(
- "hyts_manifest1", ".jar"));
+ File file = File.createTempFile(
+ Support_PlatformFile.getNewPlatformFile("hyts_manifest1",
+ ""), ".jar");
JarOutputStream jarOut = new JarOutputStream(new FileOutputStream(
file.getAbsolutePath()));
ZipEntry entry = new ZipEntry("META-INF/");
diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java
index c0a83d2..31974d1 100644
--- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java
+++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java
@@ -45,7 +45,8 @@ public class CheckedOutputStreamTest extends junit.framework.TestCase {
public void test_ConstructorLjava_io_OutputStreamLjava_util_zip_Checksum() {
// test method java.util.zip.checkedOutputStream.constructor
try {
- FileOutputStream outFile = new FileOutputStream("chkOut.txt");
+ FileOutputStream outFile = new FileOutputStream(
+ File.createTempFile("chkOut", ".txt"));
CheckedOutputStream chkOut = new CheckedOutputStream(outFile,
new CRC32());
assertEquals("the checkSum value of the constructor is not 0", 0,
@@ -71,7 +72,8 @@ public class CheckedOutputStreamTest extends junit.framework.TestCase {
// test method java.util.zip.checkedOutputStream.getChecksum()
byte byteArray[] = {1, 2, 3, 'e', 'r', 't', 'g', 3, 6};
try {
- FileOutputStream outFile = new FileOutputStream("chkOut.txt");
+ FileOutputStream outFile = new FileOutputStream(
+ File.createTempFile("chkOut", ".txt"));
CheckedOutputStream chkOut = new CheckedOutputStream(outFile,
new Adler32());
chkOut.write(byteArray[4]);
@@ -109,7 +111,8 @@ public class CheckedOutputStreamTest extends junit.framework.TestCase {
CheckedOutputStream chkOut = null;
byte byteArray[] = {1, 2, 3, 'e', 'r', 't', 'g', 3, 6};
try {
- FileOutputStream outFile = new FileOutputStream("chkOut.txt");
+ FileOutputStream outFile = new FileOutputStream(
+ File.createTempFile("chkOut", ".txt"));
chkOut = new CheckedOutputStream(outFile, new CRC32());
for (byte element : byteArray) {
chkOut.write(element);
@@ -145,7 +148,8 @@ public class CheckedOutputStreamTest extends junit.framework.TestCase {
CheckedOutputStream chkOut = null;
byte byteArray[] = {1, 2, 3, 'e', 'r', 't', 'g', 3, 6};
try {
- FileOutputStream outFile = new FileOutputStream("chkOut.txt");
+ FileOutputStream outFile = new FileOutputStream(
+ File.createTempFile("chkOut", ".txt"));
chkOut = new CheckedOutputStream(outFile, new CRC32());
chkOut.write(byteArray, 4, 5);
assertTrue(
diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPOutputStreamTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPOutputStreamTest.java
index 298f63a..9b23b56 100644
--- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPOutputStreamTest.java
+++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPOutputStreamTest.java
@@ -57,7 +57,8 @@ public class GZIPOutputStreamTest extends junit.framework.TestCase {
)
public void test_ConstructorLjava_io_OutputStream() {
try {
- FileOutputStream outFile = new FileOutputStream("GZIPOutCon.txt");
+ FileOutputStream outFile = new FileOutputStream(
+ File.createTempFile("GZIPOutCon", ".txt"));
TestGZIPOutputStream outGZIP = new TestGZIPOutputStream(outFile);
assertNotNull("the constructor for GZIPOutputStream is null",
outGZIP);
@@ -81,7 +82,8 @@ public class GZIPOutputStreamTest extends junit.framework.TestCase {
)
public void test_ConstructorLjava_io_OutputStreamI() {
try {
- FileOutputStream outFile = new FileOutputStream("GZIPOutCon.txt");
+ FileOutputStream outFile = new FileOutputStream(
+ File.createTempFile("GZIPOutCon", ".txt"));
TestGZIPOutputStream outGZIP = new TestGZIPOutputStream(outFile,
100);
assertNotNull("the constructor for GZIPOutputStream is null",
@@ -109,7 +111,8 @@ public class GZIPOutputStreamTest extends junit.framework.TestCase {
TestGZIPOutputStream outGZIP = null;
FileOutputStream outFile = null;
try {
- outFile = new FileOutputStream("GZIPOutFinish.txt");
+ outFile = new FileOutputStream(
+ File.createTempFile("GZIPOutCon", ".txt"));
outGZIP = new TestGZIPOutputStream(outFile);
outGZIP.finish();
@@ -152,7 +155,8 @@ public class GZIPOutputStreamTest extends junit.framework.TestCase {
// test method java.util.zip.GZIPOutputStream.close()
byte byteArray[] = {3, 5, 2, 'r', 'g', 'e', 'f', 'd', 'e', 'w'};
try {
- FileOutputStream outFile = new FileOutputStream("GZIPOutClose2.txt");
+ FileOutputStream outFile = new FileOutputStream(
+ File.createTempFile("GZIPOutCon", ".txt"));
TestGZIPOutputStream outGZIP = new TestGZIPOutputStream(outFile);
outGZIP.close();
int r = 0;
@@ -183,7 +187,8 @@ public class GZIPOutputStreamTest extends junit.framework.TestCase {
byte byteArray[] = {3, 5, 2, 'r', 'g', 'e', 'f', 'd', 'e', 'w'};
TestGZIPOutputStream outGZIP = null;
try {
- FileOutputStream outFile = new FileOutputStream("GZIPOutWrite.txt");
+ FileOutputStream outFile = new FileOutputStream(
+ File.createTempFile("GZIPOutCon", ".txt"));
outGZIP = new TestGZIPOutputStream(outFile);
outGZIP.write(byteArray, 0, 10);
// ran JDK and found this CRC32 value is 3097700292