Examples of UrlMapping


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

   }

   @Test
   public void testOnPostbackSetToFalse()
   {
      UrlMapping mapping = config.getMappingById("1");
      assertEquals(false, mapping.isOnPostback());
   }
View Full Code Here

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

   }

   @Test
   public void testParseWithPostbackAction() throws Exception
   {
      UrlMapping mapping = config.getMappingById("1");
      assertFalse(mapping.getActions().get(0).onPostback());
      assertTrue(mapping.getActions().get(1).onPostback());
   }
View Full Code Here

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

   }

   @Test
   public void testParseActionDefaultsToPostbackTrue() throws Exception
   {
      UrlMapping mapping = config.getMappingById("2");
      assertTrue(mapping.getActions().get(0).onPostback());
      assertTrue(mapping.getActions().get(1).onPostback());
   }
View Full Code Here

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

   }

   @Test
   public void testParseWithAnyPhaseAction() throws Exception
   {
      UrlMapping mapping = config.getMappingById("2");
      assertEquals(PhaseId.ANY_PHASE, mapping.getActions().get(1).getPhaseId());
   }
View Full Code Here

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

   }

   @Test
   public void testParseWithPreRenderAction() throws Exception
   {
      UrlMapping mapping = config.getMappingById("3");
      assertEquals(PhaseId.RENDER_RESPONSE, mapping.getActions().get(1).getPhaseId());
   }
View Full Code Here

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

   }

   @Test
   public void testParseWithMappedQueryParam() throws Exception
   {
      UrlMapping mapping = config.getMappingById("4");
      List<QueryParameter> params = mapping.getQueryParams();

      assertEquals(1, params.size());
      RequestParameter param = params.get(0);
      RequestParameter expected = new QueryParameter("user", null, new ConstantExpression("#{deleteUserBean.userName}"));
      assertEquals(expected, param);
View Full Code Here

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

   }

   @Test
   public void testParseWithMappedMultipleQueryParams() throws Exception
   {
      UrlMapping mapping = config.getMappingById("6");
      List<QueryParameter> params = mapping.getQueryParams();

      assertEquals(2, params.size());
      RequestParameter name = new QueryParameter("name", null, new ConstantExpression("#{searchUserBean.userName}"));
      RequestParameter gender = new QueryParameter("gender", null, new ConstantExpression("#{searchUserBean.userGender}"));
      assertArrayEquals(new Object[] { name, gender }, params.toArray());
View Full Code Here

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

   }

   @Test
   public void testParseWithNoQueryParams() throws Exception
   {
      UrlMapping mapping = config.getMappingById("7");
      List<QueryParameter> params = mapping.getQueryParams();
      assertEquals(0, params.size());
   }
View Full Code Here

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

   }

   @Test
   public void testParseWithPathValidators() throws Exception
   {
      UrlMapping mapping = config.getMappingById("validate");
      assertEquals("/validate/#{validationBean.pathInput}", mapping.getPattern());
      assertEquals(2, mapping.getPathValidators().size());
      assertEquals(0, mapping.getPathValidators().get(0).getIndex());
      assertEquals("validator1", mapping.getPathValidators().get(0).getValidatorIds());
      assertEquals("#{validationBean.handle}", mapping.getPathValidators().get(0).getOnError());
      assertEquals(null, mapping.getPathValidators().get(0).getValidatorExpression());

      assertEquals(1, mapping.getPathValidators().get(1).getIndex());
      assertEquals("validator2", mapping.getPathValidators().get(1).getValidatorIds());
      assertEquals("#{validationBean.handle2}", mapping.getPathValidators().get(1).getOnError());
      assertEquals("#{validationBean.validateMethod}", mapping.getPathValidators().get(1).getValidatorExpression().getELExpression());
      List<QueryParameter> params = mapping.getQueryParams();
      assertEquals(1, params.size());
   }
View Full Code Here

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

      // no mappings added
      assertNotNull(config.getMappings());
      assertEquals(1, config.getMappings().size());

      // validate mapping properties
      UrlMapping mapping = config.getMappings().get(0);
      assertEquals("singleLazyExpressionAction", mapping.getId());
      assertEquals("/some/url", mapping.getPattern());
      assertEquals("/view.jsf", mapping.getViewId());
      assertEquals(true, mapping.isOutbound());
      assertEquals(true, mapping.isOnPostback());
      assertEquals(0, mapping.getQueryParams().size());
      assertEquals(1, mapping.getActions().size());
      assertEquals(0, mapping.getPathValidators().size());

      // validate action
      UrlAction action = mapping.getActions().get(0);
      assertEquals(PhaseId.RESTORE_VIEW, action.getPhaseId());

      // validate PrettyExpression
      assertNotNull(action.getAction());
      assertEquals(LazyExpression.class, action.getAction().getClass());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.