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