Author: ate
Date: Wed Nov 23 08:06:46 2005
New Revision: 348471
URL: http://svn.apache.org/viewcvs?rev=348471&view=rev
Log:
Revert back to jmock-1.0.1 deps, and thus removing the last SNAPSHOT dep.
Fixed by embedding the one and only (simple) feature we used from the SNAPSHOT
dep inside the testcase (TestWindows)
Modified:
portals/jetspeed-2/trunk/.classpath
portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/window/TestWindows.java
portals/jetspeed-2/trunk/core-build.xml
portals/jetspeed-2/trunk/layout-portlets/project.xml
Modified: portals/jetspeed-2/trunk/.classpath
URL:
http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/.classpath?rev=348471&r1=348470&r2=348471&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/.classpath (original)
+++ portals/jetspeed-2/trunk/.classpath Wed Nov 23 08:06:46 2005
@@ -82,7 +82,7 @@
<classpathentry kind="var"
path="MAVEN_REPO/commons-dbcp/jars/commons-dbcp-1.2.1.jar"/>
<classpathentry kind="var"
path="MAVEN_REPO/commons-configuration/jars/commons-configuration-1.0.jar"/>
<classpathentry exported="true" kind="var"
path="MAVEN_REPO/mockrunner/jars/mockrunner-0.2.7.jar"/>
- <classpathentry kind="var"
path="MAVEN_REPO/jmock/jars/jmock-SNAPSHOT.jar"/>
+ <classpathentry kind="var"
path="MAVEN_REPO/jmock/jars/jmock-1.0.1.jar"/>
<classpathentry kind="var"
path="MAVEN_REPO/saxpath/jars/saxpath-1.0-FCS.jar"/>
<classpathentry kind="var"
path="MAVEN_REPO/jaxen/jars/jaxen-1.0-FCS-full.jar"/>
<classpathentry kind="var"
path="MAVEN_REPO/aopalliance/jars/aopalliance-1.0.jar"/>
Modified:
portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/window/TestWindows.java
URL:
http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/window/TestWindows.java?rev=348471&r1=348470&r2=348471&view=diff
==============================================================================
---
portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/window/TestWindows.java
(original)
+++
portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/window/TestWindows.java
Wed Nov 23 08:06:46 2005
@@ -19,6 +19,7 @@
import java.util.HashMap;
import java.util.List;
+import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
@@ -35,8 +36,8 @@
import org.apache.pluto.om.window.PortletWindowListCtrl;
import org.jmock.Mock;
import org.jmock.core.Invocation;
+import org.jmock.core.InvocationMatcher;
import org.jmock.core.matcher.InvokeAtLeastOnceMatcher;
-import org.jmock.core.matcher.InvokeCountMatcher;
import org.jmock.core.matcher.InvokeOnceMatcher;
import org.jmock.core.stub.CustomStub;
import org.jmock.core.stub.ReturnStub;
@@ -169,4 +170,70 @@
}
}
+ /**
+ * Inline copy of InvokeCountMatcher from latest jMock Development
Snapshot: 20050628-175146
+ * so we don't need to depend on their SNAPSHOT release anymore but can
fallback on their 1.0.1 version.
+ * (doesn't seem they are going to release a new real version soon as it
has been ages since 1.0.1 came out)
+ * @author <a href="mailto:[EMAIL PROTECTED]">Ate Douma</a>
+ *
+ */
+ private static class InvokeCountMatcher implements InvocationMatcher
+ {
+ private int invocationCount = 0;
+
+ private int expectedCount;
+
+ public InvokeCountMatcher(int expectedCount)
+ {
+ this.expectedCount = expectedCount;
+ }
+
+ public boolean matches(Invocation invocation)
+ {
+ return getInvocationCount() < expectedCount;
+ }
+
+ public void verify()
+ {
+ verifyHasBeenInvokedExactly(expectedCount);
+ }
+
+ public boolean hasDescription()
+ {
+ return true;
+ }
+
+ public StringBuffer describeTo(StringBuffer buffer)
+ {
+ return buffer.append("expected ").append(expectedCount).append("
times, invoked ").append(
+ getInvocationCount()).append(" times");
+ }
+
+ public int getInvocationCount()
+ {
+ return invocationCount;
+ }
+
+ public boolean hasBeenInvoked()
+ {
+ return invocationCount > 0;
+ }
+
+ public void invoked(Invocation invocation)
+ {
+ invocationCount++;
+ }
+
+ public void verifyHasBeenInvoked()
+ {
+ Assert.assertTrue("expected method was not invoked",
hasBeenInvoked());
+ }
+
+ public void verifyHasBeenInvokedExactly(int expectedCount)
+ {
+ Assert.assertTrue("expected method was not invoked the expected
number of times: expected " + expectedCount
+ + " times, was invoked " + invocationCount + "
times", invocationCount == expectedCount);
+ }
+
+ }
}
Modified: portals/jetspeed-2/trunk/core-build.xml
URL:
http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/core-build.xml?rev=348471&r1=348470&r2=348471&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/core-build.xml (original)
+++ portals/jetspeed-2/trunk/core-build.xml Wed Nov 23 08:06:46 2005
@@ -214,7 +214,7 @@
<!-- Unit testing -->
<dependency>
<id>jmock</id>
- <version>SNAPSHOT</version>
+ <version>1.0.1</version>
<properties>
<war.bundle>false</war.bundle>
</properties>
Modified: portals/jetspeed-2/trunk/layout-portlets/project.xml
URL:
http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/layout-portlets/project.xml?rev=348471&r1=348470&r2=348471&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/layout-portlets/project.xml (original)
+++ portals/jetspeed-2/trunk/layout-portlets/project.xml Wed Nov 23 08:06:46
2005
@@ -145,7 +145,7 @@
<!-- Unit testing -->
<dependency>
<id>jmock</id>
- <version>SNAPSHOT</version>
+ <version>1.0.1</version>
<properties>
<war.bundle>false</war.bundle>
</properties>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]