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