commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ki...@apache.org
Subject [commons-imaging] branch master updated: [IMAGING-155]: cleaning up ImagingTest base class by removing createTempFile method and using the JDK File method instead
Date Sun, 15 Dec 2019 22:43:58 GMT
This is an automated email from the ASF dual-hosted git repository.

kinow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git


The following commit(s) were added to refs/heads/master by this push:
     new 42e8dbf  [IMAGING-155]: cleaning up ImagingTest base class by removing createTempFile
method and using the JDK File method instead
     new f46ae48  Merge pull request #63 from kinow/remove-createtempfile
42e8dbf is described below

commit 42e8dbffd9a1ed7cec4d8713d708aac7e22f9034
Author: Bruno P. Kinoshita <kinow@apache.org>
AuthorDate: Sun Dec 15 11:11:50 2019 +1300

    [IMAGING-155]: cleaning up ImagingTest base class by removing createTempFile method and
using the JDK File method instead
---
 src/test/java/org/apache/commons/imaging/ImagingTest.java   |  9 ---------
 .../commons/imaging/common/bytesource/ByteSourceTest.java   |  2 +-
 .../commons/imaging/formats/bmp/BmpRoundtripTest.java       |  2 +-
 .../commons/imaging/formats/icns/IcnsRoundTripTest.java     |  2 +-
 .../commons/imaging/formats/ico/IcoRoundtripTest.java       |  2 +-
 .../commons/imaging/formats/jpeg/exif/ExifRewriteTest.java  |  8 ++++----
 .../formats/jpeg/exif/WriteExifMetadataExampleTest.java     |  2 +-
 .../commons/imaging/formats/jpeg/iptc/IptcAddTest.java      |  2 +-
 .../commons/imaging/formats/jpeg/iptc/IptcUpdateTest.java   |  6 +++---
 .../imaging/formats/jpeg/xmp/JpegXmpRewriteTest.java        |  6 +++---
 .../commons/imaging/formats/png/ConvertPngToGifTest.java    |  2 +-
 .../imaging/formats/png/PngMultipleRoundtripTest.java       |  2 +-
 .../org/apache/commons/imaging/formats/png/PngTextTest.java |  2 +-
 .../imaging/formats/png/PngWriteForceTrueColorText.java     |  2 +-
 .../commons/imaging/formats/png/PngWriteReadTest.java       |  4 ++--
 .../commons/imaging/formats/tiff/TiffRoundtripTest.java     |  2 +-
 .../apache/commons/imaging/formats/xmp/XmpUpdateTest.java   |  2 +-
 .../imaging/roundtrip/NullParametersRoundtripTest.java      |  2 +-
 .../commons/imaging/roundtrip/PixelDensityRoundtrip.java    |  2 +-
 .../org/apache/commons/imaging/roundtrip/RoundtripBase.java | 13 ++-----------
 20 files changed, 28 insertions(+), 46 deletions(-)

diff --git a/src/test/java/org/apache/commons/imaging/ImagingTest.java b/src/test/java/org/apache/commons/imaging/ImagingTest.java
index 95ffd93..30c1ee7 100644
--- a/src/test/java/org/apache/commons/imaging/ImagingTest.java
+++ b/src/test/java/org/apache/commons/imaging/ImagingTest.java
@@ -26,18 +26,9 @@ import java.util.List;
 
 import org.apache.commons.imaging.internal.Debug;
 import org.apache.commons.imaging.test.util.FileSystemTraversal;
-import org.junit.jupiter.api.io.TempDir;
 
 public abstract class ImagingTest {
 
-    @TempDir
-    public File folder;
-
-    protected File createTempFile(final String prefix, final String suffix)
-            throws IOException {
-        return File.createTempFile(prefix, suffix, folder);
-    }
-
     protected boolean isPhilHarveyTestImage(final File file) {
         return file.getAbsolutePath().startsWith(
                 ImagingTestConstants.PHIL_HARVEY_TEST_IMAGE_FOLDER.getAbsolutePath());
diff --git a/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceTest.java
b/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceTest.java
index fbf0a60..5804364 100644
--- a/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceTest.java
+++ b/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceTest.java
@@ -26,7 +26,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public abstract class ByteSourceTest extends ImagingTest {
     protected File createTempFile(final byte src[]) throws IOException {
-        final File file = createTempFile("raw_", ".bin");
+        final File file = File.createTempFile("raw_", ".bin");
 
         // write test bytes to file.
         try (FileOutputStream fos = new FileOutputStream(file);
diff --git a/src/test/java/org/apache/commons/imaging/formats/bmp/BmpRoundtripTest.java b/src/test/java/org/apache/commons/imaging/formats/bmp/BmpRoundtripTest.java
index 178b6c1..0934f08 100644
--- a/src/test/java/org/apache/commons/imaging/formats/bmp/BmpRoundtripTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/bmp/BmpRoundtripTest.java
@@ -151,7 +151,7 @@ public class BmpRoundtripTest extends BmpBaseTest {
 
         // Debug.debug("bytes", bytes);
 
-        final File tempFile = createTempFile("temp", ".bmp");
+        final File tempFile = File.createTempFile("temp", ".bmp");
         FileUtils.writeByteArrayToFile(tempFile, bytes);
 
         final BufferedImage dstImage = Imaging.getBufferedImage(bytes);
diff --git a/src/test/java/org/apache/commons/imaging/formats/icns/IcnsRoundTripTest.java
b/src/test/java/org/apache/commons/imaging/formats/icns/IcnsRoundTripTest.java
index e3d5156..023ad56 100644
--- a/src/test/java/org/apache/commons/imaging/formats/icns/IcnsRoundTripTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/icns/IcnsRoundTripTest.java
@@ -407,7 +407,7 @@ public class IcnsRoundTripTest extends IcnsBaseTest {
     private void writeAndReadImageData(final String description, final byte[] rawData,
             final int foreground, final int background) throws IOException,
             ImageReadException {
-        final File exportFile = createTempFile(description, ".icns");
+        final File exportFile = File.createTempFile(description, ".icns");
         FileUtils.writeByteArrayToFile(exportFile, rawData);
         final BufferedImage dstImage = Imaging.getBufferedImage(exportFile);
 
diff --git a/src/test/java/org/apache/commons/imaging/formats/ico/IcoRoundtripTest.java b/src/test/java/org/apache/commons/imaging/formats/ico/IcoRoundtripTest.java
index 4a15997..5ad7180 100644
--- a/src/test/java/org/apache/commons/imaging/formats/ico/IcoRoundtripTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/ico/IcoRoundtripTest.java
@@ -537,7 +537,7 @@ public class IcoRoundtripTest extends IcoBaseTest {
         // File exportFile = new File("/tmp/" + description + ".ico");
         // IoUtils.writeToFile(rawData, exportFile);
 
-        final File tempFile = createTempFile("temp", ".ico");
+        final File tempFile = File.createTempFile("temp", ".ico");
         FileUtils.writeByteArrayToFile(tempFile, rawData);
 
         final BufferedImage dstImage = Imaging.getBufferedImage(tempFile);
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriteTest.java
b/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriteTest.java
index 9db9d2a..cc552f9 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriteTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriteTest.java
@@ -84,7 +84,7 @@ public class ExifRewriteTest extends ExifBaseTest {
                 final ByteArrayOutputStream baos = new ByteArrayOutputStream();
                 new ExifRewriter().removeExifMetadata(byteSource, baos);
                 final byte[] bytes = baos.toByteArray();
-                final File tempFile = createTempFile("test", ".jpg");
+                final File tempFile = File.createTempFile("test", ".jpg");
                 Debug.debug("tempFile", tempFile);
                 FileUtils.writeByteArrayToFile(tempFile, bytes);
 
@@ -124,7 +124,7 @@ public class ExifRewriteTest extends ExifBaseTest {
                 final ByteArrayOutputStream baos = new ByteArrayOutputStream();
                 new ExifRewriter().removeExifMetadata(byteSource, baos);
                 final byte[] bytes = baos.toByteArray();
-                final File tempFile = createTempFile("removed", ".jpg");
+                final File tempFile = File.createTempFile("removed", ".jpg");
                 Debug.debug("tempFile", tempFile);
                 FileUtils.writeByteArrayToFile(tempFile, bytes);
 
@@ -145,7 +145,7 @@ public class ExifRewriteTest extends ExifBaseTest {
                         outputSet);
 
                 final byte[] bytes = baos.toByteArray();
-                final File tempFile = createTempFile("inserted" + "_", ".jpg");
+                final File tempFile = File.createTempFile("inserted" + "_", ".jpg");
                 Debug.debug("tempFile", tempFile);
                 FileUtils.writeByteArrayToFile(tempFile, bytes);
 
@@ -214,7 +214,7 @@ public class ExifRewriteTest extends ExifBaseTest {
                 final ByteArrayOutputStream baos = new ByteArrayOutputStream();
                 rewriter.rewrite(byteSource, baos, outputSet);
                 final byte[] bytes = baos.toByteArray();
-                final File tempFile = createTempFile(name + "_", ".jpg");
+                final File tempFile = File.createTempFile(name + "_", ".jpg");
                 Debug.debug("tempFile", tempFile);
                 FileUtils.writeByteArrayToFile(tempFile, bytes);
 
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/WriteExifMetadataExampleTest.java
b/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/WriteExifMetadataExampleTest.java
index e03924d..285fdac 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/WriteExifMetadataExampleTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/WriteExifMetadataExampleTest.java
@@ -46,7 +46,7 @@ public class WriteExifMetadataExampleTest extends ExifBaseTest {
     public void testOddOffsets(File imageFile) throws Exception {
         Debug.debug("imageFile", imageFile.getAbsoluteFile());
 
-        final File tempFile = createTempFile("test", ".jpg");
+        final File tempFile = File.createTempFile("test", ".jpg");
         Debug.debug("tempFile", tempFile.getAbsoluteFile());
 
         try {
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcAddTest.java b/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcAddTest.java
index d53d0d6..3dd0387 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcAddTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcAddTest.java
@@ -80,7 +80,7 @@ public class IptcAddTest extends IptcBaseTest {
 
         final PhotoshopApp13Data newData = new PhotoshopApp13Data(newRecords, newBlocks);
 
-        final File updated = createTempFile(imageFile.getName() + ".iptc.add.", ".jpg");
+        final File updated = File.createTempFile(imageFile.getName() + ".iptc.add.", ".jpg");
         try (FileOutputStream fos = new FileOutputStream(updated);
                 OutputStream os = new BufferedOutputStream(fos)) {
             new JpegIptcRewriter().writeIPTC(byteSource, os, newData);
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcUpdateTest.java
b/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcUpdateTest.java
index 6f92791..8d2adc6 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcUpdateTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcUpdateTest.java
@@ -74,7 +74,7 @@ public class IptcUpdateTest extends IptcBaseTest {
     }
 
     public File removeIptc(final ByteSource byteSource, File imageFile) throws Exception
{
-        final File noIptcFile = createTempFile(imageFile.getName() + ".iptc.remove.", ".jpg");
+        final File noIptcFile = File.createTempFile(imageFile.getName() + ".iptc.remove.",
".jpg");
 
         try (OutputStream os = new BufferedOutputStream(new FileOutputStream(noIptcFile)))
{
             new JpegIptcRewriter().removeIPTC(byteSource, os);
@@ -107,7 +107,7 @@ public class IptcUpdateTest extends IptcBaseTest {
         final PhotoshopApp13Data newData = new PhotoshopApp13Data(newRecords,
                 newBlocks);
 
-        final File updated = createTempFile(imageFile.getName()
+        final File updated = File.createTempFile(imageFile.getName()
                 + ".iptc.insert.", ".jpg");
         try (FileOutputStream fos = new FileOutputStream(updated);
                 OutputStream os = new BufferedOutputStream(fos)) {
@@ -156,7 +156,7 @@ public class IptcUpdateTest extends IptcBaseTest {
     }
 
     public File writeIptc(final ByteSource byteSource, final PhotoshopApp13Data newData,
File imageFile) throws IOException, ImageReadException, ImageWriteException {
-        final File updated = createTempFile(imageFile.getName()
+        final File updated = File.createTempFile(imageFile.getName()
                 + ".iptc.update.", ".jpg");
         try (FileOutputStream fos = new FileOutputStream(updated);
                 OutputStream os = new BufferedOutputStream(fos)) {
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpRewriteTest.java
b/src/test/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpRewriteTest.java
index ff7c6d6..f330ae3 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpRewriteTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpRewriteTest.java
@@ -49,7 +49,7 @@ public class JpegXmpRewriteTest extends JpegXmpBaseTest {
         final String xmpXml = new JpegImageParser().getXmpXml(byteSource, params);
         assertNotNull(xmpXml);
 
-        final File noXmpFile = createTempFile(imageFile.getName() + ".", ".jpg");
+        final File noXmpFile = File.createTempFile(imageFile.getName() + ".", ".jpg");
         {
             // test remove
 
@@ -70,7 +70,7 @@ public class JpegXmpRewriteTest extends JpegXmpBaseTest {
             // test update
 
             final String newXmpXml = "test";
-            final File updated = createTempFile(imageFile.getName() + ".", ".jpg");
+            final File updated = File.createTempFile(imageFile.getName() + ".", ".jpg");
             try (FileOutputStream fos = new FileOutputStream(updated);
                     OutputStream os = new BufferedOutputStream(fos)) {
                 new JpegXmpRewriter().updateXmpXml(byteSource, os, newXmpXml);
@@ -89,7 +89,7 @@ public class JpegXmpRewriteTest extends JpegXmpBaseTest {
             // test insert
 
             final String newXmpXml = "test";
-            final File updated = createTempFile(imageFile.getName() + ".", ".jpg");
+            final File updated = File.createTempFile(imageFile.getName() + ".", ".jpg");
             try (FileOutputStream fos = new FileOutputStream(updated);
                     OutputStream os = new BufferedOutputStream(fos)) {
                 new JpegXmpRewriter().updateXmpXml(new ByteSourceFile(
diff --git a/src/test/java/org/apache/commons/imaging/formats/png/ConvertPngToGifTest.java
b/src/test/java/org/apache/commons/imaging/formats/png/ConvertPngToGifTest.java
index a084da1..aee3468 100644
--- a/src/test/java/org/apache/commons/imaging/formats/png/ConvertPngToGifTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/png/ConvertPngToGifTest.java
@@ -52,7 +52,7 @@ public class ConvertPngToGifTest extends PngBaseTest {
             final BufferedImage image = Imaging.getBufferedImage(imageFile, params);
             assertNotNull(image);
 
-            final File outFile = createTempFile(imageFile.getName() + ".", ".gif");
+            final File outFile = File.createTempFile(imageFile.getName() + ".", ".gif");
             // Debug.debug("outFile", outFile);
 
             Imaging.writeImage(image, outFile, ImageFormats.GIF,
diff --git a/src/test/java/org/apache/commons/imaging/formats/png/PngMultipleRoundtripTest.java
b/src/test/java/org/apache/commons/imaging/formats/png/PngMultipleRoundtripTest.java
index 0ceff76..ab368b4 100644
--- a/src/test/java/org/apache/commons/imaging/formats/png/PngMultipleRoundtripTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/png/PngMultipleRoundtripTest.java
@@ -62,7 +62,7 @@ public class PngMultipleRoundtripTest extends PngBaseTest {
                         readParams);
                 assertNotNull(image);
 
-                final File tempFile = createTempFile(imageFile.getName() + "." + j
+                final File tempFile = File.createTempFile(imageFile.getName() + "." + j
                         + ".", ".png");
                 Debug.debug("tempFile", tempFile);
 
diff --git a/src/test/java/org/apache/commons/imaging/formats/png/PngTextTest.java b/src/test/java/org/apache/commons/imaging/formats/png/PngTextTest.java
index f18e275..2d6d8aa 100644
--- a/src/test/java/org/apache/commons/imaging/formats/png/PngTextTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/png/PngTextTest.java
@@ -71,7 +71,7 @@ public class PngTextTest extends PngBaseTest {
         final byte[] bytes = Imaging.writeImageToBytes(srcImage,
                 ImageFormats.PNG, writeParams);
 
-        final File tempFile = createTempFile("temp", ".png");
+        final File tempFile = File.createTempFile("temp", ".png");
         FileUtils.writeByteArrayToFile(tempFile, bytes);
 
         final PngImageInfo imageInfo = (PngImageInfo) Imaging.getImageInfo(bytes);
diff --git a/src/test/java/org/apache/commons/imaging/formats/png/PngWriteForceTrueColorText.java
b/src/test/java/org/apache/commons/imaging/formats/png/PngWriteForceTrueColorText.java
index f28f822..41c9d35 100644
--- a/src/test/java/org/apache/commons/imaging/formats/png/PngWriteForceTrueColorText.java
+++ b/src/test/java/org/apache/commons/imaging/formats/png/PngWriteForceTrueColorText.java
@@ -53,7 +53,7 @@ public class PngWriteForceTrueColorText extends PngBaseTest {
                         new HashMap<String, Object>());
                 assertNotNull(image);
 
-                final File outFile = createTempFile(imageFile.getName() + ".", ".gif");
+                final File outFile = File.createTempFile(imageFile.getName() + ".", ".gif");
                 // Debug.debug("outFile", outFile);
 
                 final Map<String, Object> params = new HashMap<>();
diff --git a/src/test/java/org/apache/commons/imaging/formats/png/PngWriteReadTest.java b/src/test/java/org/apache/commons/imaging/formats/png/PngWriteReadTest.java
index 0de72bb..57a4aa8 100644
--- a/src/test/java/org/apache/commons/imaging/formats/png/PngWriteReadTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/png/PngWriteReadTest.java
@@ -192,7 +192,7 @@ public class PngWriteReadTest extends ImagingTest {
 
         // Debug.debug("bytes", bytes);
 
-        final File tempFile = createTempFile("temp", ".png");
+        final File tempFile = File.createTempFile("temp", ".png");
         FileUtils.writeByteArrayToFile(tempFile, bytes);
 
         final BufferedImage dstImage = Imaging.getBufferedImage(bytes);
@@ -221,7 +221,7 @@ public class PngWriteReadTest extends ImagingTest {
 
         // Debug.debug("bytes", bytes);
 
-        final File tempFile = createTempFile("temp", ".png");
+        final File tempFile = File.createTempFile("temp", ".png");
         FileUtils.writeByteArrayToFile(tempFile, bytes);
 
         final BufferedImage dstImage = Imaging.getBufferedImage(bytes);
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffRoundtripTest.java
b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffRoundtripTest.java
index 251dccd..f368c61 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffRoundtripTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffRoundtripTest.java
@@ -59,7 +59,7 @@ public class TiffRoundtripTest extends TiffBaseTest {
                     TiffConstants.TIFF_COMPRESSION_DEFLATE_ADOBE
             };
             for (final int compression : compressions) {
-                final File tempFile = createTempFile(imageFile.getName() + "-" + compression
+ ".", ".tif");
+                final File tempFile = File.createTempFile(imageFile.getName() + "-" + compression
+ ".", ".tif");
                 final Map<String, Object> params = new HashMap<>();
                 params.put(ImagingConstants.PARAM_KEY_COMPRESSION, compression);
                 Imaging.writeImage(image, tempFile, ImageFormats.TIFF,
diff --git a/src/test/java/org/apache/commons/imaging/formats/xmp/XmpUpdateTest.java b/src/test/java/org/apache/commons/imaging/formats/xmp/XmpUpdateTest.java
index 41435d7..1acb3e3 100644
--- a/src/test/java/org/apache/commons/imaging/formats/xmp/XmpUpdateTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/xmp/XmpUpdateTest.java
@@ -77,7 +77,7 @@ public class XmpUpdateTest extends ImagingTest {
                 continue;
             }
 
-            final File tempFile = this.createTempFile(imageFile.getName() + ".", "."
+            final File tempFile = File.createTempFile(imageFile.getName() + ".", "."
                     + imageFormat.getExtension());
             final BufferedImage image = Imaging.getBufferedImage(imageFile);
 
diff --git a/src/test/java/org/apache/commons/imaging/roundtrip/NullParametersRoundtripTest.java
b/src/test/java/org/apache/commons/imaging/roundtrip/NullParametersRoundtripTest.java
index 299561d..ed90eee 100644
--- a/src/test/java/org/apache/commons/imaging/roundtrip/NullParametersRoundtripTest.java
+++ b/src/test/java/org/apache/commons/imaging/roundtrip/NullParametersRoundtripTest.java
@@ -37,7 +37,7 @@ public class NullParametersRoundtripTest extends RoundtripBase {
     @MethodSource("data")
     public void testNullParametersRoundtrip(final FormatInfo formatInfo) throws Exception
{
         final BufferedImage testImage = TestImages.createFullColorImage(1, 1);
-        final File temp1 = createTempFile("nullParameters.", "." + formatInfo.format.getExtension());
+        final File temp1 = File.createTempFile("nullParameters.", "." + formatInfo.format.getExtension());
         Imaging.writeImage(testImage, temp1, formatInfo.format, null);
         Imaging.getImageInfo(temp1, null);
         Imaging.getImageSize(temp1, null);
diff --git a/src/test/java/org/apache/commons/imaging/roundtrip/PixelDensityRoundtrip.java
b/src/test/java/org/apache/commons/imaging/roundtrip/PixelDensityRoundtrip.java
index 9032d79..feb5a6a 100644
--- a/src/test/java/org/apache/commons/imaging/roundtrip/PixelDensityRoundtrip.java
+++ b/src/test/java/org/apache/commons/imaging/roundtrip/PixelDensityRoundtrip.java
@@ -44,7 +44,7 @@ public class PixelDensityRoundtrip extends RoundtripBase {
     public void testPixelDensityRoundtrip(final FormatInfo formatInfo) throws Exception {
         final BufferedImage testImage = TestImages.createFullColorImage(2, 2);
 
-        final File temp1 = createTempFile("pixeldensity.", "."
+        final File temp1 = File.createTempFile("pixeldensity.", "."
                 + formatInfo.format.getExtension());
 
         final Map<String, Object> params = new HashMap<>();
diff --git a/src/test/java/org/apache/commons/imaging/roundtrip/RoundtripBase.java b/src/test/java/org/apache/commons/imaging/roundtrip/RoundtripBase.java
index 7511b2f..0f26c49 100644
--- a/src/test/java/org/apache/commons/imaging/roundtrip/RoundtripBase.java
+++ b/src/test/java/org/apache/commons/imaging/roundtrip/RoundtripBase.java
@@ -32,18 +32,14 @@ import org.apache.commons.imaging.Imaging;
 import org.apache.commons.imaging.ImagingConstants;
 import org.apache.commons.imaging.common.RgbBufferedImageFactory;
 import org.apache.commons.imaging.internal.Debug;
-import org.junit.jupiter.api.io.TempDir;
 import org.junit.jupiter.params.provider.Arguments;
 
 public class RoundtripBase {
 
-    @TempDir
-    public File folder;
-
     protected void roundtrip(final FormatInfo formatInfo, final BufferedImage testImage,
                              final String tempPrefix, final boolean imageExact) throws IOException,
             ImageReadException, ImageWriteException {
-        final File temp1 = createTempFile(tempPrefix + ".", "."
+        final File temp1 = File.createTempFile(tempPrefix + ".", "."
                 + formatInfo.format.getExtension());
         Debug.debug("tempFile: " + temp1.getName());
 
@@ -63,7 +59,7 @@ public class RoundtripBase {
         }
 
         if (formatInfo.identicalSecondWrite) {
-            final File temp2 = createTempFile(tempPrefix + ".", "."
+            final File temp2 = File.createTempFile(tempPrefix + ".", "."
                     + formatInfo.format.getExtension());
             // Debug.debug("tempFile: " + tempFile.getName());
             Imaging.writeImage(image2, temp2, formatInfo.format, params);
@@ -72,11 +68,6 @@ public class RoundtripBase {
         }
     }
 
-    protected File createTempFile(final String prefix, final String suffix)
-            throws IOException {
-        return File.createTempFile(prefix, suffix, folder);
-    }
-
     public static Stream<Arguments> createRoundtripArguments(BufferedImage[] images)
{
         return Arrays.stream(images).flatMap(i -> Arrays.stream(FormatInfo.READ_WRITE_FORMATS).map(f
-> Arguments.of(i, f)));
     }


Mime
View raw message