Exemplo n.º 1
0
 public void testSettingNonAWTModeWithNoResolutionUsesHeadlessEnvironmentDefaultResolution()
     throws Exception {
   EnvironmentFactory.setNonAWTMode();
   assertEquals(
       HeadlessEnvironment.DEFAULT_RESOLUTION,
       EnvironmentFactory.getEnvironment().getResolution());
 }
Exemplo n.º 2
0
 public void testDefaultEnvironmentCanBeOverridden() throws Exception {
   EnvironmentFactory.setDefaultEnvironment(new TestEnvironment());
   assertTrue(EnvironmentFactory.getEnvironment() instanceof TestEnvironment);
   assertEquals(69, EnvironmentFactory.getEnvironment().getResolution());
 }
Exemplo n.º 3
0
 public void testNonAWTModeAlwaysReturnsNonAWTEnvironment() throws Exception {
   EnvironmentFactory.setNonAWTMode(68);
   assertTrue(EnvironmentFactory.getEnvironment() instanceof NonAWTEnvironment);
 }
Exemplo n.º 4
0
 public void testHeadlessEnvironmentReturnedOnHeadlessMachine() throws Exception {
   EnvironmentFactory.setDefaultEnvironment(new UnsupportedEnvironment());
   assertTrue(EnvironmentFactory.getEnvironment() instanceof HeadlessEnvironment);
   EnvironmentFactory.setDefaultEnvironment(new ErrorEnvironment());
   assertTrue(EnvironmentFactory.getEnvironment() instanceof HeadlessEnvironment);
 }