You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by or...@apache.org on 2005/02/16 02:04:41 UTC

cvs commit: incubator-myfaces/src/cactus/web Bug1026202CactusTest.jsp

oros        2005/02/15 17:04:41

  Modified:    src/cactus/org/apache/myfaces/cactus TestBean.java
               src/cactus/web/WEB-INF/beans additional-beans.xml
  Added:       src/cactus/org/apache/myfaces/renderkit/html
                        Bug1026202CactusTest.java
               src/cactus/web Bug1026202CactusTest.jsp
  Log:
  SF issue #1026202: added test case
  
  Revision  Changes    Path
  1.5       +13 -0     incubator-myfaces/src/cactus/org/apache/myfaces/cactus/TestBean.java
  
  Index: TestBean.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/cactus/org/apache/myfaces/cactus/TestBean.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestBean.java	13 Oct 2004 11:50:56 -0000	1.4
  +++ TestBean.java	16 Feb 2005 01:04:41 -0000	1.5
  @@ -27,6 +27,7 @@
   public class TestBean
   {
       private long numberPrimitiveLong;
  +    private int numberPrimitiveInt;
       private Long numberLong;
       private BigDecimal numberBigDecimal;
       private List list;
  @@ -117,4 +118,16 @@
       {
           this.date = date;
       }
  +
  +
  +    public int getNumberPrimitiveInt()
  +    {
  +        return numberPrimitiveInt;
  +    }
  +
  +
  +    public void setNumberPrimitiveInt(int numberPrimitiveInt)
  +    {
  +        this.numberPrimitiveInt = numberPrimitiveInt;
  +    }
   }
  
  
  
  1.1                  incubator-myfaces/src/cactus/org/apache/myfaces/renderkit/html/Bug1026202CactusTest.java
  
  Index: Bug1026202CactusTest.java
  ===================================================================
  /*
   * Copyright 2002,2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.myfaces.renderkit.html;
  
  import org.apache.myfaces.cactus.JspBasedTestCase;
  
  import com.meterware.httpunit.WebResponse;
  
  
  /**
   * @author <a href="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
   */
  public class Bug1026202CactusTest
      extends JspBasedTestCase
  {
  
      public Bug1026202CactusTest(String string)
      {
          super(string);
      }
  
  
      public void endBug(WebResponse response)
          throws Exception
      {
          assertTrue(response.getText().indexOf("checked=\"checked\" value=\"5\"") != -1);
          assertTrue(response.getText().indexOf("checked=\"checked\" value=\"15\"") != -1);
      }
  }
  
  
  
  1.3       +4 -0      incubator-myfaces/src/cactus/web/WEB-INF/beans/additional-beans.xml
  
  Index: additional-beans.xml
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/cactus/web/WEB-INF/beans/additional-beans.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- additional-beans.xml	13 Oct 2004 11:50:56 -0000	1.2
  +++ additional-beans.xml	16 Feb 2005 01:04:41 -0000	1.3
  @@ -8,6 +8,10 @@
               <value>5</value>
           </managed-property>
           <managed-property>
  +            <property-name>numberPrimitiveInt</property-name>
  +            <value>15</value>
  +        </managed-property>
  +        <managed-property>
               <property-name>numberLong</property-name>
               <value>#{testDataProvider.long}</value>
           </managed-property>
  
  
  
  1.1                  incubator-myfaces/src/cactus/web/Bug1026202CactusTest.jsp
  
  Index: Bug1026202CactusTest.jsp
  ===================================================================
  <%@ page import="java.math.BigDecimal,
                   java.util.Date"%>
  <%@ page session="false" contentType="text/html;charset=utf-8"%>
  <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
  <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
  <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
  <html>
  
  <!--
  /*
   * Copyright 2005 The Apache Software Foundation.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  //-->
  
  <body>
  
  <!--
  managed beans used:
      carconf
  -->
  
  <f:view>
  
  
                  <h:form name="formName">
  
                      <h:panelGrid columns="1">
  
                          <h:panelGroup >
                              <h:selectOneRadio id="r1" value="#{testAdditional.numberPrimitiveLong}" layout="pageDirection"  styleClass="selectOneRadio">
                                  <f:selectItem itemValue="1" itemLabel="1" />
                                  <f:selectItem itemValue="2" itemLabel="2"  />
                                  <f:selectItem itemValue="5" itemLabel="5"  />
                              </h:selectOneRadio>
                          </h:panelGroup>
  
                          <h:panelGroup >
                              <h:selectOneRadio id="r2" value="#{testAdditional.numberPrimitiveInt}" layout="pageDirection"  styleClass="selectOneRadio">
                                  <f:selectItem itemValue="1" itemLabel="1" />
                                  <f:selectItem itemValue="15" itemLabel="15"  />
                                  <f:selectItem itemValue="25" itemLabel="25"  />
                              </h:selectOneRadio>
                          </h:panelGroup>
  
                          <h:commandButton action="#{carconf.calcPrice}" value="#{example_messages['button_calcprice']}" />
  
                      </h:panelGrid>
                  </h:form>
  
  </f:view>
  
  </body>
  
  </html>