directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1543866 - in /directory/escimo/trunk: ldap/src/main/java/org/apache/directory/scim/ldap/ server/src/main/java/org/apache/directory/scim/rest/ tests/src/test/java/org/apache/directory/scim/
Date Wed, 20 Nov 2013 16:36:51 GMT
Author: kayyagari
Date: Wed Nov 20 16:36:50 2013
New Revision: 1543866

URL: http://svn.apache.org/r1543866
Log:
o allow searching even when fileter and attributes parameters are null
o fixed the patch test after updating resource provider to return non-null resource only if
attributes parameter is present

Modified:
    directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java
    directory/escimo/trunk/server/src/main/java/org/apache/directory/scim/rest/GroupService.java
    directory/escimo/trunk/server/src/main/java/org/apache/directory/scim/rest/UserService.java
    directory/escimo/trunk/tests/src/test/java/org/apache/directory/scim/UserResourceTest.java

Modified: directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java?rev=1543866&r1=1543865&r2=1543866&view=diff
==============================================================================
--- directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java
(original)
+++ directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java
Wed Nov 20 16:36:50 2013
@@ -901,16 +901,12 @@ public class LdapResourceProvider implem
         ModifyRequest modReq = new ModifyRequestImpl();
         modReq.setName( existingEntry.getDn() );
         
-        boolean hasAttributesInMeta = false;
-        
         JsonObject metaObj = ( JsonObject ) obj.get( "meta" );
         if( metaObj != null )
         {
             JsonArray metaAtNames = ( JsonArray ) metaObj.get( "attributes" );
             if( metaAtNames != null )
             {
-                hasAttributesInMeta = true;
-                
                 for( JsonElement e : metaAtNames )
                 {
                     String name = e.getAsString();
@@ -945,7 +941,8 @@ public class LdapResourceProvider implem
                 throw new Exception( result.getDiagnosticMessage() );
             }
             
-            if( hasAttributesInMeta )
+            // send attributes if requested
+            if( ctx.getParamAttributes() != null )
             {
                 Entry entry = fetchEntryById( resourceId, resourceSchema, ctx );
                 

Modified: directory/escimo/trunk/server/src/main/java/org/apache/directory/scim/rest/GroupService.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/server/src/main/java/org/apache/directory/scim/rest/GroupService.java?rev=1543866&r1=1543865&r2=1543866&view=diff
==============================================================================
--- directory/escimo/trunk/server/src/main/java/org/apache/directory/scim/rest/GroupService.java
(original)
+++ directory/escimo/trunk/server/src/main/java/org/apache/directory/scim/rest/GroupService.java
Wed Nov 20 16:36:50 2013
@@ -223,11 +223,11 @@ public class GroupService
     {
         ResponseBuilder rb = null;
 
-        if( ( ( filter == null ) || ( filter.trim().length() == 0 ) ) &&
-            ( ( attributes == null ) || ( attributes.trim().length() == 0 ) ) )
-        {
-            return sendBadRequest( "Neither filter nor attributes parameter is present with
the call to " + uriInfo.getAbsolutePath() );
-        }
+//        if( ( ( filter == null ) || ( filter.trim().length() == 0 ) ) &&
+//            ( ( attributes == null ) || ( attributes.trim().length() == 0 ) ) )
+//        {
+//            return sendBadRequest( "Neither filter nor attributes parameter is present
with the call to " + uriInfo.getAbsolutePath() );
+//        }
         
         LOG.debug( "Filter : {}", filter );
         LOG.debug( "Attributes : {}", attributes );

Modified: directory/escimo/trunk/server/src/main/java/org/apache/directory/scim/rest/UserService.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/server/src/main/java/org/apache/directory/scim/rest/UserService.java?rev=1543866&r1=1543865&r2=1543866&view=diff
==============================================================================
--- directory/escimo/trunk/server/src/main/java/org/apache/directory/scim/rest/UserService.java
(original)
+++ directory/escimo/trunk/server/src/main/java/org/apache/directory/scim/rest/UserService.java
Wed Nov 20 16:36:50 2013
@@ -228,11 +228,11 @@ public class UserService
     {
         ResponseBuilder rb = null;
 
-        if( ( ( filter == null ) || ( filter.trim().length() == 0 ) ) &&
-            ( ( attributes == null ) || ( attributes.trim().length() == 0 ) ) )
-        {
-            return sendBadRequest( "Neither filter nor attributes parameter is present with
the call to " + uriInfo.getAbsolutePath() );
-        }
+//        if( ( ( filter == null ) || ( filter.trim().length() == 0 ) ) &&
+//            ( ( attributes == null ) || ( attributes.trim().length() == 0 ) ) )
+//        {
+//            return sendBadRequest( "Neither filter nor attributes parameter is present
with the call to " + uriInfo.getAbsolutePath() );
+//        }
         
         LOG.debug( "Filter : {}", filter );
         LOG.debug( "Attributes : {}", attributes );

Modified: directory/escimo/trunk/tests/src/test/java/org/apache/directory/scim/UserResourceTest.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/tests/src/test/java/org/apache/directory/scim/UserResourceTest.java?rev=1543866&r1=1543865&r2=1543866&view=diff
==============================================================================
--- directory/escimo/trunk/tests/src/test/java/org/apache/directory/scim/UserResourceTest.java
(original)
+++ directory/escimo/trunk/tests/src/test/java/org/apache/directory/scim/UserResourceTest.java
Wed Nov 20 16:36:50 2013
@@ -298,7 +298,10 @@ public class UserResourceTest
         deleteMemGroup.setMeta( meta );
         
         result = client.patchGroup( addedGroup.getId(), deleteMemGroup );
-        patchedGroup = result.getResourceAs( Group.class ); 
-        assertNull( patchedGroup.getMembers() );
+        patchedGroup = result.getResourceAs( Group.class );
+        assertTrue( result.isSuccess() );
+        assertNull( patchedGroup );
+        //TODO uncomment the below line as soon as client supports HTTP parameter passing
+        //assertNull( patchedGroup.getMembers() );
     }
 }



Mime
View raw message