cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1525895 - in /cxf/branches/2.6.x-fixes: ./ rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplTest.java
Date Tue, 24 Sep 2013 14:21:58 GMT
Author: sergeyb
Date: Tue Sep 24 14:21:57 2013
New Revision: 1525895

URL: http://svn.apache.org/r1525895
Log:
Merged revisions 1525893 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

................
  r1525893 | sergeyb | 2013-09-24 15:19:49 +0100 (Tue, 24 Sep 2013) | 9 lines
  
  Merged revisions 1525891 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1525891 | sergeyb | 2013-09-24 15:17:29 +0100 (Tue, 24 Sep 2013) | 1 line
    
    [CXF-5299] SearchBean can not capture properties with dots, patch from Nikolay Blindov
applied
  ........
................

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

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.7.x-fixes:r1525893
  Merged /cxf/trunk:r1525891

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

Modified: cxf/branches/2.6.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.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java?rev=1525895&r1=1525894&r2=1525895&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java
Tue Sep 24 14:21:57 2013
@@ -324,7 +324,7 @@ public class FiqlParser<T> implements Se
         boolean isCollection = InjectionUtils.isSupportedCollectionOrArray(valueType);
         Class<?> actualType = isCollection ? InjectionUtils.getActualType(typeInfo.getGenericType())
: valueType;
         
-        int index = setter.indexOf(".");
+        int index = getDotIndex(setter);
         if (index == -1) {
             Object castedValue = value;
             if (Date.class.isAssignableFrom(valueType)) {
@@ -478,8 +478,12 @@ public class FiqlParser<T> implements Se
         }
     }
     
+    private int getDotIndex(String setter) {
+        return this.conditionClass == SearchBean.class ? -1 : setter.indexOf(".");
+    }
+    
     private String getSetter(String setter) {
-        int index = setter.indexOf(".");
+        int index = getDotIndex(setter);
         if (index != -1) {
             return setter.substring(0, index).toLowerCase();
         } else {

Modified: cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplTest.java?rev=1525895&r1=1525894&r2=1525895&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplTest.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplTest.java
Tue Sep 24 14:21:57 2013
@@ -173,7 +173,7 @@ public class SearchContextImplTest exten
     }
     
     @Test
-    public void testPrimitiveStatement() {
+    public void testPrimitiveStatementSearchBean() {
         Message m = new MessageImpl();
         m.put(Message.QUERY_STRING, "_s=name==CXF");
         SearchContext context = new SearchContextImpl(m);
@@ -190,6 +190,23 @@ public class SearchContextImplTest exten
     }
     
     @Test
+    public void testPrimitiveStatementSearchBeanComlexName() {
+        Message m = new MessageImpl();
+        m.put(Message.QUERY_STRING, "_s=complex.name==CXF");
+        SearchContext context = new SearchContextImpl(m);
+        SearchCondition<SearchBean> sc = context.getCondition(SearchBean.class);
+        assertNotNull(sc);
+        
+        PrimitiveStatement ps = sc.getStatement();
+        assertNotNull(ps);
+        
+        assertEquals("complex.name", ps.getProperty());
+        assertEquals("CXF", ps.getValue());
+        assertEquals(ConditionType.EQUALS, ps.getCondition());
+        assertEquals(String.class, ps.getValueType());
+    }
+    
+    @Test
     public void testSingleEquals() {
         Message m = new MessageImpl();
         m.put(Message.QUERY_STRING, "_s=name=CXF");



Mime
View raw message