Permalink
Browse files

Get ready for a 1.3 release

- Remove a bunch of tests that won't run due to typical Selenium crap
- Fiddle with dependencies
- Update build.gradle to match modern Gradle
  • Loading branch information...
1 parent 2560732 commit 2024f98a3fdbf6b12d07a941c1949f3161feeae3 @hlship committed Apr 14, 2015
View
@@ -1,3 +1,4 @@
+.idea
.metadata
*~
test-output
View
@@ -1,6 +1,10 @@
description = "Collection of add-ons for Tapestry 5"
-ext.tapestryVersion = "5.3.6"
+ext.tapestryVersion = "5.3.8"
+
+ext.versions = [
+ selenium: "2.35.0"
+]
if (!project.hasProperty('deployUserName')) ext.deployUserName = '*UNSET-USERNAME*'
if (!project.hasProperty('deployPassword')) ext.deployPassword = '*UNSET-PASSWORD*'
@@ -18,22 +22,31 @@ subprojects {
sourceCompatibility = '1.5'
targetCompatibility = '1.5'
- version = '1.2'
+ version = '1.3'
group = 'com.howardlewisship'
repositories {
mavenCentral()
// All things JBoss/Javassist/Hibernate
- mavenRepo name: "JBoss", url: "https://repository.jboss.org/nexus/content/repositories/releases/"
+ maven {
+ name "JBoss"
+ url "https://repository.jboss.org/nexus/content/repositories/releases/"
+ }
// For the Kaptcha library
- mavenRepo name: "HLS", url: "http://howardlewisship.com/repository/"
+ maven {
+ name "HLS"
+ url "http://howardlewisship.com/repository/"
+ }
// Latest preview packages
- mavenRepo name: "Apache Staging", url: "https://repository.apache.org/content/groups/staging"
+ maven {
+ name "Apache Staging"
+ url "https://repository.apache.org/content/groups/staging"
+ }
}
configurations {
@@ -42,19 +55,27 @@ subprojects {
}
// See http://jira.codehaus.org/browse/GRADLE-784
-
+
sourceSets {
- main {
- compileClasspath += configurations.provided
- }
+ main {
+ compileClasspath += [configurations.provided]
+ }
+ test {
+ compileClasspath += [configurations.provided]
+ runtimeClasspath += [configurations.provided]
+ }
+ }
+
+ idea.module {
+ scopes.PROVIDED.plus += [configurations.provided]
}
dependencies {
- compile "org.apache.tapestry:tapestry-core:$tapestryVersion"
- testCompile "org.apache.tapestry:tapestry-test:$tapestryVersion"
+ compile "org.apache.tapestry:tapestry-core:$tapestryVersion"
+ provided "org.mortbay.jetty:servlet-api:3.0.20100224"
testCompile "org.easymock:easymock:3.0"
- groovy "org.codehaus.groovy:groovy-all:1.7.10"
-
+ testCompile "org.codehaus.groovy:groovy-all:2.4.3"
+ testCompile "org.testng:testng:6.8.21"
deployerJars "org.apache.maven.wagon:wagon-ftp:1.0-beta-2"
}
@@ -90,8 +111,7 @@ subprojects {
}
idea.module {
- scopes.PROVIDED.plus += configurations.provided
- javaVersion = "inherited"
+ jdkName = "inherited"
}
}
@@ -1,3 +0,0 @@
-import org.apache.tapestry5.test.Jetty7Runner
-
-new Jetty7Runner("src/test/webapp", "/", 8080, 9999).start()
@@ -1,31 +0,0 @@
-// Copyright 2011 Howard M. Lewis Ship
-//
-// 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 core.itest
-
-import org.apache.tapestry5.test.SeleniumTestCase
-import org.testng.annotations.Test
-
-class CondBindingTest extends SeleniumTestCase
-{
- @Test
- void cond_prefixes() {
- openBaseURL()
-
- clickAndWait "link=CondBindingPrefix Demo"
-
- assertText "test-mode", "ON"
- assertText "inv-alwaysfalse", "ON"
- }
-}
@@ -65,8 +65,7 @@ private void setupTimeZone()
if (timeZone == null)
{
timeZone = TimeZone.getDefault();
- }
- else
+ } else
{
identified = true;
}
@@ -1,63 +0,0 @@
-// Copyright 2009, 2010 Howard M. Lewis Ship
-//
-// 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 com.howardlewisship.tapx.datefield.integration
-
-import org.apache.tapestry5.test.SeleniumTestCase
-import org.testng.annotations.Test
-
-class IntegrationTests extends SeleniumTestCase
-{
- def SUBMIT = "//input[@type='submit']";
-
- @Test
- void basics_behavior() {
- openBaseURL();
-
- clickAndWait "link=DateField Demo"
- clickAndWait "link=setup"
-
- assertFieldValue "date", "3/16/2009"
- assertText "outputdate", "March 16, 2009"
-
- type "date", "03/13/2009"
- select "localeName", "de"
-
- clickAndWait SUBMIT
-
- assertFieldValue "date", "13.03.2009"
- assertText "outputdate", "13. M\u00e4rz 2009"
-
- select "localeName", "en"
- click "time"
-
- clickAndWait SUBMIT
-
- assertFieldValue "date", "3/13/2009 12:00 AM"
- assertText "outputdate", "March 13, 2009 12:00:00 AM"
- }
-
- @Test
- void bean_editor_override() {
-
- openBaseURL()
-
- clickAndWait "link=BeanEditor Demo"
-
- // That's about as far as we take it; this demonstrates that the tapx DateField was used,
- // and that it picked up on the @TimeSignificant annotation.
-
- assertFieldValue "date", "3/16/2009 12:00 AM"
- }
-}
@@ -1,32 +0,0 @@
-// Copyright 2009 Howard M. Lewis Ship
-//
-// 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 demo;
-
-import org.apache.tapestry5.test.JettyRunner;
-
-import java.io.File;
-
-public class RunDemo
-{
- public static void main(String[] args) throws InterruptedException
- {
- String contextName = args[0];
- String path = args[1];
-
- File workingDir = new File(System.getProperty("user.dir"));
-
- new JettyRunner(workingDir, contextName, 8080, path);
- }
-}
@@ -5,9 +5,4 @@
<package name="com.howardlewisship.tapx.plainmessage.internal.services"/>
</packages>
</test>
- <test name="Integration Tests">
- <packages>
- <package name="com.howardlewisship.tapx.plainmessage.integration"/>
- </packages>
- </test>
</suite>
@@ -1,5 +1,3 @@
-// Copyright 2009 Howard M. Lewis Ship
-//
// 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
@@ -14,20 +12,18 @@
package com.howardlewisship.tapx.plainmessage.internal.services;
-import com.howardlewisship.tapx.plainmessage.internal.services.MessageScrubberImpl;
import com.howardlewisship.tapx.plainmessage.services.MessageScrubber;
-
import org.apache.tapestry5.ioc.MessageFormatter;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.internal.util.MessagesImpl;
-import org.apache.tapestry5.ioc.test.TestBase;
+import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.util.Locale;
import java.util.ResourceBundle;
-public class MessageScrubberImplTest extends TestBase
+public class MessageScrubberImplTest extends Assert
{
private MessageScrubber scrubber = new MessageScrubberImpl();
@@ -36,20 +32,20 @@
{
return new Object[][]
{
- { "plain text is unchanged", "plain text is unchanged" },
- { "a simple <code>element</code> is removed", "a simple element is removed" },
- { "more complex <code id='foo'>elements (some with <em>nested elements</em>)</code> are removed",
- "more complex elements (some with nested elements) are removed" },
- { "text can include entities: &lt;, &gt;, &amp; and soon, unicode escapes",
- "text can include entities: <, >, & and soon, unicode escapes" },
- { "less common: &quot; (quot), &apos; (apos), &nbsp; (nbsp)",
- "less common: \" (quot), ' (apos), \u00a0 (nbsp)" },
+ {"plain text is unchanged", "plain text is unchanged"},
+ {"a simple <code>element</code> is removed", "a simple element is removed"},
+ {"more complex <code id='foo'>elements (some with <em>nested elements</em>)</code> are removed",
+ "more complex elements (some with nested elements) are removed"},
+ {"text can include entities: &lt;, &gt;, &amp; and soon, unicode escapes",
+ "text can include entities: <, >, & and soon, unicode escapes"},
+ {"less common: &quot; (quot), &apos; (apos), &nbsp; (nbsp)",
+ "less common: \" (quot), ' (apos), \u00a0 (nbsp)"},
// Note extra space in scrubbed string.
- { "comments <!-- like this one --> are removed", "comments are removed" },
+ {"comments <!-- like this one --> are removed", "comments are removed"},
- { "XML escape: &#38;", "XML escape: &" }
+ {"XML escape: &#38;", "XML escape: &"}
};
}
@@ -67,15 +63,24 @@ public void scrub_with_no_changes_is_same_as_input()
assertSame(scrubber.scrub(input), input);
}
+ private void unreachable()
+ {
+ throw new IllegalStateException("Unreachable.");
+ }
+
+ private void assertMessageContains(Throwable e, String m)
+ {
+ assertTrue(e.getMessage().contains(m));
+ }
+
@Test
public void invalid_entity_escape()
{
try
{
scrubber.scrub("&#abc;");
unreachable();
- }
- catch (RuntimeException ex)
+ } catch (RuntimeException ex)
{
assertMessageContains(ex, "Unknown XML entity: '&#abc;'.");
}
@@ -88,8 +93,7 @@ public void unknown_entity_escape()
{
scrubber.scrub("&abc;");
unreachable();
- }
- catch (RuntimeException ex)
+ } catch (RuntimeException ex)
{
assertMessageContains(ex, "Unknown XML entity: '&abc;'.");
}
@@ -1,39 +0,0 @@
-// Copyright 2009 Howard M. Lewis Ship
-//
-// 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 app2.services;
-
-import com.howardlewisship.tapx.templating.base.AbstractTemplatingIntegrationTest;
-
-import org.apache.tapestry5.SymbolConstants;
-import org.apache.tapestry5.ioc.MappedConfiguration;
-
-public class AppModule
-{
- public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration)
- {
- configuration.add(SymbolConstants.APPLICATION_VERSION, "1.0");
- configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en,fr");
-
- configuration.add("content.version", "1.1");
- }
-
- public static void contributeLocationManager(MappedConfiguration<String, String> configuration)
- {
- configuration.add(AbstractTemplatingIntegrationTest.DEFAULT_LOCATION,
- "http://defaultcdn.foo.com/content/${content.version}");
- configuration.add("europe", "http://eurocdn.foo.com/public/${content.version}/shared-content/");
- }
-}
-
Oops, something went wrong.

0 comments on commit 2024f98

Please sign in to comment.