Return-Path: Delivered-To: apmail-struts-commits-archive@locus.apache.org Received: (qmail 44605 invoked from network); 2 Aug 2008 02:35:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Aug 2008 02:35:15 -0000 Received: (qmail 8379 invoked by uid 500); 2 Aug 2008 02:35:14 -0000 Delivered-To: apmail-struts-commits-archive@struts.apache.org Received: (qmail 8348 invoked by uid 500); 2 Aug 2008 02:35:14 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 8339 invoked by uid 99); 2 Aug 2008 02:35:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2008 19:35:14 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Aug 2008 02:34:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E9C7723889B7; Fri, 1 Aug 2008 19:34:12 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r681928 - in /struts/struts2/trunk/apps/showcase: ./ src/main/resources/ src/main/webapp/tags/ui/ src/test/java/it/ src/test/java/it/org/ src/test/java/it/org/apache/ src/test/java/it/org/apache/struts2/ src/test/java/it/org/apache/struts2/... Date: Sat, 02 Aug 2008 02:34:12 -0000 To: commits@struts.apache.org From: musachy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080802023412.E9C7723889B7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: musachy Date: Fri Aug 1 19:34:11 2008 New Revision: 681928 URL: http://svn.apache.org/viewvc?rev=681928&view=rev Log: Add some integration tests Added: struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/actionTagExampleCalled.jsp struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/actionTagExampleCalling.jsp struts/struts2/trunk/apps/showcase/src/test/java/it/ struts/struts2/trunk/apps/showcase/src/test/java/it/org/ struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/ struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/ struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ActionTagExampleTest.java (with props) struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ComponentTagExampleTest.java (with props) struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ITBaseTest.java (with props) struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ParameterUtils.java (with props) struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/UITagExampleTest.java (with props) Modified: struts/struts2/trunk/apps/showcase/pom.xml struts/struts2/trunk/apps/showcase/src/main/resources/struts-tags-ui.xml struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/example.jsp struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/index.jsp Modified: struts/struts2/trunk/apps/showcase/pom.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/pom.xml?rev=681928&r1=681927&r2=681928&view=diff ============================================================================== --- struts/struts2/trunk/apps/showcase/pom.xml (original) +++ struts/struts2/trunk/apps/showcase/pom.xml Fri Aug 1 19:34:11 2008 @@ -181,6 +181,32 @@ 1.1.1 + + net.sourceforge.jwebunit + jwebunit-core + 1.4.1 + test + + + + commons-httpclient + commons-httpclient + 3.1 + test + + + + net.sourceforge.jwebunit + jwebunit-htmlunit-plugin + 1.4.1 + test + + + xom + xom + + + @@ -211,19 +237,52 @@ + + org.twdata.maven + maven-itblast-plugin + 0.3 + + + integration-test + + execute + + + tomcat5x,jetty6x,jboss42x,resin3x + + + + + + maven-surefire-plugin + + + it/** + **/*$* + + + - - - - src/main/resources - - - src/main/java - - **/*.java - - - + + + + + src/main/resources + + + src/main/java + + **/*.java + + + + + + twdata-m2-repository + twdata.org Maven Repository + http://twdata-m2-repository.googlecode.com/svn/ + + Modified: struts/struts2/trunk/apps/showcase/src/main/resources/struts-tags-ui.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/resources/struts-tags-ui.xml?rev=681928&r1=681927&r2=681928&view=diff ============================================================================== --- struts/struts2/trunk/apps/showcase/src/main/resources/struts-tags-ui.xml (original) +++ struts/struts2/trunk/apps/showcase/src/main/resources/struts-tags-ui.xml Fri Aug 1 19:34:11 2008 @@ -3,7 +3,7 @@ - + @@ -40,26 +40,30 @@ - + /tags/ui/treeExampleDynamic.jsp - + - + /tags/ui/treeExampleAjaxDynamic.jsp - + /tags/ui/componentTagExample.jsp - + + + /tags/ui/actionTagExampleCalled.jsp + /tags/ui/actionTagExampleCalling.jsp + - + - - + + /tags/ui/staticTreeSelect.jsp @@ -68,6 +72,6 @@ /tags/ui/dynamicTreeSelect.jsp - + Added: struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/actionTagExampleCalled.jsp URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/actionTagExampleCalled.jsp?rev=681928&view=auto ============================================================================== --- struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/actionTagExampleCalled.jsp (added) +++ struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/actionTagExampleCalled.jsp Fri Aug 1 19:34:11 2008 @@ -0,0 +1,2 @@ +<%@taglib prefix="s" uri="/struts-tags" %> +This text is from the called class \ No newline at end of file Added: struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/actionTagExampleCalling.jsp URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/actionTagExampleCalling.jsp?rev=681928&view=auto ============================================================================== --- struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/actionTagExampleCalling.jsp (added) +++ struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/actionTagExampleCalling.jsp Fri Aug 1 19:34:11 2008 @@ -0,0 +1,14 @@ +<%@taglib prefix="s" uri="/struts-tags" %> + + + +Showcase - Tags - UI Tags - Action Tag + + + Example 1: + This example calls an action and includes the output on the page +

+ +

+ + \ No newline at end of file Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/example.jsp URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/example.jsp?rev=681928&r1=681927&r2=681928&view=diff ============================================================================== --- struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/example.jsp (original) +++ struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/example.jsp Fri Aug 1 19:34:11 2008 @@ -16,8 +16,8 @@ - @@ -25,13 +25,13 @@ tooltip="Select Your Birthday" label="Birthday" name="birthday" /> - + - + - + - + - - + + - + Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/index.jsp URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/index.jsp?rev=681928&r1=681927&r2=681928&view=diff ============================================================================== --- struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/index.jsp (original) +++ struts/struts2/trunk/apps/showcase/src/main/webapp/tags/ui/index.jsp Fri Aug 1 19:34:11 2008 @@ -6,7 +6,7 @@

UI Tags

- +
  • UI Example
  • UI Example (Velocity)
  • @@ -16,6 +16,7 @@
  • Tree Example (dynamic)
  • Tree Example (dynamic ajax loading)
  • Component Tag Example +
  • Action Tag Example
  • DateTime picker tag - Pick a date
  • DateTime picker tag - Pick a time
  • <%--li>UI population using iterator tag Added: struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ActionTagExampleTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ActionTagExampleTest.java?rev=681928&view=auto ============================================================================== --- struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ActionTagExampleTest.java (added) +++ struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ActionTagExampleTest.java Fri Aug 1 19:34:11 2008 @@ -0,0 +1,29 @@ +/* + * $Id$ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 it.org.apache.struts2.showcase; + +public class ActionTagExampleTest extends ITBaseTest { + public void test() { + beginAt("/tags/ui/actionTagExample!input.action"); + assertTextPresent("This text is from the called class"); + } + +} Propchange: struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ActionTagExampleTest.java ------------------------------------------------------------------------------ svn:keywords = Id Added: struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ComponentTagExampleTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ComponentTagExampleTest.java?rev=681928&view=auto ============================================================================== --- struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ComponentTagExampleTest.java (added) +++ struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ComponentTagExampleTest.java Fri Aug 1 19:34:11 2008 @@ -0,0 +1,31 @@ +/* + * $Id$ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 it.org.apache.struts2.showcase; + +public class ComponentTagExampleTest extends ITBaseTest { + public void test() { + beginAt("/tags/ui/componentTagExample.jsp"); + assertTextPresent("Freemarker Custom Template - parameter 'paramName' - paramValue1"); + assertTextPresent("Freemarker Custom Template - parameter 'paramName' - paramValue4"); + assertTextPresent("JSP Custom Template - parameter 'paramName' - paramValue2"); + assertTextPresent("JSP Custom Template - parameter 'paramName' - paramValue3"); + } +} Propchange: struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ComponentTagExampleTest.java ------------------------------------------------------------------------------ svn:keywords = Id Added: struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ITBaseTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ITBaseTest.java?rev=681928&view=auto ============================================================================== --- struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ITBaseTest.java (added) +++ struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ITBaseTest.java Fri Aug 1 19:34:11 2008 @@ -0,0 +1,30 @@ +/* + * $Id$ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 it.org.apache.struts2.showcase; + +import net.sourceforge.jwebunit.junit.WebTestCase; + +public abstract class ITBaseTest extends WebTestCase { + + public void setUp() throws Exception { + getTestContext().setBaseUrl(ParameterUtils.getBaseUrl()); + } +} Propchange: struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ITBaseTest.java ------------------------------------------------------------------------------ svn:keywords = Id Added: struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ParameterUtils.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ParameterUtils.java?rev=681928&view=auto ============================================================================== --- struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ParameterUtils.java (added) +++ struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ParameterUtils.java Fri Aug 1 19:34:11 2008 @@ -0,0 +1,32 @@ +/* + * $Id$ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 it.org.apache.struts2.showcase; + +public class ParameterUtils { + + public static String getBaseUrl() { + String port = System.getProperty("http.port"); + if (port == null) { + port = "8080"; + } + return "http://localhost:"+port+"/struts2-showcase"; + } +} Propchange: struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/ParameterUtils.java ------------------------------------------------------------------------------ svn:keywords = Id Added: struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/UITagExampleTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/UITagExampleTest.java?rev=681928&view=auto ============================================================================== --- struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/UITagExampleTest.java (added) +++ struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/UITagExampleTest.java Fri Aug 1 19:34:11 2008 @@ -0,0 +1,55 @@ +/* + * $Id$ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 it.org.apache.struts2.showcase; + +public class UITagExampleTest extends ITBaseTest { + public void testInputForm() { + setScriptingEnabled(false); + beginAt("/tags/ui/example!input.action"); + assertFormPresent("exampleSubmit"); + // text box + assertFormElementPresent("name"); + // textarea + assertFormElementPresent("bio"); + // select + assertFormElementPresent("favouriteColor"); + // checkbox list + assertFormElementPresent("friends"); + // checkbox + assertFormElementPresent("legalAge"); + + // set fields + setTextField("name", "name"); + setTextField("bio", "bio"); + selectOption("favouriteColor", "Red"); + checkCheckbox("friends", "Patrick"); + checkCheckbox("friends", "Jason"); + checkCheckbox("legalAge"); + + submit(); + + assertTextInElement("name", "name"); + assertTextInElement("bio", "bio"); + assertTextInElement("favouriteColor", "Red"); + assertTextInElement("friends", "[Patrick, Jason]"); + assertTextInElement("legalAge", "true"); + } +} Propchange: struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/UITagExampleTest.java ------------------------------------------------------------------------------ svn:keywords = Id