{
return new InvokeGetResponse(response.createActionURL().toString());
}
});
seq.bindAction(1, UTP3.ACTION_JOIN_POINT, new PortletActionTestAction()
{
protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws ReadOnlyException
{
// Get prefs
PortletPreferences prefs = request.getPreferences();
// Check the initial value are good
assertEquals("static_single_pref_value", prefs.getValue("static_single_pref", "other"));
assertEquals(new String[]{"static_multi_pref_value_1", "static_multi_pref_value_2"}, prefs.getValues("static_multi_pref", new String[]{"other"}));
assertEquals("other", prefs.getValue("dynamic_single_pref", "other"));
assertEquals(new String[]{"other"}, prefs.getValues("dynamic_multi_pref", new String[]{"other"}));
// Set values
prefs.setValue("static_single_pref", "new_static_single_pref_value");
prefs.setValues("static_multi_pref", new String[]{"new_static_multi_pref_value_1", "new_static_multi_pref_value_2"});
prefs.setValue("dynamic_single_pref", "new_dynamic_single_pref_value");
prefs.setValues("dynamic_multi_pref", new String[]{"new_dynamic_multi_pref_value_1", "new_dynamic_multi_pref_value_2"});
// Check wit new values
assertEquals("new_static_single_pref_value", prefs.getValue("static_single_pref", "other"));
assertEquals(new String[]{"new_static_multi_pref_value_1", "new_static_multi_pref_value_2"}, prefs.getValues("static_multi_pref", new String[]{"other"}));
assertEquals("new_dynamic_single_pref_value", prefs.getValue("dynamic_single_pref", "other"));
assertEquals(new String[]{"new_dynamic_multi_pref_value_1", "new_dynamic_multi_pref_value_2"}, prefs.getValues("dynamic_multi_pref", new String[]{"other"}));
}
});
seq.bindAction(1, UTP3.RENDER_JOIN_POINT, new PortletRenderTestAction()
{
protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
{
return new InvokeGetResponse(response.createActionURL().toString());
}
});
seq.bindAction(2, UTP3.ACTION_JOIN_POINT, new PortletActionTestAction()
{
protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
{
// Get prefs
PortletPreferences prefs = request.getPreferences();