| <?xml version="1.0" encoding="UTF-8"?> |
| |
| <!-- $Id$ --> |
| <!-- |
| Copyright 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. |
| --> |
| <mock-test> |
| <context name="c18" root="context18"/> |
| |
| <servlet name="app" class="org.apache.tapestry.ApplicationServlet"/> |
| |
| <request> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Home</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output-matches name="Radio Fields"> |
| <![CDATA[ |
| <input type="radio" .*?> \w+ |
| ]]> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" value="0"/> Small]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" checked="checked" value="1"/> Medium]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" value="2"/> Large]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" disabled="disabled" value="3"/> Gargantuan]]></match> |
| |
| </assert-output-matches> |
| |
| <assert-output name="Size Field"> |
| Size: [20] |
| </assert-output> |
| |
| </request> |
| |
| <!-- Pretend to click the "Large" button. --> |
| |
| <request> |
| <parameter name="service" value="direct/0/Home/$Form"/> |
| <parameter name="sp" value="S0"/> |
| <parameter name="$RadioGroup" value="2"/> |
| <parameter name="Form0" value="$RadioGroup"/> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Home</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output-matches name="Radio Fields"> |
| <![CDATA[ |
| <input type="radio" .*?> \w+ |
| ]]> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" value="0"/> Small]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" value="1"/> Medium]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" checked="checked" value="2"/> Large]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" disabled="disabled" value="3"/> Gargantuan]]></match> |
| |
| </assert-output-matches> |
| |
| <assert-output name="Size Field"> |
| Size: [30] |
| </assert-output> |
| |
| </request> |
| |
| <!-- Submit with no option selected. --> |
| |
| <request> |
| <parameter name="service" value="direct/0/Home/$Form"/> |
| <parameter name="sp" value="S0"/> |
| <parameter name="Form0" value="$RadioGroup"/> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Home</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output-matches name="Radio Fields"> |
| <![CDATA[ |
| <input type="radio" .*?> \w+ |
| ]]> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" value="0"/> Small]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" checked="checked" value="1"/> Medium]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" value="2"/> Large]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" disabled="disabled" value="3"/> Gargantuan]]></match> |
| |
| </assert-output-matches> |
| |
| <assert-output name="Size Field"> |
| Size: [20] |
| </assert-output> |
| |
| </request> |
| |
| <!-- Pretend to click the "Gargantuan" button (even though it is disabled). --> |
| |
| <request> |
| <parameter name="service" value="direct/0/Home/$Form"/> |
| <parameter name="sp" value="S0"/> |
| <parameter name="$RadioGroup" value="3"/> |
| <parameter name="Form0" value="$RadioGroup"/> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Home</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output-matches name="Radio Fields"> |
| <![CDATA[ |
| <input type="radio" .*?> \w+ |
| ]]> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" value="0"/> Small]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" checked="checked" value="1"/> Medium]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" value="2"/> Large]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" disabled="disabled" value="3"/> Gargantuan]]></match> |
| |
| </assert-output-matches> |
| |
| <assert-output name="Size Field"> |
| Size: [20] |
| </assert-output> |
| |
| </request> |
| |
| <!-- Click the dummy form (using action service). --> |
| |
| <request> |
| <parameter name="service" value="action/0/Home/1/dummy"/> |
| <parameter name="sp" value="S0"/> |
| <parameter name="Form1" value=""/> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Home</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output-matches name="Radio Fields"> |
| <![CDATA[ |
| <input type="radio" .*?> \w+ |
| ]]> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" value="0"/> Small]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" checked="checked" value="1"/> Medium]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" value="2"/> Large]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" disabled="disabled" value="3"/> Gargantuan]]></match> |
| |
| </assert-output-matches> |
| |
| <assert-output name="Size Field"> |
| Size: [20] |
| </assert-output> |
| |
| </request> |
| |
| <!-- Click the link to disable the group. --> |
| |
| <request> |
| <parameter name="service" value="direct/0/Home/$DirectLink"/> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Home</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output-matches name="Radio Fields"> |
| <![CDATA[ |
| <input type="radio" .*?> \w+ |
| ]]> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" disabled="disabled" value="0"/> Small]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" checked="checked" disabled="disabled" value="1"/> Medium]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" disabled="disabled" value="2"/> Large]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" disabled="disabled" value="3"/> Gargantuan]]></match> |
| |
| </assert-output-matches> |
| |
| <assert-output name="Size Field"> |
| Size: [20] |
| </assert-output> |
| |
| </request> |
| |
| <!-- Select the (now disabled) large value. --> |
| <request> |
| <parameter name="service" value="direct/0/Home/$Form"/> |
| <parameter name="sp" value="S0"/> |
| <parameter name="$RadioGroup" value="2"/> |
| <parameter name="Form0" value="$RadioGroup"/> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Home</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output-matches name="Radio Fields"> |
| <![CDATA[ |
| <input type="radio" .*?> \w+ |
| ]]> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" disabled="disabled" value="0"/> Small]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" checked="checked" disabled="disabled" value="1"/> Medium]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" disabled="disabled" value="2"/> Large]]></match> |
| <match><![CDATA[<input type="radio" name="$RadioGroup" disabled="disabled" value="3"/> Gargantuan]]></match> |
| |
| </assert-output-matches> |
| |
| <assert-output name="Size Field"> |
| Size: [20] |
| </assert-output> |
| |
| </request> |
| |
| <request> |
| <parameter name="service" value="page/NestedGroups"/> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Exception</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output name="Exception Name"> |
| org.apache.tapestry.ApplicationRuntimeException |
| </assert-output> |
| |
| <assert-output name="Exception Messge"> |
| RadioGroup components may not be nested. |
| </assert-output> |
| |
| <assert-output name="Component Id"> |
| [NestedGroups/inner] |
| </assert-output> |
| </request> |
| |
| <request> |
| <parameter name="service" value="page/NoGroup"/> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Exception</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output name="Exception Name"> |
| org.apache.tapestry.ApplicationRuntimeException |
| </assert-output> |
| |
| <assert-output name="Exception Messge"> |
| Radio component must be contained within a RadioGroup. |
| </assert-output> |
| |
| <assert-output name="Component Id"> |
| [NoGroup/orphan] |
| </assert-output> |
| </request> |
| |
| <request> |
| <parameter name="service" value="page/NoForm"/> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Exception</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output name="Exception Name"> |
| org.apache.tapestry.ApplicationRuntimeException |
| </assert-output> |
| |
| <assert-output name="Exception Messge"> |
| This component must be contained within a Form. |
| </assert-output> |
| |
| <assert-output name="Component Id"> |
| [NoForm/orphan] |
| </assert-output> |
| </request> |
| |
| <!-- Now some tests to check for handling of null as the current selection of a RadioGroup. --> |
| |
| <request> |
| <parameter name="service" value="page/NullSelection"/> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[<title>NullSelection</title>]]> |
| </assert-output> |
| |
| <assert-output name="No Choice"> |
| <![CDATA[<input type="radio" name="group" checked="checked" value="0"/> No Choice]]> |
| </assert-output> |
| |
| <assert-output name="Tapestry"> |
| <![CDATA[<input type="radio" name="group" value="1"/> Tapestry]]> |
| </assert-output> |
| |
| <assert-output name="Struts"> |
| <![CDATA[<input type="radio" name="group" value="2"/> Struts]]> |
| </assert-output> |
| |
| <assert-output name="WebWork"> |
| <![CDATA[<input type="radio" name="group" value="3"/> WebWork]]> |
| </assert-output> |
| |
| <assert-output name="Selection"> |
| Framework: [] |
| </assert-output> |
| |
| </request> |
| |
| <!-- Submit the form. --> |
| |
| <request> |
| <parameter name="service" value="direct/1/NullSelection/$Form"/> |
| <parameter name="sp" value="S0"/> |
| <parameter name="Form0" value="group"/> |
| <parameter name="group" value="1"/> |
| |
| <assert-output name="No Choice"> |
| <![CDATA[<input type="radio" name="group" value="0"/> No Choice]]> |
| </assert-output> |
| |
| <assert-output name="Tapestry"> |
| <![CDATA[<input type="radio" name="group" checked="checked" value="1"/> Tapestry]]> |
| </assert-output> |
| |
| <assert-output name="Struts"> |
| <![CDATA[<input type="radio" name="group" value="2"/> Struts]]> |
| </assert-output> |
| |
| <assert-output name="WebWork"> |
| <![CDATA[<input type="radio" name="group" value="3"/> WebWork]]> |
| </assert-output> |
| |
| <assert-output name="Selection"> |
| Framework: [tapestry] |
| </assert-output> |
| </request> |
| |
| <!-- Submit the form with *no* selection for group. --> |
| <request> |
| <parameter name="service" value="direct/1/NullSelection/$Form"/> |
| <parameter name="sp" value="S0"/> |
| <parameter name="Form0" value="group"/> |
| |
| <assert-output name="No Choice"> |
| <![CDATA[<input type="radio" name="group" checked="checked" value="0"/> No Choice]]> |
| </assert-output> |
| |
| <assert-output name="Tapestry"> |
| <![CDATA[<input type="radio" name="group" value="1"/> Tapestry]]> |
| </assert-output> |
| |
| <assert-output name="Struts"> |
| <![CDATA[<input type="radio" name="group" value="2"/> Struts]]> |
| </assert-output> |
| |
| <assert-output name="WebWork"> |
| <![CDATA[<input type="radio" name="group" value="3"/> WebWork]]> |
| </assert-output> |
| |
| <assert-output name="Selection"> |
| Framework: [] |
| </assert-output> |
| |
| </request> |
| |
| <request> |
| <parameter name="service" value="page/LanguageSelection"/> |
| |
| <assert-output name="Selected Language"> |
| Selected Language: [] |
| </assert-output> |
| |
| <assert-output name="Java"> |
| <![CDATA[<input type="radio" name="group" value="0"/> Java]]> |
| </assert-output> |
| |
| <assert-output name="C#"> |
| <![CDATA[<input type="radio" name="group" value="1"/> C#]]> |
| </assert-output> |
| |
| <assert-output name="C#"> |
| <![CDATA[<input type="radio" name="group" value="2"/> Python]]> |
| </assert-output> |
| </request> |
| |
| <request> |
| <parameter name="service" value="direct/1/LanguageSelection/form"/> |
| <parameter name="sp" value="S0"/> |
| <parameter name="Form0" value="group"/> |
| <parameter name="group" value="2"/> |
| |
| |
| <assert-output name="Selected Language"> |
| Selected Language: [Language[PYTHON]] |
| </assert-output> |
| |
| <assert-output name="Java"> |
| <![CDATA[<input type="radio" name="group" value="0"/> Java]]> |
| </assert-output> |
| |
| <assert-output name="C#"> |
| <![CDATA[<input type="radio" name="group" value="1"/> C#]]> |
| </assert-output> |
| |
| <assert-output name="C#"> |
| <![CDATA[<input type="radio" name="group" checked="checked" value="2"/> Python]]> |
| </assert-output> |
| </request> |
| |
| </mock-test> |