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
diff --git a/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java b/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java
index 497b897..f813979 100644
--- a/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java
+++ b/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java
@@ -491,8 +491,9 @@
             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/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java b/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java
index c0a83d2..31974d1 100644
--- a/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java
+++ b/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java
@@ -45,7 +45,8 @@
     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 @@
         // 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 @@
         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 @@
         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/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPOutputStreamTest.java b/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPOutputStreamTest.java
index 298f63a..9b23b56 100644
--- a/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPOutputStreamTest.java
+++ b/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/GZIPOutputStreamTest.java
@@ -57,7 +57,8 @@
     )
     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 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 @@
         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 @@
         // 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 @@
         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