Package io.apigee.trireme.core

Examples of io.apigee.trireme.core.NodeScript.execute()


    {
        NodeScript script = env.createScript(name,
                                             new File("./target/test-classes/testscripts/" + name),
                                             null);
        try {
            ScriptStatus status = script.execute().get();
            assertEquals(0, status.getExitCode());
        } catch (ExecutionException ee) {
            if (ee.getCause() instanceof RhinoException) {
                System.err.println(((RhinoException)ee.getCause()).getScriptStackTrace());
            }
View Full Code Here


        throws NodeException, InterruptedException, ExecutionException
    {
        NodeScript script = env.createScript("hellotest.js",
                                             new File("target/test-classes/hellotest.js"),
                                             null);
        ScriptStatus status = script.execute().get();
        assertEquals(0, status.getExitCode());
        script.close();
    }
}
View Full Code Here

        String cacheDir = new File(npmTests, "cache").getAbsolutePath();
        String npmTestsDir = new File("./target/test-classes/argo").getAbsolutePath();
        NodeScript script = env.createScript("npmoutdated.js",
                                             new File(npmTests, "npmoutdated.js"),
                                             new String[] { npmTestsDir, cacheDir });
        ScriptFuture future = script.execute();
        ScriptStatus status = future.get();
        assertTrue(status.isOk());
    }

    @Test
View Full Code Here

        String cacheDir = new File(npmTests, "cache").getAbsolutePath();
        String npmTestsDir = new File(npmTests, "apitest").getAbsolutePath();
        NodeScript script = env.createScript("npmupdate.js",
                                             new File(npmTests, "npmupdate.js"),
                                             new String[] { npmTestsDir, cacheDir });
        ScriptFuture future = script.execute();
        ScriptStatus status = future.get();
        assertTrue(status.isOk());
    }

    @Test
View Full Code Here

        String cacheDir = new File(npmTests, "cache").getAbsolutePath();
        String npmTestsDir = new File(npmTests, "apitest").getAbsolutePath();
        NodeScript script = env.createScript("npmupdate.js",
                                             new File(npmTests, "npmupdate.js"),
                                             new String[] { npmTestsDir, cacheDir });
        ScriptFuture future = script.execute();
        ScriptStatus status = future.get();
        assertTrue(status.isOk());
    }
}
View Full Code Here

        throws NodeException, InterruptedException, IOException
    {
        long before = getMemoryUsed();
        NodeEnvironment env = new NodeEnvironment();
        NodeScript script = env.createScript("server.js", new File("./target/test-classes/dogs/server.js"), null);
        ScriptFuture scriptFuture = script.execute();
        Utils.awaitPortOpen(PORT);
        long after = getMemoryUsed();
        System.out.println("Added " + (after - before) + " bytes after starting one script");
        scriptFuture.cancel(true);
    }
View Full Code Here

        System.out.print("Starting...");
        int p = PORT + 1;
        for (int i = 0; i < NUMSCRIPTS; i++) {
            NodeScript script = env.createScript("server.js", new File("./target/test-classes/dogs/server.js"),
                                                 new String[] { String.valueOf(p) });
            futures.add(script.execute());
            p++;
            System.out.print(i + " ");
            System.out.flush();
        }
        System.out.println();
View Full Code Here

        System.out.print("Starting with cache...");
        int p = PORT + 1;
        for (int i = 0; i < NUMSCRIPTS; i++) {
            NodeScript script = env.createScript("server.js", new File("./target/test-classes/dogs/server.js"),
                                                 new String[] { String.valueOf(p) });
            futures.add(script.execute());
            p++;
            System.out.print(i + " ");
            System.out.flush();
        }
        System.out.println();
View Full Code Here

        }
        // Use separate ports between netty and non-netty because netty might take a while to close them
        int port = PORT + (useNetty ? 1 : 0);
        NodeScript script = env.createScript("server.js", new File("./target/test-classes/argo/server.js"),
                                             new String[] { String.valueOf(port) });
        ScriptFuture scriptFuture = script.execute();
        System.out.println("Waiting for the port to open. useNetty = " + useNetty);
        Utils.awaitPortOpen(port);

        System.out.println("Port " + port + " is open");
        Utils.getString(BASEURL + port + "/forecastrss?p=08904", 200);
View Full Code Here

        NodeScript ns =
            env.createScript("consolelogtest.js", new File("./target/test-classes/tests/consolelogtest.js"),
                             new String[] { "stdout", msg });

        try {
            ScriptFuture f = ns.execute();
            ScriptStatus result = f.get(SCRIPT_TIMEOUT_SECS, TimeUnit.SECONDS);
            assertEquals(0, result.getExitCode());

            String stream = new String(out.toByteArray(), UTF8);
            assertEquals(msg + '\n', stream);
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.