blob: 2a5a45173ac478cb80c9985783643b32222ba580 [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="junit"/>
<servlet name="mock" class="org.apache.tapestry.ApplicationServlet">
<init-parameter
name="org.apache.tapestry.application-specification"
value="/org/apache/tapestry/junit/mock/app/Mock.application"/>
</servlet>
<request>
<assert-output name="Page Title">
<![CDATA[
<title>Mock App Home Page</title>
]]>
</assert-output>
<assert-output name="DirectLink with parameters">
<![CDATA[
<a href="/junit/mock?service=direct/0/Home/link&amp;sp=2&amp;sp=d3.5&amp;sp=SHello">
]]>
</assert-output>
<assert-output-matches name="Page structure" subgroup="1">
<![CDATA[
<(/?\w+)(\s*\w+=".*?")*\s*/?>
]]>
<match>html</match>
<match>head</match>
<match>meta</match>
<match>title</match>
<match>/title</match>
<match>link</match>
<match>/head</match>
<match>body</match>
<!-- Generated by the ServiceLink -->
<match>a</match>
<match>/a</match>
<!-- This ugliness is care of TestLocalization, which is why
I started doing lots of little tiny contexts, so the tests
wouldn't interfere with each other. -->
<match>foo</match>
<match>/foo</match>
<match>/body</match>
<match>/html</match>
</assert-output-matches>
</request>
<request>
<parameter name="service" value="direct/0/Home/link"/>
<parameter name="sp">
<value>2</value>
<value>d3.5</value>
<value>Hello</value>
</parameter>
<assert-output-matches name="Cells" subgroup="1">
<![CDATA[
<td>(.*?)</td>
]]>
<match>0</match>
<match>java.lang.Integer</match>
<match>2</match>
<match>1</match>
<match>java.lang.Double</match>
<match>3.5</match>
<match>2</match>
<match>java.lang.String</match>
<match>Hello</match>
</assert-output-matches>
<assert-output name="PageLink (for library page).">
<![CDATA[
<a href="/junit/mock?service=page/lib:Dumper">
]]>
</assert-output>
<assert name="HttpSession created">
request.session != null
</assert>
</request>
<!-- Click the "refresh" link and check that the persistent state is still there. -->
<request>
<parameter name="service" value="page/lib:Dumper"/>
<assert-output-matches name="Cells (after refresh)" subgroup="1">
<![CDATA[
<td>(.*?)</td>
]]>
<match>0</match>
<match>java.lang.Integer</match>
<match>2</match>
<match>1</match>
<match>java.lang.Double</match>
<match>3.5</match>
<match>2</match>
<match>java.lang.String</match>
<match>Hello</match>
</assert-output-matches>
</request>
<!-- Return to the Home page, ensure that the DirectLink renders the stateful flag. -->
<request>
<assert-output name="Page Title">
<![CDATA[
<title>Mock App Home Page</title>
]]>
</assert-output>
<assert-output name="DirectLink with parameters">
<![CDATA[
<a href="/junit/mock?service=direct/1/Home/link&amp;sp=2&amp;sp=d3.5&amp;sp=SHello">
]]>
</assert-output>
</request>
<request>
<parameter name="service" value="page/lib:Properties"/>
<assert-output name="Page Name">
Page Name: [lib:Properties]
</assert-output>
</request>
</mock-test>