Package org.gatein.pc.test.unit.actions

Examples of org.gatein.pc.test.unit.actions.PortletActionTestAction


            PortletURL url = response.createActionURL();
            return new InvokeGetResponse(url.toString());
         }
      });

      seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
         {
            assertEquals("k1value1", request.getPortletSession().getAttribute("key1", PortletSession.APPLICATION_SCOPE));
            assertEquals("k2value1", request.getPortletSession().getAttribute("key2"));
View Full Code Here


         {
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });

      seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
         {

            String val = null;
View Full Code Here

         {
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });

      seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
         {
            try
            {
View Full Code Here

         {
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });

      seq.bindAction(1, UTP4.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws ReadOnlyException, IOException, ValidatorException
         {
            // Get prefs
            PortletPreferences prefs = request.getPreferences();

            // Test the initial value does not exist
            assertEquals("other", prefs.getValue("pref", "other"));

            // Set the value
            prefs.setValue("pref", "dynamic");

            // Store
            prefs.store();

            // Test with new value
            assertEquals("dynamic", prefs.getValue("pref", "other"));
         }
      });

      seq.bindAction(1, UTP4.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, UTP4.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws ReadOnlyException, IOException, ValidatorException
         {
            // Get prefs
            PortletPreferences prefs = request.getPreferences();

            // Test with new value
            assertEquals("dynamic", prefs.getValue("pref", "other"));

            // Reset the value and store
            prefs.reset("pref");

            // Test the value does not exist anymore
            assertEquals("other", prefs.getValue("pref", "other"));

            // Store
            prefs.store();

            // Test the value does not exist anymore
            assertEquals("other", prefs.getValue("pref", "other"));
         }
      });

      seq.bindAction(2, UTP4.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });

      seq.bindAction(3, UTP4.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
         {
            // Get prefs
            PortletPreferences prefs = request.getPreferences();
View Full Code Here

         {
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });

      seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
         {
            try
            {
View Full Code Here

         {
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });

      seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
         {

            try
View Full Code Here

         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });
      seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            response.setEvent("Foo", null);
         }
View Full Code Here

         {
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });

      seq.bindAction(1, UTP8.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws ReadOnlyException, IOException, ValidatorException
         {
            // Get prefs
            PortletPreferences prefs = request.getPreferences();

            // Test the initial value is ok
            assertEquals("single_pref_value", prefs.getValue("single_pref", "other"));
            assertEquals(new String[]{"multi_pref_value_1", "multi_pref_value_2"},
               prefs.getValues("multi_pref", new String[]{"other"}));

            // Set with new values
            prefs.setValue("single_pref", "new_single_pref");
            prefs.setValues("multi_pref", new String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"});

            // Test with new values
            assertEquals("new_single_pref", prefs.getValue("single_pref", "other"));
            assertEquals(new String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"}, prefs.getValues("multi_pref", new String[]{"other"}));

            // Trigger store
            prefs.store();

            // Check the validator has been invoked
            System.out.println("--> " +  ValidationStoresValidator.class.getClassLoader());
            assertTrue(ValidationStoresValidator.isValidateInvoked());

            // Test with new values after store
            assertEquals("new_single_pref", prefs.getValue("single_pref", "other"));
            assertEquals(new String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"}, prefs.getValues("multi_pref", new String[]{"other"}));
         }
      });

      seq.bindAction(1, UTP8.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, UTP8.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
         {
            // Get prefs
            PortletPreferences prefs = request.getPreferences();
View Full Code Here

         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });
      seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            assertTrue(TraceFilter.isActive("WildcardFilter", TraceFilter.ACTION));
            assertFalse((TraceFilter.isActive("PartialWildcardFilter", TraceFilter.ACTION)));
            response.setEvent("Event", null);
         }
      });
      seq.bindAction(1, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction()
      {
         protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
         {
            assertTrue(TraceFilter.isActive("WildcardFilter", TraceFilter.EVENT));
            assertFalse((TraceFilter.isActive("PartialWildcardFilter", TraceFilter.EVENT)));
         }
      });
      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            assertTrue(TraceFilter.isActive("WildcardFilter", TraceFilter.RENDER));
            assertFalse((TraceFilter.isActive("PartialWildcardFilter", TraceFilter.RENDER)));
            return new InvokeGetResponse(response.createResourceURL().toString());
         }
      });
      seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
      {
         protected Response run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
         {
            assertTrue(TraceFilter.isActive("WildcardFilter", TraceFilter.RESOURCE));
            assertFalse((TraceFilter.isActive("PartialWildcardFilter", TraceFilter.RESOURCE)));
            return new InvokeGetResponse(response.createRenderURL().toString());
         }
      });
      seq.bindAction(3, UTP2.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });
      seq.bindAction(4, UTP2.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            assertTrue(TraceFilter.isActive("WildcardFilter", TraceFilter.ACTION));
            assertTrue(TraceFilter.isActive("PartialWildcardFilter", TraceFilter.ACTION));
View Full Code Here

         {
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });

      seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
         {
            try
            {
View Full Code Here

TOP

Related Classes of org.gatein.pc.test.unit.actions.PortletActionTestAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.