Exemplo n.º 1
0
  @Test
  public void testIsValidScreenSize() {
    final Dimension currentSize = HelperScreen.getCurrentScreenSize();

    assertTrue(HelperScreen.isValidScreenSize(currentSize));
    assertTrue(
        HelperScreen.isValidScreenSize(
            new Dimension(currentSize.width - 10, currentSize.height - 10)));
    assertFalse(
        HelperScreen.isValidScreenSize(
            new Dimension(currentSize.width + 10, currentSize.height + 10)));
    assertTrue(
        HelperScreen.isValidScreenSize(new Dimension(currentSize.width, currentSize.height - 10)));
    assertFalse(
        HelperScreen.isValidScreenSize(new Dimension(currentSize.width, currentSize.height + 10)));
    assertTrue(
        HelperScreen.isValidScreenSize(new Dimension(currentSize.width - 10, currentSize.height)));
    assertFalse(
        HelperScreen.isValidScreenSize(new Dimension(currentSize.width + 10, currentSize.height)));

    try {
      HelperScreen.isValidScreenSize(null);
      fail("minSize is null"); // $NON-NLS-1$
    } catch (RuntimeExceptionIsNull ex) {
      // nothing to do
    } catch (Exception ex) {
      fail(ex.getMessage());
    }
  }
Exemplo n.º 2
0
 @Test
 public void testGetCurrentScreenResolution() {
   //		System.err.println(HelperScreen.getCurrentScreenResolution());
   assertEquals(
       Toolkit.getDefaultToolkit().getScreenResolution(),
       HelperScreen.getCurrentScreenResolution());
 }
Exemplo n.º 3
0
 @Test
 public void testGetCurrentColorModel() {
   //		System.err.println(HelperScreen.getCurrentColorModel());
   assertEquals(Toolkit.getDefaultToolkit().getColorModel(), HelperScreen.getCurrentColorModel());
 }
Exemplo n.º 4
0
 @Test
 public void testGetCurrentScreenSize() {
   assertEquals(Toolkit.getDefaultToolkit().getScreenSize(), HelperScreen.getCurrentScreenSize());
 }