Пример #1
0
 public void testDefaultEnvironmentCanBeOverridden() throws Exception {
   EnvironmentFactory.setDefaultEnvironment(new TestEnvironment());
   assertTrue(EnvironmentFactory.getEnvironment() instanceof TestEnvironment);
   assertEquals(69, EnvironmentFactory.getEnvironment().getResolution());
 }
Пример #2
0
 public void testHeadlessEnvironmentReturnedOnHeadlessMachine() throws Exception {
   EnvironmentFactory.setDefaultEnvironment(new UnsupportedEnvironment());
   assertTrue(EnvironmentFactory.getEnvironment() instanceof HeadlessEnvironment);
   EnvironmentFactory.setDefaultEnvironment(new ErrorEnvironment());
   assertTrue(EnvironmentFactory.getEnvironment() instanceof HeadlessEnvironment);
 }