fix #3 enable to set SSLContext as an option

This commit is contained in:
Naoyuki Kanezawa
2014-07-07 22:41:59 +09:00
parent b1e43ba1b2
commit fe2fd4413a
13 changed files with 208 additions and 36 deletions

View File

@@ -24,7 +24,7 @@ public abstract class Connection {
final CountDownLatch latch = new CountDownLatch(1);
serverProcess = Runtime.getRuntime().exec(
"node src/test/resources/index.js " + PORT, new String[] {"DEBUG=engine*"});
"node src/test/resources/server.js", createEnv());
serverService = Executors.newCachedThreadPool();
serverOutout = serverService.submit(new Runnable() {
@Override
@@ -70,4 +70,14 @@ public abstract class Connection {
serverService.shutdown();
serverService.awaitTermination(3000, TimeUnit.MILLISECONDS);
}
Socket.Options createOptions() {
Socket.Options opts = new Socket.Options();
opts.port = PORT;
return opts;
}
String[] createEnv() {
return new String[] {"DEBUG=engine*", "PORT=" + PORT};
}
}