Author: hlship
Date: Tue Dec 15 17:47:38 2009
New Revision: 890913
URL: http://svn.apache.org/viewvc?rev=890913&view=rev
Log:
Complete conversion of IntegrationTests
Added:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/AssetTests.java
(with props)
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/LoopTests.java
(with props)
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/MixinTests.java
(with props)
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/CoreBehaviorsTests.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/FormTests.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GeneralComponentTests.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GridTests.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/ZoneTests.java
tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml?rev=890913&r1=890912&r2=890913&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml Tue Dec 15
17:47:38 2009
@@ -14,7 +14,7 @@
time as Selenium-based integration tests. See TAPESTRY-2561.
-->
<suite name="Tapestry Core" annotations="1.5" verbose="2">
- <test name="Component Unit Tests" enabled="false">
+ <test name="Component Unit Tests" enabled="true">
<packages>
<package name="org.apache.tapestry5.integration.pagelevel"/>
<package name="org.apache.tapestry5.corelib.base"/>
@@ -22,7 +22,7 @@
<package name="org.apache.tapestry5.corelib.internal"/>
</packages>
</test>
- <test name="Public APIs" enabled="false">
+ <test name="Public APIs" enabled="true">
<packages>
<package name="org.apache.tapestry5"/>
<package name="org.apache.tapestry5.dom"/>
@@ -34,7 +34,7 @@
<package name="org.apache.tapestry5.validator"/>
</packages>
</test>
- <test name="Internal APIs" enabled="false">
+ <test name="Internal APIs" enabled="true">
<packages>
<package name="org.apache.tapestry5.internal"/>
<package name="org.apache.tapestry5.internal.beaneditor"/>
@@ -51,11 +51,7 @@
</packages>
</test>
<!-- We break these out by which of the test applications they apply to. We
have a bunch. -->
- <!--
- <test name="Integration Tests"> <packages> <package
name="org.apache.tapestry5.integration"/>
- </packages> </test>
- -->
- <test name="Core Integration Tests">
+ <test name="Core Integration Tests" enabled="true">
<parameter name="tapestry.web-app-folder" value="src/test/app1"/>
<classes>
<class name="org.apache.tapestry5.test.SeleniumLauncher"/>
Added:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/AssetTests.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/AssetTests.java?rev=890913&view=auto
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/AssetTests.java
(added)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/AssetTests.java
Tue Dec 15 17:47:38 2009
@@ -0,0 +1,90 @@
+// 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.
+
+package org.apache.tapestry5.integration.core;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.apache.tapestry5.integration.TapestryCoreTestCase;
+import org.apache.tapestry5.internal.TapestryInternalUtils;
+import org.apache.tapestry5.test.TapestryTestConstants;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+public class AssetTests extends TapestryCoreTestCase
+{
+ @DataProvider
+ private Object[][] asset_data()
+ {
+ return new Object[][]
+ {
+ { "icon", "src/test/app1/images/tapestry_banner.gif" },
+ { "button",
+
"src/test/resources/org/apache/tapestry5/integration/app1/pages/nested/tapestry-button.png"
},
+ { "viaContext", "src/test/app1/images/asf_logo_wide.gif" } };
+ }
+
+ @Test(dataProvider = "asset_data")
+ public void assets(String id, String localPath) throws Exception
+ {
+ clickThru("AssetDemo");
+
+ // Test for https://issues.apache.org/jira/browse/TAPESTRY-1935
+
+ // assertSourcePresent("<link href=\"/css/app.css\" rel=\"stylesheet\"
type=\"text/css\">");
+
+ // Read the byte stream for the asset and compare to the real copy.
+
+ String assetURL = getAttribute(String.format("//i...@id='%s']/@src",
id));
+
+ compareDownloadedAsset(assetURL, localPath);
+ }
+
+ private void compareDownloadedAsset(String assetURL, String localPath)
throws Exception
+ {
+ System.out.printf("compare %s to %s\n", assetURL, localPath);
+
+ // Strip off the leading slash
+
+ URL url = new URL(getBaseURL() + assetURL.substring(1));
+
+ byte[] downloaded = readContent(url);
+
+ File local = new File(TapestryTestConstants.MODULE_BASE_DIR,
localPath);
+
+ System.out.printf("Remote URL %s, Local file: %s\n", url, local);
+
+ byte[] actual = readContent(local.toURL());
+
+ assertEquals(downloaded, actual);
+ }
+
+ private byte[] readContent(URL url) throws Exception
+ {
+ InputStream is = new BufferedInputStream(url.openStream());
+
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+
+ TapestryInternalUtils.copy(is, os);
+
+ os.close();
+ is.close();
+
+ return os.toByteArray();
+ }
+}
Propchange:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/AssetTests.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/CoreBehaviorsTests.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/CoreBehaviorsTests.java?rev=890913&r1=890912&r2=890913&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/CoreBehaviorsTests.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/CoreBehaviorsTests.java
Tue Dec 15 17:47:38 2009
@@ -14,9 +14,18 @@
package org.apache.tapestry5.integration.core;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.InputStream;
+import java.net.URL;
+
import org.apache.tapestry5.corelib.mixins.RenderDisabled;
import org.apache.tapestry5.integration.TapestryCoreTestCase;
import org.apache.tapestry5.integration.app1.pages.RenderErrorDemo;
+import org.apache.tapestry5.internal.TapestryInternalUtils;
+import org.apache.tapestry5.test.TapestryTestConstants;
+import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
public class CoreBehaviorsTests extends TapestryCoreTestCase
@@ -1328,10 +1337,85 @@
}
@Test
- public void renderclientid_mixin()
+ public void bindparameter_nomatchingparameter()
{
- clickThru("RenderClientId Mixin");
+ clickThru("BindParameter error handling");
+
+ assertTextPresent(
+ "An unexpected application exception has occurred.",
+ "Failed to BindParameter 'boundParameter' in mixin
'org.apache.tapestry5.integration.app1.mixins.EchoValue2': "
+ + "component
'org.apache.tapestry5.corelib.components.Any' does not provide a matching
parameter "
+ + "(looking for: value). Available parameters:
[clientId, element]");
+
+ }
- assertText("divwithid", "Div Content");
+ @Test
+ public void bindparameter_on_componentfield_throws_exception()
+ {
+ clickThru("BindParameter on component");
+
+ assertTextPresent(
+ "An unexpected application exception has occurred.",
+ "@BindParameter was used on 'value' in component class
'org.apache.tapestry5.integration.app1.components.BindParameterComponent', but
@BindParameter should only be used in mixins");
}
+
+ @Test
+ public void trigger_demo()
+ {
+ clickThru("Trigger Demo");
+
+ assertAttribute(String.format("//scri...@src='%s']/@src",
"some_additional_scripts.js"),
+ "some_additional_scripts.js");
+ assertTextPresent("Event 'provideAdditionalMarkup' handled.");
+ }
+
+ @Test
+ public void xml_content() throws Exception
+ {
+ open(getBaseURL() + "xmlcontent");
+
+ // Commented out ... Selenium can't seem to handle an XML response.
+
+ // assertSourcePresent("<![CDATA[< & >]]>");
+ }
+
+
+
+ /**
+ * This may need to be disabled or dropped from the test suite, I don't
know
+ * that Selenium, especially Selenium
+ * running headless on the CI server, can handle the transition to HTTPS:
+ * there's warnings that pop up about
+ * certificates.
+ * <p/>
+ * Verified: Selenium can't handle this, even with a user manually OK-ing
the certificate
+ * warning dialogs.
+ */
+ @Test(enabled = false)
+ public void secure_page_access()
+ {
+ start("Secure Page Demo");
+
+ assertText("secure", "secure");
+
+ assertText("message", "Triggered from Index");
+
+ clickAndWait("link=click");
+
+ assertText("secure", "secure");
+
+ assertText("message", "Link clicked");
+
+ clickAndWait(SUBMIT);
+
+ assertText("secure", "secure");
+ assertText("message", "Form submitted");
+
+ clickAndWait("link=Back to index");
+
+ // Back to the insecure home page.
+
+ assertText("//h1", "Tapestry 5 Integration Application 1");
+ }
+
}
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/FormTests.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/FormTests.java?rev=890913&r1=890912&r2=890913&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/FormTests.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/FormTests.java
Tue Dec 15 17:47:38 2009
@@ -700,4 +700,82 @@
assertText("name-value", "Betty");
assertText("last-clicked", "Barney");
}
+
+ @Test
+ public void calendar_field_inside_bean_editor()
+ {
+ clickThru("BeanEditor / Calendar Demo", "clear");
+
+ type("calendar", "04/06/1978");
+
+ clickAndWait(SUBMIT);
+
+ assertTextPresent("Apr 6, 1978");
+ }
+
+ @Test
+ public void image_submit_triggers_selected_event()
+ {
+ clickThru("Submit with an Image Demo");
+
+ type("value", "barney gumble");
+
+ clickAndWait("//inp...@type='image']");
+
+ assertText("outputvalue", "barney gumble");
+
+ assertText("eventfired", "true");
+ }
+
+ /**
+ * Tests for forms and form submissions and basic form control components.
+ * also tests a few other things, such as
+ * computed default bindings and invisible instrumentation.
+ */
+ @Test
+ public void simple_form()
+ {
+ clickThru("SimpleForm");
+
+ assertText("//lab...@id='disabled-label']", "Disabled");
+
+ // This demonstrates TAPESTRY-1642:
+ assertText("//lab...@id='email-label']", "User Email");
+
+ assertText("//lab...@id='message-label']", "Incident Message");
+ assertText("//lab...@id='operatingSystem-label']", "Operating System");
+ assertText("//lab...@id='department-label']", "Department");
+ assertText("//lab...@id='urgent-label']", "Urgent Processing
Requested");
+
+ assertFieldValue("email", "");
+ assertFieldValue("message", "");
+ assertFieldValue("operatingSystem", "osx");
+ assertFieldValue("department", "");
+ assertFieldValue("urgent", "on");
+
+ clickAndWait(SUBMIT);
+
+ assertTextPresent("department: []");
+
+ type("email", "[email protected]");
+ type("message", "Message for you, sir!");
+ select("operatingSystem", "Windows NT");
+ select("department", "R&D");
+ click("urgent");
+
+ clickAndWait(SUBMIT);
+
+ assertFieldValue("email", "[email protected]");
+ assertFieldValue("message", "Message for you, sir!");
+ assertFieldValue("urgent", "off");
+
+ // Tried to use "email:" and "exact:email:" but Selenium 0.8.1 doesn't
+ // seem to accept that.
+
+ assertTextPresent("[[email protected]]", "[Message for you, sir!]",
"[false]", "[winnt]",
+ "[RESEARCH_AND_DESIGN]");
+
+ // Haven't figured out how to get selenium to check that fields are
+ // disabled.
+ }
}
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GeneralComponentTests.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GeneralComponentTests.java?rev=890913&r1=890912&r2=890913&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GeneralComponentTests.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GeneralComponentTests.java
Tue Dec 15 17:47:38 2009
@@ -57,4 +57,17 @@
assertText(contextSpan, "1");
}
+
+ /**
+ * TAPESTRY-2333
+ */
+ @Test
+ public void action_links_on_custom_url()
+ {
+ open(getBaseURL() + "nested/actiondemo/");
+
+ clickAndWait("link=2");
+
+ assertTextPresent("Number: 2");
+ }
}
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GridTests.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GridTests.java?rev=890913&r1=890912&r2=890913&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GridTests.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GridTests.java
Tue Dec 15 17:47:38 2009
@@ -290,4 +290,21 @@
assertEquals(count, "7", "Expected seven rows: the header and six data
rows.");
}
+ /**
+ * TAPESTRY-1901
+ */
+ @Test
+ public void delete_rows_from_grid()
+ {
+ clickThru("Delete From Grid", "setup the database", "2");
+
+ for (int i = 6; i <= 10; i++)
+ clickAndWait("link=ToDo #" + i);
+
+ // A rather clumsy way to ensure we're back on the first page.
+
+ for (int i = 1; i <= 5; i++)
+ assertTextPresent("ToDo #" + i);
+ }
+
}
Added:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/LoopTests.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/LoopTests.java?rev=890913&view=auto
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/LoopTests.java
(added)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/LoopTests.java
Tue Dec 15 17:47:38 2009
@@ -0,0 +1,78 @@
+// 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.
+
+package org.apache.tapestry5.integration.core;
+
+import org.apache.tapestry5.integration.TapestryCoreTestCase;
+import org.testng.annotations.Test;
+
+public class LoopTests extends TapestryCoreTestCase
+{
+ /**
+ * TAP5-205
+ */
+ @Test
+ public void handling_of_empty_loop()
+ {
+ clickThru("Empty Loop Demo");
+
+ assertText("first", "");
+ assertText("second", "Source is null.");
+ assertText("third", "Source is the empty list.");
+ }
+
+ @Test
+ public void encoded_loop_inside_a_form()
+ {
+ test_loop_inside_form("ToDo List");
+ }
+
+ @Test
+ public void volatile_loop_inside_a_form()
+ {
+ test_loop_inside_form("ToDo List (Volatile)");
+ }
+
+ private void test_loop_inside_form(String linkLabel)
+ {
+ clickThru(linkLabel);
+
+ clickAndWait("link=reset the database");
+
+ assertFieldValue("title", "End World Hunger");
+ assertFieldValue("title_0", "Develop Faster-Than-Light Travel");
+ assertFieldValue("title_1", "Cure Common Cold");
+
+ type("title", "End World Hunger - today");
+ type("title_0", "Develop Faster-Than-Light Travel - immediately");
+ type("title_1", "Cure Common Cold - post haste");
+
+ clickAndWait("//inp...@value='Update ToDos']");
+
+ assertFieldValue("title", "End World Hunger - today");
+ assertFieldValue("title_0", "Develop Faster-Than-Light Travel -
immediately");
+ assertFieldValue("title_1", "Cure Common Cold - post haste");
+
+ clickAndWait("//inp...@value='Add new ToDo']");
+
+ type("title_2", "Conquer World");
+
+ clickAndWait("//inp...@value='Update ToDos']");
+
+ assertFieldValue("title", "End World Hunger - today");
+ assertFieldValue("title_0", "Develop Faster-Than-Light Travel -
immediately");
+ assertFieldValue("title_1", "Cure Common Cold - post haste");
+ assertFieldValue("title_2", "Conquer World");
+ }
+}
Propchange:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/LoopTests.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/MixinTests.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/MixinTests.java?rev=890913&view=auto
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/MixinTests.java
(added)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/MixinTests.java
Tue Dec 15 17:47:38 2009
@@ -0,0 +1,112 @@
+// 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.
+
+package org.apache.tapestry5.integration.core;
+
+import org.apache.tapestry5.integration.TapestryCoreTestCase;
+import org.testng.annotations.Test;
+
+public class MixinTests extends TapestryCoreTestCase
+{
+ @Test
+ public void renderclientid_mixin()
+ {
+ clickThru("RenderClientId Mixin");
+
+ assertText("divwithid", "Div Content");
+ }
+
+ @Test
+ public void mixin_ordering()
+ {
+ // echo => <original>-before, temporaryvaluefromechovaluemixin,
+ // <original>-after
+ // echo2 => echo2-<original>-before, "3", echo2-<original>-after
+ // echo3 => echo3-<original>-before, "world", echo3-<original>-after
+ // order1: echo, echo2, echo3
+ clickThru("Mixin Ordering Demo");
+
+ assertMixinOrder(1, 0, 1, 2, 3, true);
+ // order2: echo3, echo2, echo
+ assertMixinOrder(2, 2, 3, 0, 1, true);
+ // order3: echo2, echo3, echo
+ assertMixinOrder(3, 3, 0, 2, 1, true);
+ // order4: echo3, echo, echo2
+ assertMixinOrder(4, 3, 1, 0, 2, true);
+ // order5: echo2, echo, echo3
+ assertMixinOrder(5, 2, 0, 1, 3, true);
+ // order6: echo, echo3, echo2, TextOnlyOnDisabled
+ assertMixinOrder(6, 0, 3, 1, 2, false);
+ // make sure mixin after and mixin before constraints don't
interfere...
+ // order7: echo, echo2 <corecomponent> echoafter2, echoafter
+ assertMixinOrder(7, 0, 1, -1, 2, true);
+ assertText("order7_before_but_after",
+
"afterrender_for_mixinafter_isreally_justbefore_corecomponent_afterrender-before");
+ assertText("order7_after_but_before",
+
"afterrender_for_mixinafter_isreally_justbefore_corecomponent_afterrender-after");
+ // echoafter2 should have for its value at the point it renders
+ // the value that echo2 sets, since the core component isn't changing
+ // its value.
+ assertText("order7_before_but_after2", "3-before");
+ assertText("order7_after_but_before2", "3-after");
+ }
+
+ private void assertMixinOrder(int orderNum, int echo1From, int echo2From,
int echo3From,
+ int fieldFrom, boolean isField)
+ {
+ assertEchoMixins("order" + orderNum, "batman", echo1From, echo2From,
echo3From, fieldFrom,
+ isField);
+ }
+
+ /**
+ * asserts that the "echo value" mixins are properly functioning (ie
+ *
+ * @BindParameter, and mixin ordering).
+ * each integer value specifies the echo mixin number
(echovalue => 1,
+ * echovalue2 => 2, echovalue3 => 3; 0 is the original
value)
+ * from which the specified echo mixin is expected to
"receive" its value.
+ * So if echo1From is 2, then the "original value"
+ * printed by echo1 is expected to be the value set by
echo2. If a given
+ * "from" is < 0, checking the corresponding mixin values
is disabled.
+ */
+
+ private void assertEchoMixins(String fieldName, String originalValue, int
echo1From,
+ int echo2From, int echo3From, int fieldFrom, boolean isField)
+ {
+ String[] vals =
+ { originalValue, "temporaryvaluefromechovaluemixin", "3", "world" };
+ String before = fieldName + "_before";
+ String after = fieldName + "_after";
+ if (echo1From > -1)
+ {
+ assertText(before, vals[echo1From] + "-before");
+ assertText(after, vals[echo1From] + "-after");
+ }
+ if (echo2From > -1)
+ {
+ assertText(before + "2", "echo2-" + vals[echo2From] + "-before");
+ assertText(after + "2", "echo2-" + vals[echo2From] + "-after");
+ }
+ if (echo3From > -1)
+ {
+ assertText(before + "3", "echo3-" + vals[echo3From] + "-before");
+ assertText(after + "3", "echo3-" + vals[echo3From] + "-after");
+ }
+ if (isField)
+ assertFieldValue(fieldName, vals[fieldFrom]);
+ else
+ assertText(fieldName, vals[fieldFrom]);
+ }
+
+}
Propchange:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/MixinTests.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/ZoneTests.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/ZoneTests.java?rev=890913&r1=890912&r2=890913&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/ZoneTests.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/ZoneTests.java
Tue Dec 15 17:47:38 2009
@@ -14,6 +14,7 @@
package org.apache.tapestry5.integration.core;
+import org.apache.tapestry5.corelib.components.Form;
import org.apache.tapestry5.corelib.components.Zone;
import org.apache.tapestry5.integration.TapestryCoreTestCase;
import org.testng.annotations.Test;
@@ -195,4 +196,12 @@
assertText("now", now);
}
+ @Test
+ public void zone_inject_component_from_template()
+ {
+ clickThru("Inject Component Demo");
+
+ assertTextPresent(Form.class.getName() + "[form--form]");
+ }
+
}
Modified:
tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java?rev=890913&r1=890912&r2=890913&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
Tue Dec 15 17:47:38 2009
@@ -54,7 +54,10 @@
baseURL = null;
}
- /** Returns the base URL for the application. */
+ /**
+ * Returns the base URL for the application. This is of the typically
+ * <code>http://localhost:9999/</code> (i.e., it includes a trailing
slash).
+ */
public String getBaseURL()
{
return baseURL;