Пример #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);
 }