Updated Branches: refs/heads/5.3 73be2a542 -> f73b9ff9b
separate tests so we can tear down each instance of selenium and have a new context for test to pass regularly Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/f73b9ff9 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/f73b9ff9 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/f73b9ff9 Branch: refs/heads/5.3 Commit: f73b9ff9b9e69cbc97635454bf54915b86799edb Parents: 73be2a5 Author: Massimo Lusetti <[email protected]> Authored: Tue Apr 23 14:12:42 2013 +0200 Committer: Massimo Lusetti <[email protected]> Committed: Tue Apr 23 14:12:42 2013 +0200 ---------------------------------------------------------------------- tapestry-spring/src/test/conf/testng.xml | 10 ++ ...pestryExternalSpringContextIntegrationTest.java | 31 ------ .../spring/TapestrySpringIntegrationTest.java | 85 --------------- ...pestryExternalSpringContextIntegrationTest.java | 31 ++++++ .../standard/TapestrySpringIntegrationTest.java | 85 +++++++++++++++ 5 files changed, 126 insertions(+), 116 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f73b9ff9/tapestry-spring/src/test/conf/testng.xml ---------------------------------------------------------------------- diff --git a/tapestry-spring/src/test/conf/testng.xml b/tapestry-spring/src/test/conf/testng.xml index bf1b800..4bce998 100644 --- a/tapestry-spring/src/test/conf/testng.xml +++ b/tapestry-spring/src/test/conf/testng.xml @@ -22,4 +22,14 @@ <package name="org.apache.tapestry5.internal.spring"/> </packages> </test> + <test name="Tapestry Spring Integration - Standard"> + <packages> + <package name="org.apache.tapestry5.spring.integration.standard"/> + </packages> + </test> + <test name="Tapestry Spring Integration - External Configuration"> + <packages> + <package name="org.apache.tapestry5.spring.integration.external"/> + </packages> + </test> </suite> http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f73b9ff9/tapestry-spring/src/test/java/org/apache/tapestry5/spring/TapestryExternalSpringContextIntegrationTest.java ---------------------------------------------------------------------- diff --git a/tapestry-spring/src/test/java/org/apache/tapestry5/spring/TapestryExternalSpringContextIntegrationTest.java b/tapestry-spring/src/test/java/org/apache/tapestry5/spring/TapestryExternalSpringContextIntegrationTest.java deleted file mode 100644 index 3dfd8d5..0000000 --- a/tapestry-spring/src/test/java/org/apache/tapestry5/spring/TapestryExternalSpringContextIntegrationTest.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2011 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.spring; - -import org.apache.tapestry5.test.SeleniumTestCase; -import org.apache.tapestry5.test.TapestryTestConfiguration; -import org.testng.annotations.Test; - -@TapestryTestConfiguration(webAppFolder = "src/test/webapp1") -public class TapestryExternalSpringContextIntegrationTest extends SeleniumTestCase -{ - @Test - public void external_context_integration_test() throws Exception - { - openBaseURL(); - - assertTextPresent("Demonstrates Spring Context Configured Externally", "Instantiated via a factory bean."); - } -} http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f73b9ff9/tapestry-spring/src/test/java/org/apache/tapestry5/spring/TapestrySpringIntegrationTest.java ---------------------------------------------------------------------- diff --git a/tapestry-spring/src/test/java/org/apache/tapestry5/spring/TapestrySpringIntegrationTest.java b/tapestry-spring/src/test/java/org/apache/tapestry5/spring/TapestrySpringIntegrationTest.java deleted file mode 100644 index 05c94c2..0000000 --- a/tapestry-spring/src/test/java/org/apache/tapestry5/spring/TapestrySpringIntegrationTest.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2007, 2008, 2009, 2011 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.spring; - -import org.apache.tapestry5.test.SeleniumTestCase; -import org.apache.tapestry5.test.TapestryTestConfiguration; -import org.testng.annotations.Test; - -@TapestryTestConfiguration(webAppFolder = "src/test/webapp") -public class TapestrySpringIntegrationTest extends SeleniumTestCase -{ - @Test - public void integration_test() throws Exception - { - openBaseURL(); - - type("input", "paris in the springtime"); - clickAndWait("//input[@value='Convert']"); - - assertFieldValue("input", "PARIS IN THE SPRINGTIME"); - } - - @Test - public void access_to_spring_context() throws Exception - { - openBaseURL(); - - String text = getText("beans"); - assertTrue(text.contains("upcase")); - } - - @Test - public void customize_pipeline_is_invoked() throws Exception - { - openBaseURL(); - - assertText("message", "SPRING VERSION 3.1.0.RELEASE: PIPELINE WAS INVOKED"); - } - - @Test - public void too_many_spring_beans_are_assignable() - { - open(getBaseURL() + "bedrock"); - - assertTextPresent( - "Spring context contains 2 beans assignable to type org.example.testapp.services.Flintstone: barney, fred."); - } - - @Test - public void factory_provided_beans_accessible() throws Exception - { - openBaseURL(); - - assertEquals(getText("viaFactory"), "Instantiated via a factory bean."); - } - - @Test - public void symbol_bean_factory_post_processor() throws Exception - { - openBaseURL(); - - assertEquals(getText("symbolValueHolder"), "Start page is 'start', Value from Spring is 'Hello'"); - } - - @Test - public void no_conflict_on_injected_locale() throws Exception - { - openBaseURL(); - - assertEquals(getText("locale"), "en"); - assertEquals(getText("selector"), "en"); - } -} http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f73b9ff9/tapestry-spring/src/test/java/org/apache/tapestry5/spring/integration/external/TapestryExternalSpringContextIntegrationTest.java ---------------------------------------------------------------------- diff --git a/tapestry-spring/src/test/java/org/apache/tapestry5/spring/integration/external/TapestryExternalSpringContextIntegrationTest.java b/tapestry-spring/src/test/java/org/apache/tapestry5/spring/integration/external/TapestryExternalSpringContextIntegrationTest.java new file mode 100644 index 0000000..7f3d6ca --- /dev/null +++ b/tapestry-spring/src/test/java/org/apache/tapestry5/spring/integration/external/TapestryExternalSpringContextIntegrationTest.java @@ -0,0 +1,31 @@ +// Copyright 2011 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.spring.integration.external; + +import org.apache.tapestry5.test.SeleniumTestCase; +import org.apache.tapestry5.test.TapestryTestConfiguration; +import org.testng.annotations.Test; + +@TapestryTestConfiguration(webAppFolder = "src/test/webapp1") +public class TapestryExternalSpringContextIntegrationTest extends SeleniumTestCase +{ + @Test + public void external_context_integration_test() throws Exception + { + openBaseURL(); + + assertTextPresent("Demonstrates Spring Context Configured Externally", "Instantiated via a factory bean."); + } +} http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f73b9ff9/tapestry-spring/src/test/java/org/apache/tapestry5/spring/integration/standard/TapestrySpringIntegrationTest.java ---------------------------------------------------------------------- diff --git a/tapestry-spring/src/test/java/org/apache/tapestry5/spring/integration/standard/TapestrySpringIntegrationTest.java b/tapestry-spring/src/test/java/org/apache/tapestry5/spring/integration/standard/TapestrySpringIntegrationTest.java new file mode 100644 index 0000000..776b1ef --- /dev/null +++ b/tapestry-spring/src/test/java/org/apache/tapestry5/spring/integration/standard/TapestrySpringIntegrationTest.java @@ -0,0 +1,85 @@ +// Copyright 2007, 2008, 2009, 2011 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.spring.integration.standard; + +import org.apache.tapestry5.test.SeleniumTestCase; +import org.apache.tapestry5.test.TapestryTestConfiguration; +import org.testng.annotations.Test; + +@TapestryTestConfiguration(webAppFolder = "src/test/webapp") +public class TapestrySpringIntegrationTest extends SeleniumTestCase +{ + @Test + public void integration_test() throws Exception + { + openBaseURL(); + + type("input", "paris in the springtime"); + clickAndWait("//input[@value='Convert']"); + + assertFieldValue("input", "PARIS IN THE SPRINGTIME"); + } + + @Test + public void access_to_spring_context() throws Exception + { + openBaseURL(); + + String text = getText("beans"); + assertTrue(text.contains("upcase")); + } + + @Test + public void customize_pipeline_is_invoked() throws Exception + { + openBaseURL(); + + assertText("message", "SPRING VERSION 3.1.0.RELEASE: PIPELINE WAS INVOKED"); + } + + @Test + public void too_many_spring_beans_are_assignable() + { + open(getBaseURL() + "bedrock"); + + assertTextPresent( + "Spring context contains 2 beans assignable to type org.example.testapp.services.Flintstone: barney, fred."); + } + + @Test + public void factory_provided_beans_accessible() throws Exception + { + openBaseURL(); + + assertEquals(getText("viaFactory"), "Instantiated via a factory bean."); + } + + @Test + public void symbol_bean_factory_post_processor() throws Exception + { + openBaseURL(); + + assertEquals(getText("symbolValueHolder"), "Start page is 'start', Value from Spring is 'Hello'"); + } + + @Test + public void no_conflict_on_injected_locale() throws Exception + { + openBaseURL(); + + assertEquals(getText("locale"), "en"); + assertEquals(getText("selector"), "en"); + } +}
