use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.
the class GoLauncher method main.
public static void main(String[] args) throws Exception {
assertVMVersion();
SystemEnvironment systemEnvironment = new SystemEnvironment();
systemEnvironment.setProperty(GoConstants.USE_COMPRESSED_JAVASCRIPT, Boolean.toString(true));
LogConfigurator logConfigurator = new LogConfigurator(DEFAULT_LOGBACK_CONFIGURATION_FILE);
logConfigurator.initialize();
try {
cleanupTempFiles();
new GoServer().go();
} catch (Exception e) {
System.err.println("ERROR: Failed to start Go server. Please check the logs.");
e.printStackTrace();
System.exit(1);
}
}
use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.
the class GoServerTest method shouldRegisterSubprocessLoggerAsExit.
@Test
public void shouldRegisterSubprocessLoggerAsExit() throws Exception {
SystemEnvironment systemEnvironment = mock(SystemEnvironment.class);
Validation validation = mock(Validation.class);
when(validation.isSuccessful()).thenReturn(true);
StubGoServer goServer = new StubGoServer(systemEnvironment, validation);
goServer.subprocessLogger = mock(SubprocessLogger.class);
goServer.go();
verify(goServer.subprocessLogger).registerAsExitHook("Following processes were alive at shutdown: ");
}
use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.
the class GoServerTest method setUp.
@Before
public void setUp() throws Exception {
systemEnvironment = new SystemEnvironment();
systemEnvironment.set(SystemEnvironment.APP_SERVER, AppServerStub.class.getCanonicalName());
}
use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.
the class GoServerTest method shouldNotStartServerIfValidationFails.
@Test
public void shouldNotStartServerIfValidationFails() throws Exception {
final SystemEnvironment systemEnvironment = context.mock(SystemEnvironment.class);
Validation validation = new Validation().addError(new Exception("Server Port occupied"));
StubGoServer goServer = new StubGoServer(systemEnvironment, validation);
goServer.go();
assertThat(goServer.wasStarted(), is(false));
}
use of com.thoughtworks.go.util.SystemEnvironment in project gocd by gocd.
the class ArtifactsControllerTest method setUp.
@Before
public void setUp() {
consoleActivityMonitor = mock(ConsoleActivityMonitor.class);
restfulService = mock(RestfulService.class);
artifactService = mock(ArtifactsService.class);
consoleService = mock(ConsoleService.class);
jobInstanceDao = mock(JobInstanceDao.class);
systemEnvironment = mock(SystemEnvironment.class);
artifactsController = new ArtifactsController(artifactService, restfulService, mock(ZipArtifactCache.class), jobInstanceDao, consoleActivityMonitor, consoleService, systemEnvironment);
request = new MockHttpServletRequest();
}
Aggregations