Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.Literal


    }

    public void testWellKnownTextFromFile() {
  WKTMarkFactory wmf = new WKTMarkFactory();
        wmf.setRoot(rootDir);
  Literal exp = ff.literal(WKTMarkFactory.WKTLIB_PREFIX + "wkt.properties#ls");
  try {
      wmf.getShape(null, exp, feature);
      assertTrue(true);
  } catch (Exception e) {
      assertTrue(false);
View Full Code Here


        WKTMarkFactoryPublic wmfp= new WKTMarkFactoryPublic();
        wmfp.setRoot(rootDir);
       
        try {
            // Adds library to cache
            Literal exp = ff.literal("wkt.properties");
            wmfp.addToCachePublic(exp.evaluate(feature, String.class));
           
            // Check "ls" has been loaded
            assertEquals(wmfp.getFromCachePublic("wkt.properties", "ls"),
                    "LINESTRING(0.0 0.25, 0.25 0.25, 0.5 0.75, 0.75 0.25, 1.00 0.25)");
           
View Full Code Here

        WKTMarkFactoryPublic wmfp= new WKTMarkFactoryPublic();
        wmfp.setRoot(rootDir);
       
        try {
            // Adds 1st library to cache
            Literal exp = ff.literal("wkt.properties");
            wmfp.addToCachePublic(exp.evaluate(feature, String.class));
           
            // Adds 2nd library to cache
            exp = ff.literal("wkt2.properties");
            wmfp.addToCachePublic(exp.evaluate(feature, String.class));
           
            // Check "ls" has been loaded
            assertEquals(wmfp.getFromCachePublic("wkt.properties", "ls"),
                    "LINESTRING(0.0 0.25, 0.25 0.25, 0.5 0.75, 0.75 0.25, 1.00 0.25)");
           
View Full Code Here

        assertNotNull(f);
       
        PropertyName e1 = (PropertyName) f.getExpression1();
        assertEquals("Geometry", e1.getPropertyName());
       
        Literal e2 = (Literal) f.getExpression2();
        assertTrue(e2.getValue() instanceof Polygon);
    }
View Full Code Here

    ChartGraphicFactory factory = new ChartGraphicFactory();

    FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);

    public void testPie() throws Exception {
        Literal url = ff.literal("http://chart?cht=p&chd=t:10,20,70&chs=200x100");
        JFreeChart chart = factory.getChart(null, url, ChartGraphicFactory.FORMAT, 500);
        assertNotNull(chart);
        assertTrue(chart.getPlot() instanceof PiePlot);
        PiePlot p = (PiePlot) chart.getPlot();
View Full Code Here

        assertEquals(0.2f, p.getDataset().getValue(1));
        assertEquals(0.7f, p.getDataset().getValue(2));
    }

    public void testInvalidLocation() throws Exception {
        Literal url = ff.literal("http://weirdo?cht=p&chd=t:10,20,70&chs=200x100");
        assertNull(factory.getChart(null, url, ChartGraphicFactory.FORMAT, 500));
        assertNull(factory.getIcon(null, url, ChartGraphicFactory.FORMAT, 500));
    }
View Full Code Here

        assertNull(factory.getChart(null, url, ChartGraphicFactory.FORMAT, 500));
        assertNull(factory.getIcon(null, url, ChartGraphicFactory.FORMAT, 500));
    }

    public void testInvalidFormat() throws Exception {
        Literal url = ff.literal("http://chart?cht=p&chd=t:10,20,70&chs=200x100");
        assertNull(factory.getChart(null, url, "application/invalid", 500));
        assertNull(factory.getIcon(null, url, "application/invalid", 500));
    }
View Full Code Here

        assertNull(factory.getChart(null, url, "application/invalid", 500));
        assertNull(factory.getIcon(null, url, "application/invalid", 500));
    }

    public void testInvalidSize() throws Exception {
        Literal url = ff.literal("http://chart?cht=p&chd=t:10,20,70&chs=200x100x1000");
        try {
            factory.getIcon(null, url, ChartGraphicFactory.FORMAT, 500);
            fail("Test should have thrown an exception");
        } catch (IllegalArgumentException e) {
            // ok
View Full Code Here

            // ok
        }
    }
   
    public void testMissingSize() throws Exception {
        Literal url = ff.literal("http://chart?cht=p&chd=t:10,20,70");
        try {
            factory.getIcon(null, url, ChartGraphicFactory.FORMAT, -1);
            fail("Test should have thrown an exception");
        } catch (IllegalArgumentException e) {
            // ok
View Full Code Here

            // ok
        }
    }

    public void testSizeFromChartSpec() throws Exception {
        Literal url = ff.literal("http://chart?cht=p&chd=t:10,20,70&chs=200x100");
        Icon icon = (Icon) factory.getIcon(null, url, ChartGraphicFactory.FORMAT, -1);
        assertNotNull(icon);
        assertEquals(200, icon.getIconWidth());
        assertEquals(100, icon.getIconHeight());
    }
View Full Code Here

TOP

Related Classes of org.opengis.filter.expression.Literal

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.