blob: c664049758d61ecc4d49431660284b1c6fd66ac9 [file] [log] [blame]
<?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="mock" root="context13"/>
<servlet name="app" class="org.apache.tapestry.ApplicationServlet"/>
<request>
<assert-output name="Page Title">
<![CDATA[
<title>Home</title>
]]>
</assert-output>
<assert-output name="Internal Redirect Link">
<![CDATA[
href="/mock/app?service=direct/0/Home/internal"
]]>
</assert-output>
<assert-output name="External Redirect Link">
<![CDATA[
href="/mock/app?service=direct/0/Home/external"
]]>
</assert-output>
<assert-output name="Null Redirect Link">
<![CDATA[
href="/mock/app?service=direct/0/Home/null"
]]>
</assert-output>
<assert-output name="Servlet Exception Redirect Link">
<![CDATA[
href="/mock/app?service=direct/0/Home/servletException"
]]>
</assert-output>
<assert-output name="Missing Redirect Link">
<![CDATA[
href="/mock/app?service=direct/0/Home/missing"
]]>
</assert-output>
<assert-output name="Index Redirect Link">
<![CDATA[
href="/mock/app?service=direct/0/Home/index"
]]>
</assert-output>
<assert-output name="Fail External Redirect Link">
<![CDATA[
href="/mock/app?service=direct/0/Home/failExternal"
]]>
</assert-output>
</request>
<request>
<parameter name="service" value="direct/0/Home/internal"/>
<assert-output name="Page Title">
<![CDATA[
<title>Warning</title>
]]>
</assert-output>
<assert-output name="Message">
This page is static, forwarded to by the Tapestry application.
</assert-output>
</request>
<request>
<parameter name="service" value="direct/0/Home/external"/>
<assert name="Redirect Location">
response.redirectLocation.equals("http://jakarta.apache.org/tapestry")
</assert>
</request>
<request>
<parameter name="service" value="direct/0/Home/null"/>
<assert-output name="Page Title">
<![CDATA[
<title>Exception</title>
]]>
</assert-output>
<assert-output name="Message">
Unable to find a request dispatcher for local resource 'NULL'.
</assert-output>
</request>
<request>
<parameter name="service" value="direct/0/Home/servletException"/>
<assert-output name="Page Title">
<![CDATA[
<title>Exception</title>
]]>
</assert-output>
<assert-output name="Exception Message">
Unable to forward to local resource 'FAIL_SERVLET'.
</assert-output>
<assert-output name="Servlet Exception Message">
Test-directed ServletException from RequestDispatcher forward().
</assert-output>
</request>
<request>
<parameter name="service" value="direct/0/Home/missing"/>
<assert-output name="Page Title">
<![CDATA[
<title>Exception</title>
]]>
</assert-output>
<assert-output name="Exception Message">
Unable to forward to local resource 'Missing.html'.
</assert-output>
<assert-output name="FileNotFoundException">
java.io.FileNotFoundException
</assert-output>
</request>
<request>
<parameter name="service" value="direct/0/Home/index"/>
<assert-output name="Page Title">
<![CDATA[
<title>Index Page</title>
]]>
</assert-output>
<assert-output name="Message">
<![CDATA[
<a href="app">Tapestry Application</a>
]]>
</assert-output>
</request>
<request>
<parameter name="service" value="direct/0/Home/failExternal"/>
<assert-output name="Page Title">
<![CDATA[
<title>Exception</title>
]]>
</assert-output>
<assert-output name="Exception Message">
Unable to redirect to http://somehost/FAIL_IO.
</assert-output>
<assert-output name="IOException">
java.io.IOException
</assert-output>
<assert-output name="IOException message.">
Forced IOException in MockResponse.sendRedirect().
</assert-output>
</request>
</mock-test>