Skip to content
Permalink
Browse files
[CXF-5430] Renaming OData2Parser to ODataParser for now
git-svn-id: https://svn.apache.org/repos/asf/cxf/trunk@1567115 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Sergey Beryozkin committed Feb 11, 2014
1 parent cd40957 commit 02ab1002aaca0285f1f600ea2b0438defc8274a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
@@ -54,7 +54,7 @@
import org.apache.olingo.odata2.core.uri.expression.FilterParser;
import org.apache.olingo.odata2.core.uri.expression.FilterParserImpl;

public class OData2Parser<T> extends AbstractSearchConditionParser<T> {
public class ODataParser<T> extends AbstractSearchConditionParser<T> {
private final FilterParser parser;

private static class TypedProperty {
@@ -235,7 +235,7 @@ public Object visitOrder(OrderExpression orderExpression, Object filterResult, S
* accessible no-arguments constructor and complementary setters to these used in
* OData 2.0 $filter expressions.
*/
public OData2Parser(final Class< T > conditionClass) {
public ODataParser(final Class< T > conditionClass) {
super(conditionClass);
this.parser = new FilterParserImpl(null);
}
@@ -20,12 +20,13 @@

import org.apache.cxf.jaxrs.ext.search.SearchCondition;
import org.apache.cxf.jaxrs.ext.search.SearchParseException;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class OData2ParserTest extends Assert {
private OData2Parser<Person> parser;
public class ODataParserTest extends Assert {
private ODataParser<Person> parser;

public static class Person {
private String firstName;
@@ -72,7 +73,7 @@ Person withAge(int newAge) {

@Before
public void setUp() {
parser = new OData2Parser<Person>(Person.class);
parser = new ODataParser<Person>(Person.class);
}

@Test
@@ -95,6 +96,7 @@ public void testFilterByFirstOrLastNameEqualValue() throws SearchParseException
parser.parse("FirstName eq 'Tom' or FirstName eq 'Peter' and LastName eq 'Bombadil'");
assertTrue(filter.isMet(new Person("Tom", "Bombadil")));
assertTrue(filter.isMet(new Person("Peter", "Bombadil")));
assertFalse(filter.isMet(new Person("Barry", "Bombadil")));
}

@Test

0 comments on commit 02ab100

Please sign in to comment.