rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfrank...@apache.org
Subject svn commit: r1207120 - in /incubator/rave/trunk/rave-shindig/src: main/java/org/apache/rave/opensocial/service/impl/FieldRestrictingPerson.java test/java/org/apache/rave/opensocial/service/FieldRestrictingPersonTest.java
Date Mon, 28 Nov 2011 13:00:42 GMT
Author: mfranklin
Date: Mon Nov 28 13:00:41 2011
New Revision: 1207120

URL: http://svn.apache.org/viewvc?rev=1207120&view=rev
Log:
Handled case where Person has a nulll Property collection (Supports RAVE-347)

Modified:
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/service/impl/FieldRestrictingPerson.java
    incubator/rave/trunk/rave-shindig/src/test/java/org/apache/rave/opensocial/service/FieldRestrictingPersonTest.java

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/service/impl/FieldRestrictingPerson.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/service/impl/FieldRestrictingPerson.java?rev=1207120&r1=1207119&r2=1207120&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/service/impl/FieldRestrictingPerson.java
(original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/service/impl/FieldRestrictingPerson.java
Mon Nov 28 13:00:41 2011
@@ -739,7 +739,7 @@ public class FieldRestrictingPerson impl
     }
 
     private boolean displayField(Field field) {
-        return fields != null && fields.contains(field.toString());
+        return fields == null || fields.isEmpty() || fields.contains(field.toString());
     }
 
     private List<PersonProperty> getFromProperties(Field field) {

Modified: incubator/rave/trunk/rave-shindig/src/test/java/org/apache/rave/opensocial/service/FieldRestrictingPersonTest.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/test/java/org/apache/rave/opensocial/service/FieldRestrictingPersonTest.java?rev=1207120&r1=1207119&r2=1207120&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/test/java/org/apache/rave/opensocial/service/FieldRestrictingPersonTest.java
(original)
+++ incubator/rave/trunk/rave-shindig/src/test/java/org/apache/rave/opensocial/service/FieldRestrictingPersonTest.java
Mon Nov 28 13:00:41 2011
@@ -88,12 +88,12 @@ public class FieldRestrictingPersonTest 
     @Test
     public void getUsername_null() {
         Person p = new FieldRestrictingPerson(getTestPerson(), null);
-        assertThat(p.getPreferredUsername(), is(nullValue()));
+        assertThat(p.getPreferredUsername(), is(equalTo(USERNAME)));
     }
     @Test
     public void getUsername_empty() {
         Person p = new FieldRestrictingPerson(getTestPerson(), new HashSet<String>());
-        assertThat(p.getPreferredUsername(), is(nullValue()));
+        assertThat(p.getPreferredUsername(), is(equalTo(USERNAME)));
     }
     @Test
     public void getUsername_valid() {



Mime
View raw message