Examples of baseUrl()


Examples of com.webobjects.appserver.WOComponent.baseURL()

              framework = (String) _framework.valueInComponent(wocomponent);
            }
            scriptName = srcFromBindings;
            src = wocontext._urlForResourceNamed(srcFromBindings, framework, true);
            if(src == null) {
              src = wocomponent.baseURL() + "/" + srcFromBindings;
            }
            else if (ERXResourceManager._shouldGenerateCompleteResourceURL(wocontext)) {
              src = ERXResourceManager._completeURLForResource(src, null, wocontext);
            }
          } else {
View Full Code Here

Examples of restx.server.WebServer.baseUrl()

    public RunningServer start() throws Exception {
        System.setProperty("restx.mode", RestxContext.Modes.INFINIREST);
        WebServer server = webServerSupplier.newWebServer(port);
        server.start();
        RestxSpecLoader specLoader = new RestxSpecLoader(factory);
        RestxSpecRunner runner = new RestxSpecRunner(specLoader, routerPath, server.getServerId(), server.baseUrl(), factory);
        RestxSpecRepository repository = new HotReloadRestxSpecRepository(specLoader);

        final RunningServer runningServer = new RunningServer(
                server, runner, repository,
                factory.getComponent(UUIDGenerator.class),
View Full Code Here

Examples of restx.server.WebServer.baseUrl()

    @Test
    public void should_use_spec() throws Exception {
        WebServer server = SpecsServer.getServer(WebServers.findAvailablePort(), "/api", ".");
        server.start();
        try {
            HttpRequest httpRequest = HttpRequest.get(server.baseUrl() + "/api/message?who=xavier");

            assertThat(httpRequest.code()).isEqualTo(200);
            assertThat(httpRequest.body().trim()).isEqualTo("{\"message\":\"hello xavier, it's 14:33:18\"}");
        } finally {
            server.stop();
View Full Code Here

Examples of restx.server.simple.simple.SimpleWebServer.baseUrl()

            System.setProperty("restx.factory.load", "onrequest");
            final SimpleWebServer webServer = SimpleWebServer.builder()
                    .setRouterPath(routerPath).setAppBase(".").setPort(port).build();
            webServer.start();
            String uri = webServer.baseUrl() + routerPath;
            shell.printIn("SPECS SERVER READY on " + uri + "/\n", RestxShell.AnsiCodes.ANSI_GREEN);
            shell.println("type `stop` to stop the server, `help` to get help on available commands");

            shell.getConsoleReader().setPrompt("spec-server> ");
            shell.getConsoleReader().addCompleter(new StringsCompleter("stop", "open", "help"));
View Full Code Here

Examples of restx.server.simple.simple.SimpleWebServer.baseUrl()

        try {
            SimpleWebServer server = SimpleWebServer.builder()
                    .setRouterPath("/api").setPort(WebServers.findAvailablePort()).build();
            server.start();
            try {
                HttpTestClient client = HttpTestClient.withBaseUrl(server.baseUrl());
                HttpRequest httpRequest = client.GET("/api/autostartable/test");
                assertThat(httpRequest.code()).isEqualTo(200);
                assertThat(httpRequest.body().trim()).isEqualTo(
                        "called: 1 - autostartable: called: 1 started: 1 closed: 0 instanciated: 1" +
                                " serverId: "+server.getServerId()+" baseUrl: "+server.baseUrl()+" routerPresent: true");
View Full Code Here

Examples of restx.server.simple.simple.SimpleWebServer.baseUrl()

                HttpTestClient client = HttpTestClient.withBaseUrl(server.baseUrl());
                HttpRequest httpRequest = client.GET("/api/autostartable/test");
                assertThat(httpRequest.code()).isEqualTo(200);
                assertThat(httpRequest.body().trim()).isEqualTo(
                        "called: 1 - autostartable: called: 1 started: 1 closed: 0 instanciated: 1" +
                                " serverId: "+server.getServerId()+" baseUrl: "+server.baseUrl()+" routerPresent: true");

                httpRequest = client.GET("/api/autostartable/test");
                assertThat(httpRequest.code()).isEqualTo(200);
                // called should be only one in test mode, components are dropped at each request
                // but autostartable should be reused
View Full Code Here

Examples of restx.server.simple.simple.SimpleWebServer.baseUrl()

                assertThat(httpRequest.code()).isEqualTo(200);
                // called should be only one in test mode, components are dropped at each request
                // but autostartable should be reused
                assertThat(httpRequest.body().trim()).isEqualTo(
                        "called: 1 - autostartable: called: 2 started: 1 closed: 0 instanciated: 1" +
                                " serverId: "+server.getServerId()+" baseUrl: "+server.baseUrl()+" routerPresent: true");
            } finally {
                server.stop();
            }
        } finally {
            Factory.LocalMachines.threadLocal().clear();
View Full Code Here

Examples of restx.server.simple.simple.SimpleWebServer.baseUrl()

                        .build())
                .build())
                .setRouterPath("/api").setPort(WebServers.findAvailablePort()).build();
        server.start();
        try {
            HttpRequest httpRequest = HttpRequest.get(server.baseUrl() + "/api/route1/xavier");
            assertThat(httpRequest.code()).isEqualTo(200);
            assertThat(httpRequest.body().trim()).isEqualTo("{\"id\":\"xavier\"}");

            httpRequest = HttpRequest.put(server.baseUrl() + "/api/route4").send("{\"test\":\"val1\"}");
            assertThat(httpRequest.code()).isEqualTo(200);
View Full Code Here

Examples of restx.server.simple.simple.SimpleWebServer.baseUrl()

        try {
            HttpRequest httpRequest = HttpRequest.get(server.baseUrl() + "/api/route1/xavier");
            assertThat(httpRequest.code()).isEqualTo(200);
            assertThat(httpRequest.body().trim()).isEqualTo("{\"id\":\"xavier\"}");

            httpRequest = HttpRequest.put(server.baseUrl() + "/api/route4").send("{\"test\":\"val1\"}");
            assertThat(httpRequest.code()).isEqualTo(200);
            assertThat(httpRequest.body().trim()).isEqualTo("{\"test\":\"val1\",\"size\":1}");
        } finally {
            server.stop();
        }
View Full Code Here

Examples of restx.server.simple.simple.SimpleWebServer.baseUrl()

                .addRouter(FSRouter.mount("src/test/resources").readonly().on("/test"))
                .build())
                .setRouterPath("/api").setPort(WebServers.findAvailablePort()).build();
        server.start();
        try {
            HttpRequest httpRequest = HttpRequest.get(server.baseUrl() + "/api/test/test.txt");
            assertThat(httpRequest.code()).isEqualTo(200);
            assertThat(httpRequest.contentType()).isEqualTo("text/plain; charset=UTF-8");
            assertThat(httpRequest.body().trim()).isEqualTo("hello");

            httpRequest = HttpRequest.put(server.baseUrl() + "/api/test/test.txt").send("bonjour");
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.