cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1468855 - in /cxf/branches/2.7.x-fixes: ./ rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/ rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/ rt/rs/extensions/search/src/test/java/org/apache/...
Date Wed, 17 Apr 2013 12:00:41 GMT
Author: sergeyb
Date: Wed Apr 17 12:00:41 2013
New Revision: 1468855

URL: http://svn.apache.org/r1468855
Log:
Merged revisions 1468852 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1468852 | sergeyb | 2013-04-17 12:58:34 +0100 (Wed, 17 Apr 2013) | 1 line
  
  [CXF-4949] Updating FiqlParser to recognize properties with camel case by default, without
having to map them
........

Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/Beanspector.java
    cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java
    cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParserTest.java

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1468852

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/Beanspector.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/Beanspector.java?rev=1468855&r1=1468854&r2=1468855&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/Beanspector.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/Beanspector.java
Wed Apr 17 12:00:41 2013
@@ -95,7 +95,7 @@ public class Beanspector<T> {
     }
 
     public TypeInfo getAccessorTypeInfo(String getterOrSetterName) throws Exception {
-        Method m = getters.get(getterOrSetterName);
+        Method m = getters.get(getterOrSetterName.toLowerCase());
         if (m == null) {
             m = setters.get(getterOrSetterName);
         }
@@ -122,7 +122,7 @@ public class Beanspector<T> {
     }
 
     public Beanspector<T> setValue(String setterName, Object value) throws Throwable
{
-        Method m = setters.get(setterName);
+        Method m = setters.get(setterName.toLowerCase());
         if (m == null) {
             String msg = String.format("Setter '%s' not found, " + "known setters are: %s",
setterName,
                                        setters.keySet());

Modified: cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java?rev=1468855&r1=1468854&r2=1468855&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java
Wed Apr 17 12:00:41 2013
@@ -565,7 +565,7 @@ public class FiqlParser<T> implements Se
             if (isPrimitive(cond)) {
                 return new SimpleSearchCondition<T>(ct, cond); 
             } else {
-                return new SimpleSearchCondition<T>(Collections.singletonMap(templateName,
ct),
+                return new SimpleSearchCondition<T>(Collections.singletonMap(templateName.toLowerCase(),
ct),
                                                     Collections.singletonMap(templateName,
name),
                                                     Collections.singletonMap(templateName,
tvalue.getTypeInfo()),
                                                     cond);

Modified: cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParserTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParserTest.java?rev=1468855&r1=1468854&r2=1468855&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParserTest.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParserTest.java
Wed Apr 17 12:00:41 2013
@@ -128,13 +128,27 @@ public class FiqlParserTest extends Asse
 
     @Test
     public void testParseName() throws SearchParseException {
-        SearchCondition<Condition> filter = parser.parse("name==king");
+        doTestParseName("name==king");
+    }
+    
+    @Test
+    public void testParseTheName() throws SearchParseException {
+        doTestParseName("thename==king");
+    }
+    
+    @Test
+    public void testParseTheName2() throws SearchParseException {
+        doTestParseName("theName==king");
+    }
+
+    private void doTestParseName(String exp) throws SearchParseException {
+        SearchCondition<Condition> filter = parser.parse(exp);
         assertTrue(filter.isMet(new Condition("king", 10, new Date())));
         assertTrue(filter.isMet(new Condition("king", 0, null)));
         assertFalse(filter.isMet(new Condition("diamond", 10, new Date())));
         assertFalse(filter.isMet(new Condition("diamond", 0, null)));
     }
-
+    
     @Test
     public void testParseLevel() throws SearchParseException {
         SearchCondition<Condition> filter = parser.parse("level=gt=10");
@@ -319,8 +333,12 @@ public class FiqlParserTest extends Asse
             this.time = time;
         }
 
-        public void setException(Exception ex) {
-            // do nothing
+        public void setTheName(String thename) {
+            setName(thename);
+        }
+        
+        public String getTheName() {
+            return getName();
         }
 
     }



Mime
View raw message