Setting up image test files to be automatically deleted.

This commit is contained in:
Rob Greene 2018-03-02 20:54:19 -06:00
parent 3446cb9024
commit da3f22aa47

View File

@ -2,6 +2,7 @@ package com.webcodepro.applecommander.storage.filters.imagehandlers;
import com.webcodepro.applecommander.storage.filters.imagehandlers.SwtImage;
import java.io.File;
import java.io.FileOutputStream;
import junit.framework.TestCase;
@ -67,6 +68,8 @@ public class SwtImageTest extends TestCase {
image.setPoint(x, y, color);
}
}
image.save(new FileOutputStream("TestImage." + imageType)); //$NON-NLS-1$
File tempImageFile = File.createTempFile("TestImage-", "." + imageType);
tempImageFile.deleteOnExit();
image.save(new FileOutputStream(tempImageFile));
}
}