update test
This commit is contained in:
parent
2127c79354
commit
12322ff46b
|
@ -17,10 +17,9 @@ public class ScreenshotTest {
|
|||
public void takeScreenshotOfMainScreen() throws Exception {
|
||||
Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
|
||||
BufferedImage capture = new Robot().createScreenCapture(screenRect);
|
||||
File imageFile = new File("single-screen.bmp");
|
||||
File imageFile = File.createTempFile("single-screen", "bmp");
|
||||
ImageIO.write(capture, "bmp", imageFile);
|
||||
assertTrue(imageFile.exists());
|
||||
imageFile.delete();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -34,10 +33,9 @@ public class ScreenshotTest {
|
|||
allScreenBounds.height = Math.max(allScreenBounds.height, screenBounds.height);
|
||||
}
|
||||
BufferedImage capture = new Robot().createScreenCapture(allScreenBounds);
|
||||
File imageFile = new File("all-screens.bmp");
|
||||
File imageFile = File.createTempFile("all-screens", "bmp");
|
||||
ImageIO.write(capture, "bmp", imageFile);
|
||||
assertTrue(imageFile.exists());
|
||||
imageFile.delete();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -45,10 +43,9 @@ public class ScreenshotTest {
|
|||
Rectangle componentRect = component.getBounds();
|
||||
BufferedImage bufferedImage = new BufferedImage(componentRect.width, componentRect.height, BufferedImage.TYPE_INT_ARGB);
|
||||
component.paint(bufferedImage.getGraphics());
|
||||
File imageFile = new File("component-screenshot.bmp");
|
||||
File imageFile = File.createTempFile("component-screenshot", "bmp");
|
||||
ImageIO.write(bufferedImage, "bmp", imageFile);
|
||||
assertTrue(imageFile.exists());
|
||||
imageFile.delete();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue