Author: jkuhnert
Date: Sun Jun 17 15:12:46 2007
New Revision: 548126
URL: http://svn.apache.org/viewvc?view=rev&rev=548126
Log:
-) Made mock controls not strict.
-) Took out snapshot / useless dependencies in pom.
Modified:
tapestry/tapestry-test/trunk/pom.xml
tapestry/tapestry-test/trunk/src/java/org/apache/tapestry/TestBase.java
tapestry/tapestry-test/trunk/src/site/apt/components.apt
tapestry/tapestry-test/trunk/src/site/apt/easymock.apt
tapestry/tapestry-test/trunk/src/site/apt/gettingstarted.apt
tapestry/tapestry-test/trunk/src/test/java/org/apache/tapestry/TestBaseTest.java
Modified: tapestry/tapestry-test/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/tapestry/tapestry-test/trunk/pom.xml?view=diff&rev=548126&r1=548125&r2=548126
==============================================================================
--- tapestry/tapestry-test/trunk/pom.xml (original)
+++ tapestry/tapestry-test/trunk/pom.xml Sun Jun 17 15:12:46 2007
@@ -85,36 +85,7 @@
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-framework</artifactId>
- <version>4.1.2-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>javassist</artifactId>
- <version>3.4.ga</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>hivemind</groupId>
- <artifactId>hivemind</artifactId>
- <version>1.1.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>hivemind</groupId>
- <artifactId>hivemind-lib</artifactId>
- <version>1.1.1</version>
- <scope>compile</scope>
- </dependency>
- <!-- Really, a transitive dependency of hivemind. -->
- <dependency>
- <groupId>oro</groupId>
- <artifactId>oro</artifactId>
- <version>2.0.8</version>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
+ <version>4.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -141,36 +112,6 @@
</exclusions>
</dependency>
<dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.3</version>
- </dependency>
- <dependency>
- <groupId>ognl</groupId>
- <artifactId>ognl</artifactId>
- <version>2.7-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.2</version>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.7.0</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.3</version>
- </dependency>
- <dependency>
<groupId>org.openqa.selenium.client-drivers</groupId>
<artifactId>selenium-java-client-driver</artifactId>
<version>0.9.2-SNAPSHOT</version>
@@ -208,7 +149,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.4-SNAPSHOT</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/conf/testng.xml</suiteXmlFile>
@@ -218,7 +158,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <version>2.1-SNAPSHOT</version>
<configuration>
<archive>
<compress>true</compress>
@@ -229,7 +168,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.0</version>
<inherited>true</inherited>
<configuration>
<source>1.5</source>
@@ -238,12 +176,6 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.3-SNAPSHOT</version>
- <inherited>true</inherited>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<inherited>true</inherited>
<executions>
@@ -254,6 +186,11 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.1.1</version>
+ </plugin>
</plugins>
</build>
@@ -262,7 +199,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.4-SNAPSHOT</version>
<inherited>true</inherited>
</plugin>
<plugin>
@@ -273,7 +209,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.1-SNAPSHOT</version>
<inherited>true</inherited>
<reportSets>
<reportSet>
@@ -296,7 +231,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.2-SNAPSHOT</version>
<configuration>
<linksource>true</linksource>
<tags>
@@ -342,33 +276,10 @@
<repositories>
<repository>
- <id>apache.snapshots</id>
- <url>http://people.apache.org/repo/m2-snapshot-repository</url>
- </repository>
- <repository>
<id>openqa</id>
<name>OpenQA Maven Repository</name>
<url>http://maven.openqa.org/</url>
</repository>
</repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <id>apache.snapshots</id>
- <url>http://people.apache.org/repo/m2-snapshot-repository</url>
- </pluginRepository>
- <pluginRepository>
- <id>tapestry.javaforge</id>
- <url>http://howardlewisship.com/repository</url>
- </pluginRepository>
- <pluginRepository>
- <id>codehaus.org</id>
- <url>http://snapshots.repository.codehaus.org</url>
- </pluginRepository>
- <pluginRepository>
- <id>codehaus.org</id>
- <url>http://repository.codehaus.org</url>
- </pluginRepository>
- </pluginRepositories>
-
+
</project>
Modified:
tapestry/tapestry-test/trunk/src/java/org/apache/tapestry/TestBase.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry-test/trunk/src/java/org/apache/tapestry/TestBase.java?view=diff&rev=548126&r1=548125&r2=548126
==============================================================================
--- tapestry/tapestry-test/trunk/src/java/org/apache/tapestry/TestBase.java
(original)
+++ tapestry/tapestry-test/trunk/src/java/org/apache/tapestry/TestBase.java Sun
Jun 17 15:12:46 2007
@@ -1,7 +1,7 @@
package org.apache.tapestry;
import org.apache.tapestry.test.Creator;
-import static org.easymock.EasyMock.createStrictControl;
+import static org.easymock.EasyMock.createControl;
import org.easymock.IMocksControl;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
@@ -30,11 +30,11 @@
{
private static class ControlSource extends ThreadLocal<IMocksControl>
{
- /** Creates a strick control for <em>this</em> thread. */
+ /** Creates a new control for <em>this</em> thread. */
@Override
protected IMocksControl initialValue()
{
- return createStrictControl();
+ return createControl();
}
}
Modified: tapestry/tapestry-test/trunk/src/site/apt/components.apt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry-test/trunk/src/site/apt/components.apt?view=diff&rev=548126&r1=548125&r2=548126
==============================================================================
--- tapestry/tapestry-test/trunk/src/site/apt/components.apt (original)
+++ tapestry/tapestry-test/trunk/src/site/apt/components.apt Sun Jun 17
15:12:46 2007
@@ -53,10 +53,10 @@
The following sections will expand further on each part of the test used.
-*
{{{./apidocs/org/apache/tapestry/BaseComponentTestCase.html}BaseComponentTestCase}}
+*
{{{apidocs/org/apache/tapestry/BaseComponentTestCase.html}BaseComponentTestCase}}
- In almost all of the core Taptestry test cases
{{{./apidocs/org/apache/tapestry/BaseComponentTestCase.html}BaseComponentTestCase}}
is the actual test class extended. It provides
- a number of additional conveniences not found in the basic
{{{./apidocs/org/apache/tapestry/TestBase.html}TestBase}} class - such as being
able to create a buffered
+ In almost all of the core Taptestry test cases
{{{apidocs/org/apache/tapestry/BaseComponentTestCase.html}BaseComponentTestCase}}
is the actual test class extended. It provides
+ a number of additional conveniences not found in the basic
{{{apidocs/org/apache/tapestry/TestBase.html}TestBase}} class - such as being
able to create a buffered
{{{http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/IMarkupWriter.html}IMarkupWriter}}
instance that allows you to check the string produced from a component
render instead of having to do mock calls for all of the method invocations
on a mock
{{{http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/IMarkupWriter.html}IMarkupWriter}}
object.
Modified: tapestry/tapestry-test/trunk/src/site/apt/easymock.apt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry-test/trunk/src/site/apt/easymock.apt?view=diff&rev=548126&r1=548125&r2=548126
==============================================================================
--- tapestry/tapestry-test/trunk/src/site/apt/easymock.apt (original)
+++ tapestry/tapestry-test/trunk/src/site/apt/easymock.apt Sun Jun 17 15:12:46
2007
@@ -12,7 +12,7 @@
code to make testing feasible. The tapestry-test library provides a few
conveniences to make managing mock objects a
little easier in your own unit tests.
- For example, if you were using {{{http://easymock.org}EasyMock}} without
extending {{{./apidocs/org/apache/tapestry/TestBase.html}TestBase}} you
+ For example, if you were using {{{http://easymock.org}EasyMock}} without
extending {{{apidocs/org/apache/tapestry/TestBase.html}TestBase}} you
might have to write a test looking something like this:
+-------------------------------------------------------------------------------------------------------------------------
@@ -53,10 +53,10 @@
+-------------------------------------------------------------------------------------------------------------------------
In particular you want to note that we had to pass in each mock we created
in the <<<replay(mw, cycle)>>> method of {{{http://easymock.org}EasyMock}}. This
- can get a little unweildy / painfaul at times so
{{{./apidocs/org/apache/tapestry/TestBase.html}TestBase}} has made this part
easier by keeping track of your
+ can get a little unweildy / painfaul at times so
{{{apidocs/org/apache/tapestry/TestBase.html}TestBase}} has made this part
easier by keeping track of your
mock objects for you.
- The same class above re-written to use the
{{{./apidocs/org/apache/tapestry/TestBase.html}TestBase}} features would look
more like:
+ The same class above re-written to use the
{{{apidocs/org/apache/tapestry/TestBase.html}TestBase}} features would look
more like:
+-------------------------------------------------------------------------------------------------------------------------
import org.apache.tapestry.IMarkupWriter;
Modified: tapestry/tapestry-test/trunk/src/site/apt/gettingstarted.apt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry-test/trunk/src/site/apt/gettingstarted.apt?view=diff&rev=548126&r1=548125&r2=548126
==============================================================================
--- tapestry/tapestry-test/trunk/src/site/apt/gettingstarted.apt (original)
+++ tapestry/tapestry-test/trunk/src/site/apt/gettingstarted.apt Sun Jun 17
15:12:46 2007
@@ -8,7 +8,7 @@
Simple Test
- There's no better way to get going than by looking at real code. This
example uses the {{{./apidocs/org/apache/tapestry/TestBase.html}TestBase}}
class as
+ There's no better way to get going than by looking at real code. This
example uses the {{{apidocs/org/apache/tapestry/TestBase.html}TestBase}} class
as
the main class to extend from.
This isn't a requirement with {{{http://testng.org}TestNG}} - but it does
make some things a lot easier. <(such as managing
@@ -41,7 +41,7 @@
* Assertions
The previous example used a {{{http://testng.org}}} <<<assertEquals(actual,
expected)>>> utiltity method to do equality checking. It is provided in the
- {{{./apidocs/org/apache/tapestry/TestBase.html}TestBase}} class as a
convenience, but you could do the same thing in your own tests with a static
import of
+ {{{apidocs/org/apache/tapestry/TestBase.html}TestBase}} class as a
convenience, but you could do the same thing in your own tests with a static
import of
the {{{http://testng.org/javadocs/org/testng/Assert.html}Assert}} class like
this:
+-------------------------------------------------------------------------------------------------------------------------
Modified:
tapestry/tapestry-test/trunk/src/test/java/org/apache/tapestry/TestBaseTest.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry-test/trunk/src/test/java/org/apache/tapestry/TestBaseTest.java?view=diff&rev=548126&r1=548125&r2=548126
==============================================================================
---
tapestry/tapestry-test/trunk/src/test/java/org/apache/tapestry/TestBaseTest.java
(original)
+++
tapestry/tapestry-test/trunk/src/test/java/org/apache/tapestry/TestBaseTest.java
Sun Jun 17 15:12:46 2007
@@ -106,7 +106,7 @@
@SuppressWarnings("unchecked")
@Test
- public void verify_that_method_invocation_order_counts()
+ public void verify_that_method_invocation_order_doesnt_count()
{
Object o = new Object();
List l1 = newMock(List.class);
@@ -134,16 +134,7 @@
setReturnValue(true);
replay();
-
- try
- {
- // Violated the script, did not invoke method on l1 first.
- l2.add(o);
- unreachable();
- }
- catch (AssertionError ex)
- {
- assertTrue(ex.getMessage().contains("Unexpected method call"));
- }
+
+ l2.add(o);
}
}