Example #1
0
  @Test(timeOut = 20000)
  public void testSSLStartup() throws Exception {
    logger.info("Running testSSLStartup");

    SSLConfig cfg = new SSLConfig();
    ClassLoader cl = getClass().getClassLoader();
    URL keystoreUrl = cl.getResource("ssltest-keystore.jks");
    String keyStoreFile = new File(keystoreUrl.toURI()).getAbsolutePath();
    cfg.setKeyStoreFile(keyStoreFile);
    cfg.setKeyPass("changeit");

    URL cacertsUrl = cl.getResource("ssltest-cacerts.jks");
    String trustStoreFile = new File(cacertsUrl.toURI()).getAbsolutePath();
    cfg.setTrustStoreFile(trustStoreFile);
    cfg.setTrustStorePass("changeit");

    AtmosphereSpadeServer sslSpade =
        AtmosphereSpadeServer.build(
            "https://127.0.0.1:" + 7777 + "/", PubSubTest.class.getPackage().getName(), cfg);
    sslSpade.start();
  }
Example #2
0
 public void startServer() throws Exception {
   spade =
       AtmosphereSpadeServer.build(
           "http://127.0.0.1:" + port + "/", PubSubTest.class.getPackage().getName());
   spade.start();
 }