| <?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="c10" root="context10"/> |
| |
| <servlet name="app" class="org.apache.tapestry.ApplicationServlet"/> |
| |
| <request> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Home</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output name="First Link"> |
| <![CDATA[ |
| <a href="/c10/app?service=direct/0/Home/first">First</a> |
| ]]> |
| </assert-output> |
| |
| |
| <assert-output name="Second Link"> |
| <![CDATA[ |
| <a href="http://junit-test/c10/app?service=direct/0/Home/second">Second</a> |
| ]]> |
| </assert-output> |
| |
| <assert-output name="Configured Values"> |
| |
| Expecting: https://myserver:8080 |
| |
| </assert-output> |
| |
| <assert-output name="Third Link"> |
| <![CDATA[ |
| <a href="https://myserver:8080/c10/app?service=direct/0/Home/third#myanchor">Third</a> |
| ]]> |
| </assert-output> |
| |
| <assert-output name="Fourth Link"> |
| [Fourth] |
| </assert-output> |
| |
| |
| </request> |
| |
| <request> |
| <parameter name="service" value="page/Two"/> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Exception</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output name="Message"> |
| ILinkComponents may not be nested. |
| </assert-output> |
| |
| </request> |
| |
| <!-- Check that ensures links with event handlers are inside a Body. --> |
| |
| <request> |
| <parameter name="service" value="page/Three"/> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Exception</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output name="Message"> |
| A link component with multiple functions for a single event type must be contained within a Body. |
| </assert-output> |
| |
| </request> |
| |
| <!-- Test same thing on a page with a Body --> |
| |
| <request> |
| <parameter name="service" value="page/Four"/> |
| |
| <assert-output name="Page Title"> |
| <![CDATA[ |
| <title>Four</title> |
| ]]> |
| </assert-output> |
| |
| <assert-output name="Composite Method"> |
| function onClick_Link () |
| { |
| eventHandler1(); |
| eventHandler2(); |
| eventHandler3(); |
| } |
| </assert-output> |
| |
| <assert-output name="Link"> |
| <![CDATA[ |
| <a href="/c10/app?service=direct/0/Four/link" onClick="javascript:onClick_Link();"> |
| ]]> |
| </assert-output> |
| |
| |
| </request> |
| |
| </mock-test> |