You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by ro...@apache.org on 2009/07/18 00:53:32 UTC
svn commit: r795264 [3/3] - in /tapestry/tapestry5/trunk: src/site/apt/dev/
src/site/apt/guide/
tapestry-core/src/main/java/org/apache/tapestry5/annotations/
tapestry-core/src/main/java/org/apache/tapestry5/internal/
tapestry-core/src/main/java/org/apa...
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/MixinWorkerTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/MixinWorkerTest.java?rev=795264&r1=795263&r2=795264&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/MixinWorkerTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/MixinWorkerTest.java Fri Jul 17 22:53:30 2009
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009 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.
@@ -21,6 +21,7 @@
import org.apache.tapestry5.services.ComponentClassResolver;
import org.apache.tapestry5.services.TransformConstants;
import org.testng.annotations.Test;
+import org.easymock.EasyMock;
public class MixinWorkerTest extends InternalBaseTestCase
{
@@ -41,12 +42,13 @@
}
@Test
- public void field_with_explicit_type()
+ public void field_with_explicit_type_and_order()
{
ComponentClassResolver resolver = mockComponentClassResolver();
ClassTransformation transformation = mockClassTransformation();
MutableComponentModel model = mockMutableComponentModel();
- Mixin annotation = newMixin("Bar");
+ String[] order = {"before:*"};
+ Mixin annotation = newMixin("Bar",order);
train_findFieldsWithAnnotation(transformation, Mixin.class, "fred");
train_getFieldAnnotation(transformation, "fred", Mixin.class, annotation);
@@ -54,7 +56,7 @@
train_resolveMixinTypeToClassName(resolver, "Bar", "foo.bar.BazMixin");
- model.addMixinClassName("foo.bar.BazMixin");
+ model.addMixinClassName("foo.bar.BazMixin",order);
transformation.makeReadOnly("fred");
@@ -75,18 +77,19 @@
}
@Test
- public void field_with_no_specific_mixin_type()
+ public void field_with_no_specific_mixin_type_or_order()
{
ComponentClassResolver resolver = mockComponentClassResolver();
ClassTransformation transformation = mockClassTransformation();
MutableComponentModel model = mockMutableComponentModel();
- Mixin annotation = newMixin("");
+ String[] order = new String[0];
+ Mixin annotation = newMixin("",order);
train_findFieldsWithAnnotation(transformation, Mixin.class, "fred");
train_getFieldAnnotation(transformation, "fred", Mixin.class, annotation);
train_getFieldType(transformation, "fred", "foo.bar.Baz");
- model.addMixinClassName("foo.bar.Baz");
+ model.addMixinClassName("foo.bar.Baz",order);
transformation.makeReadOnly("fred");
@@ -113,12 +116,12 @@
expect(resolver.resolveMixinTypeToClassName(mixinType)).andReturn(mixinClassName);
}
- private Mixin newMixin(String value)
+ private Mixin newMixin(String value,String...order)
{
Mixin annotation = newMock(Mixin.class);
expect(annotation.value()).andReturn(value);
-
+ expect(annotation.order()).andReturn(order);
return annotation;
}
}
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/BindParameterComponentContainer.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/BindParameterComponentContainer.tml?rev=795264&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/BindParameterComponentContainer.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/BindParameterComponentContainer.tml Fri Jul 17 22:53:30 2009
@@ -0,0 +1,21 @@
+<!--
+ ~ Copyright 2009 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.
+ -->
+
+<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
+
+ <t:bindparametercomponent/>
+
+</t:container>
\ No newline at end of file
Copied: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BindParameterDemo.tml (from r786676, tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ParameterDefault.tml)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BindParameterDemo.tml?p2=tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BindParameterDemo.tml&p1=tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ParameterDefault.tml&r1=786676&r2=795264&rev=795264&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ParameterDefault.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BindParameterDemo.tml Fri Jul 17 22:53:30 2009
@@ -1,6 +1,32 @@
-<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
-
+<!--
+ ~ Copyright 2009 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.
+ -->
- Echo component default: [<t:echo t:id="echo"/>]
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
+ <t:form>
+ <t:textfield t:id="testmixin" value="myproperty" t:mixins="echovalue"/>
+ <t:textfield t:id="testmixin2" value="myproperty2" t:mixins="echovalue2"/>
+ <t:textfield t:id="testmixin3" value="myproperty3" t:mixins="echovalue3"/>
+ <t:textfield t:id="multimixins" value="myproperty4" t:mixins="echovalue::before:*, echovalue2::before:echovalue3, echovalue3"/>
+ <t:textonlyondisabledtextfield t:id="defaultbinding" value="myproperty5" disabled="true" t:mixins="echovalue"/>
+ </t:form>
+
+ <div id="mypropertyoutput">${myproperty}</div>
+ <div id="mypropertyoutput2">${myproperty2}</div>
+ <div id="mypropertyoutput3">${myproperty3}</div>
+ <div id="mypropertyoutput4">${myproperty4}</div>
+ <div id="mypropertyoutput5">${myproperty5}</div>
</html>
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BindParameterNoSuchParameter.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BindParameterNoSuchParameter.tml?rev=795264&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BindParameterNoSuchParameter.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BindParameterNoSuchParameter.tml Fri Jul 17 22:53:30 2009
@@ -0,0 +1,21 @@
+<!--
+ ~ Copyright 2009 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.
+ -->
+
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
+
+ <t:any t:id="throwexception" t:mixins="echovalue2"/>
+
+</html>
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BindParameterOnComponent.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BindParameterOnComponent.tml?rev=795264&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BindParameterOnComponent.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BindParameterOnComponent.tml Fri Jul 17 22:53:30 2009
@@ -0,0 +1,21 @@
+<!--
+ ~ Copyright 2009 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.
+ -->
+
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
+
+ <t:bindparametercomponentcontainer t:id="throwexception"/>
+
+</html>
Copied: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/MissingComponentClassException.tml (from r786676, tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BadTemplate.tml)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/MissingComponentClassException.tml?p2=tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/MissingComponentClassException.tml&p1=tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BadTemplate.tml&r1=786676&r2=795264&rev=795264&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BadTemplate.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/MissingComponentClassException.tml Fri Jul 17 22:53:30 2009
@@ -1,12 +1,29 @@
+<!--
+ ~ Copyright 2009 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.
+ -->
+
<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
- <p>
- This template is not well formed.</p>
+ <p>
+ This template has a component with an undeterminable component class (not properly declared in either the
+ template or the containing component class).</p>
- <t:foobar>content from template</foobar>
+ <input t:id="componentwithnotype" value="someproperty"/>
- <p>
- This page is used to test exception reporting.
+ <p>
+ This page is used to test exception reporting.
</p>
</html>
\ No newline at end of file
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/MixinOrderingDemo.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/MixinOrderingDemo.tml?rev=795264&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/MixinOrderingDemo.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/MixinOrderingDemo.tml Fri Jul 17 22:53:30 2009
@@ -0,0 +1,47 @@
+<!--
+ ~ Copyright 2009 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.
+ -->
+
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
+
+ <t:form>
+ <p>
+ Explicit and implicit ordering, all in template, using globbing:
+ </p>
+ <t:textfield t:id="order1" value="myproperty" t:mixins="echovalue::before:*, echovalue2::before:echovalue3, echovalue3"/>
+
+ <p>
+ Explicit and implicit ordering, all in template, no globbing, but multiple order constraints specified for at least one mixin:
+ </p>
+ <t:textfield t:id="order2" value="myproperty" t:mixins="echovalue::after:echovalue2;after:echovalue3, echovalue2::after:echovalue3, echovalue3"/>
+
+ <p>Mixture of template, @Mixins, and @MixinClasses ordering, all ordered.</p>
+ <input t:id="order3" value="myproperty" t:mixins="echovalue3::before:echovalue"/>
+
+ <p>Mixture of template, @Mixins, and @MixinClasses, with the only constraints specified in the template and @Mixins</p>
+ <input t:id="order4" value="myproperty" t:mixins="echovalue3::before:echovalue"/>
+
+ <p>Mixture of template, @Mixins, and @MixinClasses, with the only constraints specified in the template and @MixinClasses</p>
+ <input t:id="order5" value="myproperty" t:mixins="echovalue3::after:echovalue"/>
+
+ <p>Mixture of template, @Mixins, @MixinClasses, and @Mixin ordering. Note that all of the above also include @Mixin without explicit ordering constraints since textfield has an implementation mixin.</p>
+ <input t:id="order6" disabled="true" value="myproperty" t:mixins="echovalue::before:echovalue3"/>
+
+ <p>Mingling mixin after with mixin before</p>
+ <!-- the constraint on echoafter2 should have no effect. -->
+ <t:textfield t:id="order7" value="myproperty" t:mixins="echovalue::before:echovalue2, echovalue2, echoafter::after:echoafter2, echoafter2::before:echovalue"/>
+ </t:form>
+
+</html>
Modified: tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry5/test/AbstractIntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry5/test/AbstractIntegrationTestSuite.java?rev=795264&r1=795263&r2=795264&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry5/test/AbstractIntegrationTestSuite.java (original)
+++ tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry5/test/AbstractIntegrationTestSuite.java Fri Jul 17 22:53:30 2009
@@ -187,7 +187,7 @@
{
for (String item : text)
{
- if (isTextPresent(item)) return;
+ if (isTextPresent(item)) continue;
System.err.printf("Text pattern '%s' not found in:\n%s\n\n", item, selenium
.getHtmlSource());