Package io.apigee.trireme.core

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


        rootEnv.setScriptTimeLimit(1, TimeUnit.SECONDS);
        NodeScript script = rootEnv.createScript("endlesscpu.js",
                                             new File("./target/test-classes/tests/endlesscpu.js"),
                                             null);
        try {
            script.execute().get();
            assertFalse("Expected a time out exception", true);
        } catch (ExecutionException ee) {
            assertTrue("Expected a JavaScriptException", ee.getCause() instanceof JavaScriptException);
        }
    }
View Full Code Here


        NodeEnvironment rootEnv = new NodeEnvironment();
        rootEnv.setSandbox(sb);
        NodeScript script = rootEnv.createScript("chroottest.js",
                                             new File("./target/test-classes/tests/chroottest.js"),
                                             null);
        ScriptStatus stat = script.execute().get();
        assertEquals(0, stat.getExitCode());
    }

    @Test
    public void testChrootScript()
View Full Code Here

        sb.setFilesystemRoot("./target/test-classes");
        NodeScript script = env.createScript("chroottest.js",
                                             new File("./target/test-classes/tests/chroottest.js"),
                                             null);
        script.setSandbox(sb);
        ScriptStatus stat = script.execute().get();
        assertEquals(0, stat.getExitCode());
    }

    @Test
    public void testChrootAndChdir()
View Full Code Here

        NodeEnvironment rootEnv = new NodeEnvironment();
        rootEnv.setSandbox(sb);
        NodeScript script = rootEnv.createScript("chroottest.js",
                                             new File("./target/test-classes/tests/chroottest.js"),
                                             null);
        ScriptStatus stat = script.execute().get();
        assertEquals(0, stat.getExitCode());
    }

    @Test
    public void testChrootAndChdirAbsolute()
View Full Code Here

        NodeEnvironment rootEnv = new NodeEnvironment();
        rootEnv.setSandbox(sb);
        NodeScript script = rootEnv.createScript("chroottest.js",
                                             new File("./target/test-classes/tests/chroottest.js"),
                                             null);
        ScriptStatus stat = script.execute().get();
        assertEquals(0, stat.getExitCode());
    }

    @Test
    public void testChrootAbsolutePath()
View Full Code Here

        NodeEnvironment rootEnv = new NodeEnvironment();
        rootEnv.setSandbox(sb);
        NodeScript script = rootEnv.createScript("chroottest.js",
                                             new File("./target/test-classes/tests/builtinmoduletest.js").getAbsoluteFile(),
                                             null);
        ScriptStatus stat = script.execute().get();
        assertEquals(0, stat.getExitCode());
    }

    @Test
    public void testChrootModules()
View Full Code Here

        NodeEnvironment rootEnv = new NodeEnvironment();
        rootEnv.setSandbox(sb);
        NodeScript script = rootEnv.createScript("moduletest.js",
                                             new File("./target/test-classes/tests/moduletest.js"),
                                             null);
        ScriptStatus stat = script.execute().get();
        assertEquals(0, stat.getExitCode());
    }

    @Test
    public void testBasicHttp()
View Full Code Here

        sb.setNetworkPolicy(new RejectInPolicy());
        localEnv.setSandbox(sb);
        NodeScript script = localEnv.createScript("httppolicylisten.js",
                                             new File("./target/test-classes/tests/httppolicylisten.js"),
                                             null);
        ScriptStatus status = script.execute().get();
        assertEquals(0, status.getExitCode());
    }

    @Test
    public void testHttpPolicyConnect()
View Full Code Here

        sb.setNetworkPolicy(new RejectOutPolicy());
        localEnv.setSandbox(sb);
        NodeScript script = localEnv.createScript("httppolicyconnect.js",
                                             new File("./target/test-classes/tests/httppolicyconnect.js"),
                                             null);
        ScriptStatus status = script.execute().get();
        assertEquals(0, status.getExitCode());
    }

    @Test
    public void testJavaCode()
View Full Code Here

    {
        NodeScript script = env.createScript("spawntest.js",
                                             new File("./target/test-classes/tests/spawntest.js"),
                                             new String[] { "success" });

        ScriptStatus status = script.execute().get();
        assertEquals(0, status.getExitCode());
    }

    @Test
    public void testSpawnBlocked()
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.