| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Copyright 2004, 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. |
| --> |
| |
| <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" id="RadioGroup0" value="0" /> Small]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup1" checked="checked" value="1" /> Medium]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup2" value="2" /> Large]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup3" 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" /> |
| <parameter name="page" value="Home" /> |
| <parameter name="component" value="$Form" /> |
| <parameter name="RadioGroup" value="2" /> |
| <parameter name="formids" 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" id="RadioGroup0" value="0" /> Small]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup1" value="1" /> Medium]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup2" checked="checked" value="2" /> Large]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup3" 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" /> |
| <parameter name="page" value="Home" /> |
| <parameter name="component" value="$Form" /> |
| <parameter name="formids" 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" id="RadioGroup0" value="0" /> Small]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup1" checked="checked" value="1" /> Medium]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup2" value="2" /> Large]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup3" 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" /> |
| <parameter name="page" value="Home" /> |
| <parameter name="component" value="$Form" /> |
| <parameter name="RadioGroup" value="3" /> |
| <parameter name="formids" 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" id="RadioGroup0" value="0" /> Small]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup1" checked="checked" value="1" /> Medium]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup2" value="2" /> Large]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup3" 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="direct" /> |
| <parameter name="page" value="Home" /> |
| <parameter name="direct" value="1" /> |
| <parameter name="component" value="dummy" /> |
| <parameter name="formids" 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" id="RadioGroup0" value="0" /> Small]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup1" checked="checked" value="1" /> Medium]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup2" value="2" /> Large]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup3" 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" /> |
| <parameter name="page" value="Home" /> |
| <parameter name="component" value="$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" id="RadioGroup0" disabled="disabled" value="0" /> Small]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup1" checked="checked" disabled="disabled" value="1" /> Medium]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup2" disabled="disabled" value="2" /> Large]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup3" 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" /> |
| <parameter name="page" value="Home" /> |
| <parameter name="component" value="$Form" /> |
| <parameter name="RadioGroup" value="2" /> |
| <parameter name="formids" 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" id="RadioGroup0" disabled="disabled" value="0" /> Small]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup1" checked="checked" disabled="disabled" value="1" /> Medium]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup2" disabled="disabled" value="2" /> Large]]></match> |
| <match><![CDATA[<input type="radio" name="RadioGroup" id="RadioGroup3" 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" /> |
| <parameter name="page" value="NestedGroups" /> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Exception</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output name="Exception Name"> |
| org.apache.hivemind.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" /> |
| <parameter name="page" value="NoGroup" /> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Exception</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output name="Exception Name"> |
| org.apache.hivemind.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> |
| |
| <!-- Now some tests to check for handling of null as the current selection of a RadioGroup. --> |
| |
| <request> |
| <parameter name="service" value="page" /> |
| <parameter name="page" value="NullSelection" /> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[<title>NullSelection</title>]]> |
| </assert-output> |
| |
| <assert-output name="No Choice"> |
| <![CDATA[<input type="radio" name="group" id="group0" checked="checked" value="0" /> No Choice]]> |
| </assert-output> |
| |
| <assert-output name="Tapestry"> |
| <![CDATA[<input type="radio" name="group" id="group1" value="1" /> Tapestry]]> |
| </assert-output> |
| |
| <assert-output name="Struts"> |
| <![CDATA[<input type="radio" name="group" id="group2" value="2" /> Struts]]> |
| </assert-output> |
| |
| <assert-output name="WebWork"> |
| <![CDATA[<input type="radio" name="group" id="group3" value="3" /> WebWork]]> |
| </assert-output> |
| |
| <assert-output name="Selection"> |
| Framework: [] |
| </assert-output> |
| |
| </request> |
| |
| <!-- Submit the form. --> |
| |
| <request> |
| <parameter name="service" value="direct" /> |
| <parameter name="session" value="T" /> |
| <parameter name="page" value="NullSelection" /> |
| <parameter name="component" value="$Form" /> |
| <parameter name="formids" value="group" /> |
| <parameter name="group" value="1" /> |
| |
| <assert-output name="No Choice"> |
| <![CDATA[<input type="radio" name="group" id="group0" value="0" /> No Choice]]> |
| </assert-output> |
| |
| <assert-output name="Tapestry"> |
| <![CDATA[<input type="radio" name="group" id="group1" checked="checked" value="1" /> Tapestry]]> |
| </assert-output> |
| |
| <assert-output name="Struts"> |
| <![CDATA[<input type="radio" name="group" id="group2" value="2" /> Struts]]> |
| </assert-output> |
| |
| <assert-output name="WebWork"> |
| <![CDATA[<input type="radio" name="group" id="group3" 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" /> |
| <parameter name="session" value="T" /> |
| <parameter name="page" value="NullSelection" /> |
| <parameter name="component" value="$Form" /> |
| <parameter name="formids" value="group" /> |
| |
| <assert-output name="No Choice"> |
| <![CDATA[<input type="radio" name="group" id="group0" checked="checked" value="0" /> No Choice]]> |
| </assert-output> |
| |
| <assert-output name="Tapestry"> |
| <![CDATA[<input type="radio" name="group" id="group1" value="1" /> Tapestry]]> |
| </assert-output> |
| |
| <assert-output name="Struts"> |
| <![CDATA[<input type="radio" name="group" id="group2" value="2" /> Struts]]> |
| </assert-output> |
| |
| <assert-output name="WebWork"> |
| <![CDATA[<input type="radio" name="group" id="group3" value="3" /> WebWork]]> |
| </assert-output> |
| |
| <assert-output name="Selection"> |
| Framework: [] |
| </assert-output> |
| |
| </request> |
| |
| <request> |
| <parameter name="service" value="page" /> |
| <parameter name="page" value="LanguageSelection" /> |
| |
| <assert-output name="Selected Language"> |
| Selected Language: [] |
| </assert-output> |
| |
| <assert-output name="Java"> |
| <![CDATA[<input type="radio" name="group" id="group0" value="0" /> Java]]> |
| </assert-output> |
| |
| <assert-output name="C#"> |
| <![CDATA[<input type="radio" name="group" id="group1" value="1" /> C#]]> |
| </assert-output> |
| |
| <assert-output name="C#"> |
| <![CDATA[<input type="radio" name="group" id="group2" value="2" /> Python]]> |
| </assert-output> |
| </request> |
| |
| <request> |
| <parameter name="service" value="direct" /> |
| <parameter name="session" value="T" /> |
| <parameter name="page" value="LanguageSelection" /> |
| <parameter name="component" value="form" /> |
| <parameter name="formids" 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" id="group0" value="0" /> Java]]> |
| </assert-output> |
| |
| <assert-output name="C#"> |
| <![CDATA[<input type="radio" name="group" id="group1" value="1" /> C#]]> |
| </assert-output> |
| |
| <assert-output name="C#"> |
| <![CDATA[<input type="radio" name="group" id="group2" checked="checked" value="2" /> Python]]> |
| </assert-output> |
| </request> |
| |
| </mock-test> |