Package com.ocpsoft.pretty.faces.config.mapping

Examples of com.ocpsoft.pretty.faces.config.mapping.UrlAction


   ActionExecutor executor = new ActionExecutor();

   @Test
   public void testShouldExecuteOnPostback()
   {
      UrlAction action = new UrlAction("action", PhaseId.ANY_PHASE);
      action.setOnPostback(true);
      assertTrue(executor.shouldExecute(action, javax.faces.event.PhaseId.RESTORE_VIEW, true));
   }
View Full Code Here


   }

   @Test
   public void testShouldExecuteOnNonPostback()
   {
      UrlAction action = new UrlAction("action", PhaseId.ANY_PHASE);
      action.setOnPostback(true);
      assertTrue(executor.shouldExecute(action, javax.faces.event.PhaseId.RESTORE_VIEW, false));
   }
View Full Code Here

   }

   @Test
   public void testShouldExecuteOnPhaseNonPostback()
   {
      UrlAction action = new UrlAction("action", PhaseId.RESTORE_VIEW);
      action.setOnPostback(true);
      assertTrue(executor.shouldExecute(action, javax.faces.event.PhaseId.RESTORE_VIEW, false));
   }
View Full Code Here

   }

   @Test
   public void testShouldNotExecuteOnWrongPhaseNonPostback()
   {
      UrlAction action = new UrlAction("action", PhaseId.RESTORE_VIEW);
      action.setOnPostback(true);
      assertFalse(executor.shouldExecute(action, javax.faces.event.PhaseId.APPLY_REQUEST_VALUES, false));
   }
View Full Code Here

   }

   @Test
   public void testShouldExecuteOnPhasePostback()
   {
      UrlAction action = new UrlAction("action", PhaseId.RESTORE_VIEW);
      action.setOnPostback(true);
      assertTrue(executor.shouldExecute(action, javax.faces.event.PhaseId.RESTORE_VIEW, true));
   }
View Full Code Here

   }

   @Test
   public void testShouldNotExecuteOnWrongPhasePostback()
   {
      UrlAction action = new UrlAction("action", PhaseId.RESTORE_VIEW);
      action.setOnPostback(true);
      assertFalse(executor.shouldExecute(action, javax.faces.event.PhaseId.APPLY_REQUEST_VALUES, true));
   }
View Full Code Here

   }

   @Test
   public void testShouldNotExecuteOnPostbackFalse()
   {
      UrlAction action = new UrlAction("action", PhaseId.ANY_PHASE);
      action.setOnPostback(false);
      assertFalse(executor.shouldExecute(action, javax.faces.event.PhaseId.RESTORE_VIEW, true));
   }
View Full Code Here

   }

   @Test
   public void testShouldExecuteOnPostbackFalseWhenNotPostback()
   {
      UrlAction action = new UrlAction("action", PhaseId.ANY_PHASE);
      action.setOnPostback(false);
      assertTrue(executor.shouldExecute(action, javax.faces.event.PhaseId.RESTORE_VIEW, false));
   }
View Full Code Here

      assertEquals("0", mapping.getId());
      assertEquals("/project/#{viewProjectBean.projectId}/", mapping.getPattern());
      assertEquals("#{viewProjectBean.getPrettyTarget}", mapping.getViewId());

      List<UrlAction> actions = mapping.getActions();
      assertTrue(actions.contains(new UrlAction("#{viewProjectBean.load}")));
      assertTrue(actions.contains(new UrlAction("#{viewProjectBean.authorize}")));
   }
View Full Code Here

   static Object[] valuesArray;

   @BeforeClass
   public static void setUpBeforeClass() throws Exception
   {
      mapping.addAction(new UrlAction("#{bean.action}"));
      mapping.setId("testMapping");
      mapping.setPattern("/test/#{bean.param1}/mapping/#{bean.param2}");
      mapping.addQueryParam(new QueryParameter("key1", "#{bean.qp1}"));
      mapping.addQueryParam(new QueryParameter("key2", "#{bean.qp2}"));
View Full Code Here

TOP

Related Classes of com.ocpsoft.pretty.faces.config.mapping.UrlAction

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.