Package py4j

Examples of py4j.GatewayServer


    public void testPy4JentryPoint() throws Exception {
        setupGeogig();
        setupFeatures();
        String repoFolder = platform.pwd().getAbsolutePath();
        GeogigPy4JEntryPoint py4j = new GeogigPy4JEntryPoint();
        GatewayServer gatewayServer = new GatewayServer(py4j);
        gatewayServer.start();
        py4j.runCommand(repoFolder, new String[] { "init" });
        py4j.runCommand(repoFolder, "config user.name name".split(" "));
        py4j.runCommand(repoFolder, "config user.email email@email.com".split(" "));
        insert(points1);
        insert(points2);
        insert(points3);
        geogigCLI.getGeogig().command(AddOp.class).call();
        geogigCLI.getGeogig().command(CommitOp.class).setMessage("message").call();
        py4j.runCommand(repoFolder, new String[] { "log" });
        String output = py4j.nextOutputPage();
        assertTrue(output.contains("message"));
        assertTrue(output.contains("name"));
        assertTrue(output.contains("email@email.com"));
        insert(points1_modified);
        py4j.runCommand(repoFolder, new String[] { "add" });
        py4j.runCommand(repoFolder, new String[] { "commit", "-m", "a commit message" });
        py4j.runCommand(repoFolder, new String[] { "log" });
        output = py4j.nextOutputPage();
        System.out.println(output);
        assertTrue(output.contains("a commit message"));

        gatewayServer.shutdown();
    }
View Full Code Here


            } catch (NumberFormatException e) {
                System.out.println("Wrong argument: " + args[0] + "\nUsage: geogig-gateway [port]");
                return;
            }
        }
        GatewayServer gatewayServer = new GatewayServer(new GeogigPy4JEntryPoint(), port);
        gatewayServer.start();
        System.out.println("GeoGig server correctly started and waiting for conections at port "
                + Integer.toString(port));
    }
View Full Code Here

TOP

Related Classes of py4j.GatewayServer

Copyright © 2018 www.massapicom. 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.