예제 #1
0
 public void testSettingNonAWTModeWithNoResolutionUsesHeadlessEnvironmentDefaultResolution()
     throws Exception {
   EnvironmentFactory.setNonAWTMode();
   assertEquals(
       HeadlessEnvironment.DEFAULT_RESOLUTION,
       EnvironmentFactory.getEnvironment().getResolution());
 }
예제 #2
0
 public void testDefaultEnvironmentCanBeOverridden() throws Exception {
   EnvironmentFactory.setDefaultEnvironment(new TestEnvironment());
   assertTrue(EnvironmentFactory.getEnvironment() instanceof TestEnvironment);
   assertEquals(69, EnvironmentFactory.getEnvironment().getResolution());
 }
예제 #3
0
 public void testNonAWTModeAlwaysReturnsNonAWTEnvironment() throws Exception {
   EnvironmentFactory.setNonAWTMode(68);
   assertTrue(EnvironmentFactory.getEnvironment() instanceof NonAWTEnvironment);
 }
예제 #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);
 }