Search in sources :

Example 1 with Jetty9Server

use of com.thoughtworks.go.server.Jetty9Server in project gocd by gocd.

the class GoPlainSocketConnectorTest method setUp.

@Before
public void setUp() {
    SystemEnvironment systemEnvironment = mock(SystemEnvironment.class);
    when(systemEnvironment.getServerPort()).thenReturn(1234);
    when(systemEnvironment.get(SystemEnvironment.RESPONSE_BUFFER_SIZE)).thenReturn(100);
    when(systemEnvironment.get(SystemEnvironment.IDLE_TIMEOUT)).thenReturn(200);
    when(systemEnvironment.getListenHost()).thenReturn("foo");
    when(systemEnvironment.get(SystemEnvironment.GO_SSL_CONFIG_ALLOW)).thenReturn(true);
    when(systemEnvironment.get(SystemEnvironment.GO_SSL_RENEGOTIATION_ALLOWED)).thenReturn(true);
    Jetty9Server server = new Jetty9Server(systemEnvironment, null, mock(SSLSocketFactory.class));
    connector = (ServerConnector) new GoPlainSocketConnector(server, systemEnvironment).getConnector();
    HttpConnectionFactory connectionFactory = (HttpConnectionFactory) connector.getDefaultConnectionFactory();
    configuration = connectionFactory.getHttpConfiguration();
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) Jetty9Server(com.thoughtworks.go.server.Jetty9Server) SSLSocketFactory(javax.net.ssl.SSLSocketFactory) Before(org.junit.Before)

Example 2 with Jetty9Server

use of com.thoughtworks.go.server.Jetty9Server in project gocd by gocd.

the class GoSslSocketConnectorTest method setUp.

@Before
public void setUp() throws Exception {
    keystore = folder.newFile("keystore");
    truststore = folder.newFile("truststore");
    GoSSLConfig cipherSuite = mock(GoSSLConfig.class);
    String[] cipherSuitesToBeIncluded = { "FOO" };
    when(cipherSuite.getCipherSuitesToBeIncluded()).thenReturn(cipherSuitesToBeIncluded);
    SystemEnvironment systemEnvironment = mock(SystemEnvironment.class);
    when(systemEnvironment.getSslServerPort()).thenReturn(1234);
    when(systemEnvironment.keystore()).thenReturn(keystore);
    when(systemEnvironment.truststore()).thenReturn(truststore);
    when(systemEnvironment.get(SystemEnvironment.RESPONSE_BUFFER_SIZE)).thenReturn(100);
    when(systemEnvironment.get(SystemEnvironment.IDLE_TIMEOUT)).thenReturn(200);
    when(systemEnvironment.getListenHost()).thenReturn("foo");
    Jetty9Server jettyServer = mock(Jetty9Server.class);
    when(jettyServer.getServer()).thenReturn(new Server());
    sslSocketConnector = new GoSslSocketConnector(jettyServer, "password", systemEnvironment, cipherSuite);
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) GoSSLConfig(com.thoughtworks.go.server.config.GoSSLConfig) Jetty9Server(com.thoughtworks.go.server.Jetty9Server) Jetty9Server(com.thoughtworks.go.server.Jetty9Server) Before(org.junit.Before)

Aggregations

Jetty9Server (com.thoughtworks.go.server.Jetty9Server)2 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)2 Before (org.junit.Before)2 GoSSLConfig (com.thoughtworks.go.server.config.GoSSLConfig)1 SSLSocketFactory (javax.net.ssl.SSLSocketFactory)1