Package com.sun.net.httpserver

Examples of com.sun.net.httpserver.HttpServer.stop()


      super.getLog().info( "Local ClashInspector-Server running on port "+port+". To stop server press enter." );


      String inLine = in.readLine();
      server.stop( 0 );


    }
    catch ( Exception e ) {
      throw new MojoFailureException( e.getMessage(), e );
View Full Code Here


      super.getLog().info( "Local ClashInspector-Server running on port "+port+". To stop server press enter." );


      String inLine = in.readLine();
      server.stop( 0 );


    }
    catch ( Exception e ) {
      throw new MojoFailureException( e.getMessage(), e );
View Full Code Here

    HttpServer server = startServer();

    System.out.println("Application started.\n" + "Try accessing " + getBaseURI() + "beanparam in the browser.\n" + "Hit enter to stop the application...");
    System.in.read();
    server.stop(0);
  }

  private static int getPort(int defaultPort) {
    final String port = System.getProperty("jersey.config.test.container.port");
    if (null != port) {
View Full Code Here

        // Hook to allow for graceful exit
        final Closeable c = new Closeable() {
            public void close() throws IOException {
                PollScheduler.getInstance().stop();
                server.stop(5);
            }
        };
        server.createContext("/exit", new ExitHandler(c));

        // Bind and start server
View Full Code Here

            result = getCompilerTask(Arrays.asList("-out", destDir, "-rep", repoAURL, "-verbose:cmr", "-cp", getClassPathAsPath()),
                    "modules/depend/b/module.ceylon", "modules/depend/b/package.ceylon", "modules/depend/b/a.ceylon", "modules/depend/b/B.ceylon").call();
            Assert.assertEquals(Boolean.TRUE, result);

        }finally{
            server.stop(1);
        }
        carFile = getModuleArchive("com.redhat.ceylon.compiler.java.test.cmr.modules.depend.b", "6.6.6");
        assertTrue(carFile.exists());
       
        // make sure it cached the module in the cache repo
View Full Code Here

            // then try to compile our module by outputting to HTTP
            Boolean result = getCompilerTask(Arrays.asList("-out", repoAURL, "-verbose:cmr"), "modules/single/module.ceylon").call();
            Assert.assertEquals(Boolean.TRUE, result);

        }finally{
            server.stop(1);
        }
       
        File carFile = getModuleArchive("com.redhat.ceylon.compiler.java.test.cmr.modules.single", "6.6.6", repo.getPath());
        assertTrue(carFile.exists());
View Full Code Here

            Assert.assertEquals(Boolean.TRUE, result);
            result = getCompilerTask(Arrays.asList("-out", repoAURL, "-verbose:cmr"), "modules/mixed/CeylonClass.ceylon").call();
            Assert.assertEquals(Boolean.TRUE, result);

        }finally{
            server.stop(1);
        }

        File carFile = getModuleArchive("com.redhat.ceylon.compiler.java.test.cmr.modules.mixed", "6.6.6", repo.getPath());
        assertTrue(carFile.exists());
View Full Code Here

       
        try {
            String repoUrl = "http://localhost:" + stubServer.getAddress().getPort() + "/repo";
            externalLinks(repoUrl, "file://not-existing-dir", "https://not-existing-url", repoUrl);
        } finally {
            stubServer.stop(0);
        }
    }   
   
    private File externalLinks(String repoUrl, String... linkArgs) throws Exception {
        compile("test/ceylondoc", "com.redhat.ceylon.ceylondoc.test.modules.dependency.b");
View Full Code Here

        System.out.println("Application started.\n" +
                "Try accessing " + getBaseURI() + "helloworld in the browser.\n" +
                "Hit enter to stop the application...");
        System.in.read();
        server.stop(0);
    }

    private static int getPort(int defaultPort) {
        final String port = System.getProperty("jersey.config.test.container.port");
        if (null != port) {
View Full Code Here

    } catch (LivelinkException expected) {
      assertNotNull(expected.toString(), expected.getCause());
      assertTrue(expected.getCause().toString(),
          expected.getCause() instanceof SocketTimeoutException);
    } finally {
      server.stop(0);
    }
  }

  /**
   * In practice, this timeout exception will be caught in the
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.