[Tapestry-commits] CVS: Tapestry/junit/src/net/sf/tapestry/junit/mock TestTemplateExpr.xml,NONE,1.1.
Brought to you by:
hship
|
From: Howard L. S. <hs...@us...> - 2002-11-30 03:33:22
|
Update of /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/mock
In directory sc8-pr-cvs1:/tmp/cvs-serv15444/junit/src/net/sf/tapestry/junit/mock
Modified Files:
Tag: hship-2-3
MockTestCase.java
Added Files:
Tag: hship-2-3
TestTemplateExpr.xml
Log Message:
Add support for providing expressions in component templates.
--- NEW FILE: TestTemplateExpr.xml ---
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id -->
<!-- Fill in some code-coverage gaps in the page service. -->
<mock-test>
<context name="mock"/>
<servlet name="app" class="net.sf.tapestry.ApplicationServlet">
<init-parameter
name="net.sf.tapestry.application-specification"
value="/net/sf/tapestry/junit/mock/app/Mock.application"/>
</servlet>
<request>
<parameter name="service" value="page"/>
<parameter name="context" value="TemplateExpr"/>
<assert-output name="Valid use of template expression">
<![CDATA[
Application Name: JUnit Mock Application
]]>
</assert-output>
<assert-output name="Specifying informal parameters">
<![CDATA[
Second example: <span class="styleClass">JUnit Mock Application</span>
]]>
</assert-output>
</request>
<request>
<parameter name="service" value="page"/>
<parameter name="context" value="TemplateExprConflict"/>
<assert-output name="Page Title">
<![CDATA[
<title>Exception</title>
]]>
</assert-output>
<assert-output name="Error Message">
An expression for parameter 'value' of component TemplateExprConflict/insertApplicationName in the template for TemplateExprConflict conflicts with an existing binding in the specification.
</assert-output>
</request>
<request>
<parameter name="service" value="page"/>
<parameter name="context" value="TemplateExprInformal"/>
<assert-output name="Page Title">
<![CDATA[
<title>Exception</title>
]]>
</assert-output>
<assert-output name="Error Message">
Component TemplateExprInformal/ifTest allows only formal parameters, binding value is not allowed.
</assert-output>
</request>
<request>
<parameter name="service" value="page"/>
<parameter name="context" value="TemplateExprReserved"/>
<assert-output name="Page Title">
<![CDATA[
<title>Exception</title>
]]>
</assert-output>
<assert-output name="Error Message">
The template for TemplateExprReserved contains an expression for parameter 'href' of component TemplateExprReserved/link, but 'href' is a reserved parameter name.
</assert-output>
</request>
</mock-test>
Index: MockTestCase.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/mock/MockTestCase.java,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -C2 -d -r1.10 -r1.10.2.1
*** MockTestCase.java 27 Nov 2002 17:58:52 -0000 1.10
--- MockTestCase.java 30 Nov 2002 03:33:19 -0000 1.10.2.1
***************
*** 147,149 ****
--- 147,161 ----
attempt("/net/sf/tapestry/junit/mock/TestValidFieldNoBody.xml");
}
+
+ /**
+ * A series of tests for components where parameters are bound
+ * to expressions in the template, using the new "[[ expression ]]" syntax.
+ *
+ **/
+
+ public void testTemplateExpressions()
+ throws Exception
+ {
+ attempt("/net/sf/tapestry/junit/mock/TestTemplateExpr.xml");
+ }
}
|