Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.Expression.evaluate()


        Graphic graphic = symbolize.getGraphic();
        List<GraphicalSymbol> symbols = graphic.graphicalSymbols();
        assertEquals(1, symbols.size());
        Mark mark = (Mark) symbols.get(0);
        Expression color = mark.getFill().getColor();
        Color value = color.evaluate(null, Color.class);
        assertNotNull("color", value);
        assertEquals("blue", Color.YELLOW, value);
    }

    /**
 
View Full Code Here


      EnvFunction.setLocalValue("var", "123");
      Function f = ff.function("env", ff.literal("var"));
     
      Expression result = (Expression) f.accept(visitor, null);
      assertTrue(result instanceof Literal);
      assertEquals("123", result.evaluate(null, String.class));
    }
   
    public void testVolatileFunction() {
      Function f = ff.function("random");
     
View Full Code Here

      Function param1 = (Function) result.getParameters().get(0);
    assertEquals("random", param1.getName());
    // second argument simplified out
    Expression param2 = result.getParameters().get(1);
    assertTrue(param2 instanceof Literal);
    assertEquals(Integer.valueOf(3), param2.evaluate(null, Integer.class));
    }
   
    public void testCompareFunctionNull() {
        Function f = ff.function("env", ff.literal("var"));
        PropertyIsEqualTo filter = ff.equal(f, ff.literal("test"), false);
View Full Code Here

  public void testAttribute() throws IllegalFilterException {
    // Test integer attribute
    Expression testAttribute = new AttributeExpressionImpl(testSchema,
        "testInteger");
    LOGGER.fine("integer attribute expression equals: "
        + testAttribute.evaluate(testFeature));
    assertEquals(new Integer(1002), testAttribute.evaluate(testFeature));

    // Test string attribute
    testAttribute = new AttributeExpressionImpl(testSchema, "testString");
    LOGGER.fine("string attribute expression equals: "
View Full Code Here

    // Test integer attribute
    Expression testAttribute = new AttributeExpressionImpl(testSchema,
        "testInteger");
    LOGGER.fine("integer attribute expression equals: "
        + testAttribute.evaluate(testFeature));
    assertEquals(new Integer(1002), testAttribute.evaluate(testFeature));

    // Test string attribute
    testAttribute = new AttributeExpressionImpl(testSchema, "testString");
    LOGGER.fine("string attribute expression equals: "
        + testAttribute.evaluate(testFeature));
View Full Code Here

    assertEquals(new Integer(1002), testAttribute.evaluate(testFeature));

    // Test string attribute
    testAttribute = new AttributeExpressionImpl(testSchema, "testString");
    LOGGER.fine("string attribute expression equals: "
        + testAttribute.evaluate(testFeature));
    assertEquals("test string data", testAttribute.evaluate(testFeature));
  }

  /**
   * Tests the attribute expression over an object other than Feature.
View Full Code Here

    // Test string attribute
    testAttribute = new AttributeExpressionImpl(testSchema, "testString");
    LOGGER.fine("string attribute expression equals: "
        + testAttribute.evaluate(testFeature));
    assertEquals("test string data", testAttribute.evaluate(testFeature));
  }

  /**
   * Tests the attribute expression over an object other than Feature.
   *
 
View Full Code Here

   */
  public void testLiteral() throws IllegalFilterException {
    // Test integer attribute
    Expression testLiteral = new LiteralExpressionImpl(new Integer(1002));
    LOGGER.fine("integer literal expression equals: "
        + testLiteral.evaluate(testFeature));
    assertEquals(new Integer(1002), testLiteral.evaluate(testFeature));

    // Test string attribute
    testLiteral = new LiteralExpressionImpl("test string data");
    LOGGER.fine("string literal expression equals: "
View Full Code Here

  public void testLiteral() throws IllegalFilterException {
    // Test integer attribute
    Expression testLiteral = new LiteralExpressionImpl(new Integer(1002));
    LOGGER.fine("integer literal expression equals: "
        + testLiteral.evaluate(testFeature));
    assertEquals(new Integer(1002), testLiteral.evaluate(testFeature));

    // Test string attribute
    testLiteral = new LiteralExpressionImpl("test string data");
    LOGGER.fine("string literal expression equals: "
        + testLiteral.evaluate(testFeature));
View Full Code Here

    assertEquals(new Integer(1002), testLiteral.evaluate(testFeature));

    // Test string attribute
    testLiteral = new LiteralExpressionImpl("test string data");
    LOGGER.fine("string literal expression equals: "
        + testLiteral.evaluate(testFeature));
    assertEquals("test string data", testLiteral.evaluate(testFeature));
  }

  /**
   * Tests the literal expression over an object other than Feature.
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.