Package org.geoserver.script.wps

Examples of org.geoserver.script.wps.ScriptProcessFactory$CollectProcessNames


    public String getProcessName() {
        return "raw";
    }

    public void testName() throws Exception {
        ScriptProcessFactory pf = new ScriptProcessFactory(scriptMgr);
        assertEquals(1, pf.getNames().size());

        Name name = pf.getNames().iterator().next();
        assertEquals("raw", name.getLocalPart());
    }
View Full Code Here


        Name name = pf.getNames().iterator().next();
        assertEquals("raw", name.getLocalPart());
    }

    public void testProcessDescription() throws Exception {
        ScriptProcessFactory pf = new ScriptProcessFactory(scriptMgr);
        Name raw = pf.getNames().iterator().next();

        // check inputs
        Map<String, Parameter<?>> inputs = pf.getParameterInfo(raw);
        assertNotNull(inputs);
        assertEquals(2, inputs.size());

        Parameter<?> param = checkParameter(inputs, "input", RawData.class, "The raw data input", 1, 1);
        assertEquals("application/json,text/xml", param.metadata.get("mimeTypes"));
        checkParameter(inputs, "outputMimeType", String.class, "The user chosen output mime type", 0, 1);
       
        // check outputs
        Map<String, Parameter<?>> resultInfo = pf.getResultInfo(raw, null);
        assertEquals(1, resultInfo.size());
        param = checkParameter(resultInfo, "result", RawData.class, "The output", 1, 1);
        assertEquals("application/json,text/xml", param.metadata.get("mimeTypes"));
        assertEquals("outputMimeType", param.metadata.get("chosenMimeType"));
    }
View Full Code Here

    public String getProcessName() {
        return "buffer-ex";
    }

    public void testName() throws Exception {
        ScriptProcessFactory pf = new ScriptProcessFactory(scriptMgr);
        assertEquals(1, pf.getNames().size());

        Name name = pf.getNames().iterator().next();
        assertEquals("buffer-ex", name.getLocalPart());
    }
View Full Code Here

        Name name = pf.getNames().iterator().next();
        assertEquals("buffer-ex", name.getLocalPart());
    }

    public void testInputs() throws Exception {
        ScriptProcessFactory pf = new ScriptProcessFactory(scriptMgr);
        Name buffer = pf.getNames().iterator().next();

        Map<String, Parameter<?>> inputs = pf.getParameterInfo(buffer);
        assertNotNull(inputs);
        assertEquals(4, inputs.size());

        checkParameter(inputs, "geom", Geometry.class, "The geometry to buffer", 1, 1);
        checkParameter(inputs, "distance", Number.class, "The buffer distance", 1, 1);
View Full Code Here

    public String getProcessName() {
        return "buffer-monitor";
    }

    public void testName() throws Exception {
        ScriptProcessFactory pf = new ScriptProcessFactory(scriptMgr);
        assertEquals(1, pf.getNames().size());

        Name name = pf.getNames().iterator().next();
        assertEquals("buffer-monitor", name.getLocalPart());
    }
View Full Code Here

        Name name = pf.getNames().iterator().next();
        assertEquals("buffer-monitor", name.getLocalPart());
    }

    public void testInputs() throws Exception {
        ScriptProcessFactory pf = new ScriptProcessFactory(scriptMgr);
        Name buffer = pf.getNames().iterator().next();

        Map<String, Parameter<?>> inputs = pf.getParameterInfo(buffer);
        assertNotNull(inputs);
        assertEquals(2, inputs.size());

        checkParameter(inputs, "geom", Geometry.class, "The geometry to buffer", 1, 1);
        checkParameter(inputs, "distance", Number.class, "The buffer distance", 1, 1);
View Full Code Here

        return param;

    }

    public void testRun() throws Exception {
        ScriptProcessFactory pf = new ScriptProcessFactory(scriptMgr);
        Name name = pf.getNames().iterator().next();
        assertEquals(getNamespace(), name.getNamespaceURI());
        assertEquals(getProcessName(), name.getLocalPart());

        org.geotools.process.Process p = pf.create(name);

        Geometry g = new WKTReader().read("POINT(0 0)");

        Map inputs = new HashMap();
        inputs.put("geom", g);
View Full Code Here

        assertEquals("The task", listener.getTask().toString());
        assertEquals(10f, listener.getProgress());
    }

    public void testException() throws Exception {
        ScriptProcessFactory pf = new ScriptProcessFactory(scriptMgr);
        Name name = pf.getNames().iterator().next();
        assertEquals(getNamespace(), name.getNamespaceURI());
        assertEquals(getProcessName(), name.getLocalPart());

        org.geotools.process.Process p = pf.create(name);

        Geometry g = new WKTReader().read("POINT(0 0)");

        Map inputs = new HashMap();
        inputs.put("geom", g);
View Full Code Here

    }

    @Override
    protected void oneTimeSetUp() throws Exception {
        super.oneTimeSetUp();
        processFactory = new ScriptProcessFactory(getScriptManager());
    }
View Full Code Here

TOP

Related Classes of org.geoserver.script.wps.ScriptProcessFactory$CollectProcessNames

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.