You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by dl...@apache.org on 2004/05/07 15:45:25 UTC
cvs commit: jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/tools/pamanager TestPortletDescriptor.java
dlestrat 2004/05/07 06:45:25
Modified: portal/src/test/org/apache/jetspeed/tools/pamanager
TestPortletDescriptor.java
Log:
PLT 17: Fixes in loading user-attributes.
Revision Changes Path
1.18 +33 -27 jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/tools/pamanager/TestPortletDescriptor.java
Index: TestPortletDescriptor.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/tools/pamanager/TestPortletDescriptor.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- TestPortletDescriptor.java 25 Apr 2004 16:35:41 -0000 1.17
+++ TestPortletDescriptor.java 7 May 2004 13:45:25 -0000 1.18
@@ -147,6 +147,8 @@
"PA Identifier invalid: " + app.getApplicationIdentifier(),
app.getApplicationIdentifier().equals("TestRegistry"));
+ validateUserInfo(app);
+
// portlets
PortletDefinitionList portletsList = app.getPortletDefinitionList();
Iterator it = portletsList.iterator();
@@ -166,6 +168,36 @@
}
+ private void validateUserInfo(MutablePortletApplication app)
+ {
+ // Portlet User Attributes
+ Collection userAttributeSet = app.getUserAttributes();
+ Iterator it = userAttributeSet.iterator();
+ while (it.hasNext())
+ {
+ UserAttribute userAttribute = (UserAttribute) it.next();
+ assertNotNull("User attribute name is null, ", userAttribute.getName());
+ if (userAttribute.getName().equals("user.name.given"))
+ {
+ assertTrue(
+ "User attribute description: " + userAttribute.getDescription(),
+ userAttribute.getDescription().equals("User Given Name"));
+ }
+ if (userAttribute.getName().equals("user.name.family"))
+ {
+ assertTrue(
+ "User attribute description: " + userAttribute.getDescription(),
+ userAttribute.getDescription().equals("User Last Name"));
+ }
+ if (userAttribute.getName().equals("user.home-info.online.email"))
+ {
+ assertTrue(
+ "User attribute description: " + userAttribute.getDescription(),
+ userAttribute.getDescription().equals("User eMail"));
+ }
+ }
+ }
+
private void validateHelloPortlet(PortletDefinitionComposite portlet)
{
// Portlet Name
@@ -286,32 +318,6 @@
}
assertTrue("PortletPreference Count != 2, count = " + count, count == 2);
- // Portlet User Attributes
- Collection userAttributeSet = portlet.getUserAttributeSet();
- it = userAttributeSet.iterator();
- while (it.hasNext())
- {
- UserAttribute userAttribute = (UserAttribute) it.next();
- assertNotNull("User attribute name is null, ", userAttribute.getName());
- if (userAttribute.getName().equals("user.name.given"))
- {
- assertTrue(
- "User attribute description: " + userAttribute.getDescription(),
- userAttribute.getDescription().equals("User Given Name"));
- }
- if (userAttribute.getName().equals("user.name.family"))
- {
- assertTrue(
- "User attribute description: " + userAttribute.getDescription(),
- userAttribute.getDescription().equals("User Last Name"));
- }
- if (userAttribute.getName().equals("user.home-info.online.email"))
- {
- assertTrue(
- "User attribute description: " + userAttribute.getDescription(),
- userAttribute.getDescription().equals("User eMail"));
- }
- }
}
private void validatePreferences(PreferenceComposite pref, String[] expectedValues)
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org