Пример #1
0
 public FilterValidator isMethod(final MethodKind methodKind, final int parameterCount) {
   assertTrue("Current expression is not a methodCall", curExpression instanceof Method);
   Method methodCall = (Method) curExpression;
   assertEquals(methodKind, methodCall.getMethod());
   assertEquals(parameterCount, methodCall.getParameters().size());
   return this;
 }
Пример #2
0
 public FilterValidator goParameter(final int parameterIndex) {
   if (curExpression instanceof Method) {
     Method methodCall = (Method) curExpression;
     curExpression = methodCall.getParameters().get(parameterIndex);
   } else {
     fail("Current expression not a methodCall");
   }
   return this;
 }
Пример #3
0
  public FilterValidator isParameterText(final int parameterIndex, final String parameterText)
      throws ExpressionVisitException, ODataApplicationException {

    if (!(curExpression instanceof Method)) {
      fail("Current expression is not a method");
    }

    Method methodCall = (Method) curExpression;

    Expression parameter = methodCall.getParameters().get(parameterIndex);
    String actualParameterText = FilterTreeToText.Serialize(parameter);
    assertEquals(parameterText, actualParameterText);
    return this;
  }
Пример #4
0
 public FilterValidator goParameter(final int parameterIndex) {
   assertTrue("Current expression not a methodCall", curExpression instanceof Method);
   Method methodCall = (Method) curExpression;
   curExpression = methodCall.getParameters().get(parameterIndex);
   return this;
 }