// }
protected void verifyData(boolean afterUpdates) throws Exception
{
PortletApplication app;
PortletDefinition portlet;
app = null;
app = registry.getPortletApplication("App_1");
portlet = (PortletDefinitionImpl) app.getPortlet("Portlet 1");
assertNotNull("Failed to reteive portlet application", app);
validateDublinCore(app.getMetadata());
Collection services = app.getJetspeedServices();
assertNotNull("jetspeed services is null", services);
System.out.println("services is " + services);
assertNotNull("Failed to reteive portlet application via registry", registry.getPortletApplication("App_1"));
assertNotNull("Portlet was not saved along with the portlet app.", app.getPortlet("Portlet 1"));
if (!afterUpdates)
{
assertTrue("\"user.name.family\" user attribute was not found.", app.getUserAttributes().size() == 1);
}
else
{
assertTrue("\"user.name.family\" and user.pets user attributes were not found.", app.getUserAttributes()
.size() == 2);
}
portlet = registry.getPortletDefinitionByUniqueName("App_1::Portlet 1");
assertNotNull("Portlet could not be retreived by unique name.", portlet);
validateDublinCore(portlet.getMetadata());
assertNotNull("Portlet Application was not set in the portlet defintion.", portlet
.getApplication());
assertNotNull("French description was not materialized for the app.", app.getDescription(Locale.FRENCH));
assertNotNull("French display name was not materialized for the app.", app.getDisplayName(Locale.FRENCH));
assertNotNull("description was not materialized for the portlet.", portlet.getDescription(Locale.getDefault()));
assertNotNull("display name was not materialized for the portlet.", portlet.getDisplayName(Locale.getDefault()));
assertNotNull("\"testparam\" portlet parameter was not saved", portlet.getInitParam("testparam"));
// TODO: fix the following line. just comments out for now.
//assertNotNull("\"preference 1\" was not found.", portlet.getPortletPreferences().getPortletPreference("preference 1"));
assertNotNull("Language information not found for Portlet 1", portlet.getLanguage(Locale.getDefault()));
assertNotNull("Content Type html not found.", portlet.getSupports("html/text"));
assertNotNull("Content Type wml not found.", portlet.getSupports("wml"));
// TODO: fix the following lines. just comments out for now.
//Iterator itr = portlet.getPortletPreferences().getPortletPreference("preference 1").getValues().iterator();
//int valueCount = 0;
//while (itr.hasNext())
//{