Examples of Sandbox


Examples of edu.cmu.cs.stage3.alice.core.Sandbox

    public Object getValue() {
        UserDefinedQuestion userDefinedQuestionValue = userDefinedQuestion.getUserDefinedQuestionValue();
        Behavior currentBehavior = null;
        World world = getWorld();
        if( world != null ) {
            Sandbox sandbox = world.getCurrentSandbox();
            if( sandbox!=null ) {
                currentBehavior = sandbox.getCurrentBehavior();
            } else {
                //System.err.println( "current sandbox is null" );
            }
        } else {
            //System.err.println( "world is null" );
View Full Code Here

Examples of io.apigee.trireme.core.Sandbox

            if (!options.has("stdio", options)) {
                throw new EvaluatorException("Missing stdio in options");
            }
            Scriptable stdio = (Scriptable)options.get("stdio", options);
            Sandbox scriptSandbox = new Sandbox(parent.runner.getSandbox());

            try {
                createReadableStream(cx, stdio, 0, scriptSandbox);
                createWritableStream(cx, stdio, 1, scriptSandbox);
                createWritableStream(cx, stdio, 2, scriptSandbox);
View Full Code Here

Examples of io.apigee.trireme.core.Sandbox

    @Test
    public void testChroot()
        throws InterruptedException, ExecutionException, NodeException, IOException
    {
        Sandbox sb = new Sandbox();
        sb.setFilesystemRoot("./target/test-classes");
        NodeEnvironment rootEnv = new NodeEnvironment();
        rootEnv.setSandbox(sb);
        NodeScript script = rootEnv.createScript("chroottest.js",
                                             new File("./target/test-classes/tests/chroottest.js"),
                                             null);
View Full Code Here

Examples of io.apigee.trireme.core.Sandbox

    @Test
    public void testChrootScript()
        throws InterruptedException, ExecutionException, NodeException, IOException
    {
        Sandbox sb = new Sandbox();
        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();
View Full Code Here

Examples of io.apigee.trireme.core.Sandbox

    {
        if (Platform.get().isWindows()) {
            System.out.println("Disabled chroot tests on Windows for now");
            return;
        }
        Sandbox sb = new Sandbox();
        sb.setFilesystemRoot("./target");
        sb.setWorkingDirectory("./test-classes");
        NodeEnvironment rootEnv = new NodeEnvironment();
        rootEnv.setSandbox(sb);
        NodeScript script = rootEnv.createScript("chroottest.js",
                                             new File("./target/test-classes/tests/chroottest.js"),
                                             null);
View Full Code Here

Examples of io.apigee.trireme.core.Sandbox

    {
        if (Platform.get().isWindows()) {
            System.out.println("Absolute mounts not yet supported on Windows");
            return;
        }
        Sandbox sb = new Sandbox();
        sb.setFilesystemRoot("./target");
        sb.setWorkingDirectory("/test-classes");
        NodeEnvironment rootEnv = new NodeEnvironment();
        rootEnv.setSandbox(sb);
        NodeScript script = rootEnv.createScript("chroottest.js",
                                             new File("./target/test-classes/tests/chroottest.js"),
                                             null);
View Full Code Here

Examples of io.apigee.trireme.core.Sandbox

    {
        if (Platform.get().isWindows()) {
            System.out.println("Absolute mounts not yet supported on Windows");
            return;
        }
        Sandbox sb = new Sandbox();
        sb.setFilesystemRoot("./target/test-classes");
        NodeEnvironment rootEnv = new NodeEnvironment();
        rootEnv.setSandbox(sb);
        NodeScript script = rootEnv.createScript("chroottest.js",
                                             new File("./target/test-classes/tests/builtinmoduletest.js").getAbsoluteFile(),
                                             null);
View Full Code Here

Examples of io.apigee.trireme.core.Sandbox

    @Test
    public void testChrootModules()
        throws InterruptedException, ExecutionException, NodeException, IOException
    {
        Sandbox sb = new Sandbox();
        sb.setFilesystemRoot("./target/test-classes");
        NodeEnvironment rootEnv = new NodeEnvironment();
        rootEnv.setSandbox(sb);
        NodeScript script = rootEnv.createScript("moduletest.js",
                                             new File("./target/test-classes/tests/moduletest.js"),
                                             null);
View Full Code Here

Examples of io.apigee.trireme.core.Sandbox

    @Test
    public void testHttpPolicy()
        throws InterruptedException, ExecutionException, NodeException, IOException
    {
        NodeEnvironment localEnv = new NodeEnvironment();
        Sandbox sb = new Sandbox();
        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();
View Full Code Here

Examples of io.apigee.trireme.core.Sandbox

    @Test
    public void testHttpPolicyConnect()
        throws InterruptedException, ExecutionException, NodeException, IOException
    {
        NodeEnvironment localEnv = new NodeEnvironment();
        Sandbox sb = new Sandbox();
        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();
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.