You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(151) |
Sep
(21) |
Oct
(6) |
Nov
(70) |
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(47) |
Feb
(66) |
Mar
(23) |
Apr
(115) |
May
(24) |
Jun
(53) |
Jul
(10) |
Aug
(279) |
Sep
(84) |
Oct
(149) |
Nov
(138) |
Dec
(52) |
2003 |
Jan
(22) |
Feb
(20) |
Mar
(29) |
Apr
(106) |
May
(170) |
Jun
(122) |
Jul
(70) |
Aug
(64) |
Sep
(27) |
Oct
(71) |
Nov
(49) |
Dec
(9) |
2004 |
Jan
(7) |
Feb
(38) |
Mar
(3) |
Apr
(9) |
May
(22) |
Jun
(4) |
Jul
(1) |
Aug
(2) |
Sep
(2) |
Oct
|
Nov
(15) |
Dec
(2) |
2005 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(28) |
Jun
(3) |
Jul
(11) |
Aug
(5) |
Sep
(1) |
Oct
(5) |
Nov
(2) |
Dec
(3) |
2006 |
Jan
(8) |
Feb
(3) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jeff M. <cus...@us...> - 2003-03-18 14:28:49
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/io In directory sc8-pr-cvs1:/tmp/cvs-serv22955/src/jdk/common/com/mockobjects/io Modified Files: MockFile.java MockPrintStream.java Log Message: Pepper Mocks with ReturnValue Index: MockFile.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/io/MockFile.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- MockFile.java 2 Jan 2003 16:04:29 -0000 1.4 +++ MockFile.java 18 Mar 2003 14:28:45 -0000 1.5 @@ -17,40 +17,38 @@ private final ExpectationValue myFilenameFilter = new ExpectationValue("filename filter"); - private String myParent; - private String fileName; + private final ReturnValue myParent = new ReturnValue("parent"); + private final ReturnValue fileName = new ReturnValue("file name"); private final ReturnValue exists = new ReturnValue("exists"); private final ReturnValue mkdirs = new ReturnValue("mkdirs"); private final ReturnValue parentFile = new ReturnValue("parent file"); private final ExpectationCounter mkdirsCounter = new ExpectationCounter("mkdirs counter"); + private final ReturnValue myFilesToReturn = new ReturnValue("files"); + private final ReturnValue file = new ReturnValue("real file"); + private final ReturnValue myPath = new ReturnValue("path"); - private File[] myFilesToReturn; - - private java.io.File file; - private String myPath; - - public void setupGetName(final String name){ - this.fileName = name; + public void setupGetName(final String name) { + this.fileName.setValue(name); } public String getName() { - return fileName; + return (String) fileName.getValue(); } - public void setupGetParent(final String aParent){ - myParent = aParent; + public void setupGetParent(final String aParent) { + myParent.setValue(aParent); } public String getParent() { - return myParent; + return (String) myParent.getValue(); } - public void setupGetParentFile(File parentFile){ + public void setupGetParentFile(File parentFile) { this.parentFile.setValue(parentFile); } public File getParentFile() { - return (File)parentFile.getValue(); + return (File) parentFile.getValue(); } public File createTempFile(String prefix, String suffix, File directory) throws IOException { @@ -68,12 +66,12 @@ return new File[0]; } - public void setupGetPath(String aPath){ - myPath = aPath; + public void setupGetPath(String aPath) { + myPath.setValue(aPath); } public String getPath() { - return myPath; + return (String)myPath.getValue(); } public boolean isAbsolute() { @@ -116,7 +114,7 @@ return false; } - public void setupExists(boolean exists){ + public void setupExists(boolean exists) { this.exists.setValue(exists); } @@ -178,17 +176,17 @@ return new File[0]; } - public void setExpectedFilenameFilter(FilenameFilter aFilenameFilter){ + public void setExpectedFilenameFilter(FilenameFilter aFilenameFilter) { myFilenameFilter.setExpected(aFilenameFilter); } - public void setupListFile(File[] aFilesToReturn){ - myFilesToReturn = aFilesToReturn; + public void setupListFile(File[] aFilesToReturn) { + myFilesToReturn.setValue(aFilesToReturn); } public File[] listFiles(FilenameFilter aFilenameFilter) { myFilenameFilter.setActual(aFilenameFilter); - return myFilesToReturn; + return (File[]) myFilesToReturn.getValue(); } public File[] listFiles(FileFilter filter) { @@ -201,7 +199,7 @@ return false; } - public void setupMkdirs(boolean mkdirs, int count){ + public void setupMkdirs(boolean mkdirs, int count) { mkdirsCounter.setExpected(count); this.mkdirs.setValue(mkdirs); } @@ -236,12 +234,12 @@ return 0; } - public void setupGetRealFile(java.io.File file){ - this.file= file; + public void setupGetRealFile(java.io.File file) { + this.file.setValue(file); } public java.io.File getRealFile() { - return file; + return (java.io.File)file.getValue(); } } Index: MockPrintStream.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/io/MockPrintStream.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockPrintStream.java 13 Apr 2002 15:08:23 -0000 1.1 +++ MockPrintStream.java 18 Mar 2003 14:28:45 -0000 1.2 @@ -1,15 +1,16 @@ package com.mockobjects.io; -import java.io.*; -import junit.framework.*; -import com.mockobjects.*; -import com.mockobjects.util.*; +import com.mockobjects.ExpectationCounter; +import com.mockobjects.ExpectationSegment; +import com.mockobjects.util.Verifier; + +import java.io.OutputStream; +import java.io.PrintStream; public class MockPrintStream extends PrintStream { private ExpectationCounter myPrintlnCalls = new ExpectationCounter("MockPrintStream.println calls"); private ExpectationSegment mySegment = new ExpectationSegment("String segment"); private PrintStream myOldErrorStream; - private String myLastPrintedString; public MockPrintStream() { this(null); @@ -34,7 +35,6 @@ public void println(String aString) { println((Object) aString); - myLastPrintedString = aString; mySegment.setActual(aString); } |
From: Jeff M. <cus...@us...> - 2003-03-18 14:28:49
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv22955/src/j2ee/common/com/mockobjects/servlet Modified Files: MockBodyContent.java Log Message: Pepper Mocks with ReturnValue Index: MockBodyContent.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/servlet/MockBodyContent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockBodyContent.java 19 Jun 2002 15:26:22 -0000 1.1 +++ MockBodyContent.java 18 Mar 2003 14:28:44 -0000 1.2 @@ -3,6 +3,7 @@ import com.mockobjects.util.AssertMo; import com.mockobjects.Verifiable; import com.mockobjects.ExpectationValue; +import com.mockobjects.ReturnValue; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagext.BodyContent; @@ -11,7 +12,7 @@ import java.io.Writer; public class MockBodyContent extends BodyContent implements Verifiable{ - private JspWriter myEnclosingWriter; + private final ReturnValue myEnclosingWriter = new ReturnValue("enclosing writer"); private final ExpectationValue myWriter = new ExpectationValue("writer"); public int getBufferSize() { @@ -59,11 +60,11 @@ } public void setupGetEnclosingWriter(JspWriter aJspWriter){ - myEnclosingWriter = aJspWriter; + myEnclosingWriter.setValue(aJspWriter); } public JspWriter getEnclosingWriter() { - return myEnclosingWriter; + return (JspWriter)myEnclosingWriter.getValue(); } private void notImplemented() { |
From: Jeff M. <cus...@us...> - 2003-03-18 14:28:48
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/mail/internet In directory sc8-pr-cvs1:/tmp/cvs-serv22955/src/j2ee/common/com/mockobjects/mail/internet Modified Files: MockMimeMessageFactory.java Log Message: Pepper Mocks with ReturnValue Index: MockMimeMessageFactory.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/mail/internet/MockMimeMessageFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MockMimeMessageFactory.java 19 Jun 2002 15:26:22 -0000 1.2 +++ MockMimeMessageFactory.java 18 Mar 2003 14:28:44 -0000 1.3 @@ -7,22 +7,22 @@ import alt.javax.mail.internet.MimeMessage; public class MockMimeMessageFactory extends MockObject implements -MimeMessageFactory { + MimeMessageFactory { private final ExpectationValue mySession = new ExpectationValue("session"); - private MimeMessage myMimeMessage; + private final ReturnValue myMimeMessage = new ReturnValue("mime message"); - public void setExpectedSession(Session aSession){ + public void setExpectedSession(Session aSession) { mySession.setExpected(aSession); } - public void setupCreateMimeMessage(MimeMessage aMimeMessage){ - myMimeMessage = aMimeMessage; + public void setupCreateMimeMessage(MimeMessage aMimeMessage) { + myMimeMessage.setValue(aMimeMessage); } - public MimeMessage createMimeMessage(Session aSession){ + public MimeMessage createMimeMessage(Session aSession) { mySession.setActual(aSession); - return myMimeMessage; - } + return (MimeMessage)myMimeMessage.getValue(); + } } |
From: Jeff M. <cus...@us...> - 2003-03-18 14:28:47
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/mail In directory sc8-pr-cvs1:/tmp/cvs-serv22955/src/j2ee/common/com/mockobjects/mail Modified Files: MockSession.java Log Message: Pepper Mocks with ReturnValue Index: MockSession.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/mail/MockSession.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockSession.java 30 Apr 2002 17:03:10 -0000 1.1 +++ MockSession.java 18 Mar 2003 14:28:44 -0000 1.2 @@ -17,7 +17,7 @@ private final ExpectationValue myDebug = new ExpectationValue("debug"); private final ExpectationValue myTransportName = new ExpectationValue("transport name"); - private Transport myTransport; + private final ReturnValue myTransport = new ReturnValue("transport"); public Session getInstance(Properties props, Authenticator authenticator){ notImplemented(); @@ -77,12 +77,12 @@ } public void setupGetTransport(Transport aTransport){ - myTransport = aTransport; + myTransport.setValue(aTransport); } public Transport getTransport(String aTransportName){ myTransportName.setActual(aTransportName); - return myTransport; + return (Transport)myTransport.getValue(); } public Transport getTransport(Address address){ |
From: Jeff M. <cus...@us...> - 2003-03-18 14:28:47
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv22955/src/j2ee/1.3/com/mockobjects/servlet Modified Files: MockHttpServletRequest.java Log Message: Pepper Mocks with ReturnValue Index: MockHttpServletRequest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet/MockHttpServletRequest.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- MockHttpServletRequest.java 25 Feb 2003 17:41:30 -0000 1.13 +++ MockHttpServletRequest.java 18 Mar 2003 14:28:43 -0000 1.14 @@ -44,6 +44,7 @@ private ExpectationValue myContentType = new ExpectationValue("content type"); private ExpectationList myGetAttributeNames = new ExpectationList("get attribute names"); private final ReturnValue servletPath = new ReturnValue("servlet path"); + private final ReturnValue parameterMap = new ReturnValue("parameter map"); public void setupGetAttribute(Object anAttributeToReturn) { myAttributesToReturn.addObjectToReturn(anAttributeToReturn); @@ -58,7 +59,7 @@ return myAttributesToReturn.nextReturnObject(); } - public void setupGetAttrubuteNames(Vector attributeNames){ + public void setupGetAttrubuteNames(Vector attributeNames) { myAttributesNames = attributeNames; } @@ -82,7 +83,7 @@ } public String getContentType() { - return (String)myContentTypeToReturn.getValue(); + return (String) myContentTypeToReturn.getValue(); } public void setupGetContentType(String aContentType) { @@ -98,7 +99,7 @@ } public String getContextPath() { - return (String)myContextPath.getValue(); + return (String) myContextPath.getValue(); } public void setupGetContextPath(String contextPath) { @@ -135,7 +136,7 @@ public ServletInputStream getInputStream() throws IOException { - return (ServletInputStream)inputStream.getValue(); + return (ServletInputStream) inputStream.getValue(); } public int getIntHeader(String arg1) { @@ -158,7 +159,7 @@ } public String getMethod() { - return (String)method.getValue(); + return (String) method.getValue(); } public String getParameter(String paramName) { @@ -178,7 +179,7 @@ } public String getPathInfo() { - return (String)myPathInfo.getValue(); + return (String) myPathInfo.getValue(); } public String getPathTranslated() { @@ -187,7 +188,7 @@ } public String getProtocol() { - return (String)protocol.getValue(); + return (String) protocol.getValue(); } public void setupGetProtocol(String protocol) { @@ -195,11 +196,11 @@ } public String getQueryString() { - return (String)queryString.getValue(); + return (String) queryString.getValue(); } public BufferedReader getReader() { - return (BufferedReader)reader.getValue(); + return (BufferedReader) reader.getValue(); } public void setupGetReader(BufferedReader reader) throws IOException { @@ -216,7 +217,7 @@ } public String getRemoteAddr() { - return (String)myRemoteAddress.getValue(); + return (String) myRemoteAddress.getValue(); } public String getRemoteHost() { @@ -245,15 +246,15 @@ } public String getRequestURI() { - return (String)myRequestURI.getValue(); + return (String) myRequestURI.getValue(); } public String getScheme() { - return (String)scheme.getValue(); + return (String) scheme.getValue(); } public String getServerName() { - return (String)serverName.getValue(); + return (String) serverName.getValue(); } public int getServerPort() { @@ -261,16 +262,16 @@ return 0; } - public void setupGetServletPath(String path){ + public void setupGetServletPath(String path) { this.servletPath.setValue(path); } public String getServletPath() { - return (String)servletPath.getValue(); + return (String) servletPath.getValue(); } public HttpSession getSession() { - return (HttpSession)myHttpSession.getValue(); + return (HttpSession) myHttpSession.getValue(); } public void setSession(HttpSession httpSession) { @@ -287,7 +288,7 @@ } public Principal getUserPrincipal() { - return (Principal)myUserPrincipal.getValue(); + return (Principal) myUserPrincipal.getValue(); } public boolean isRequestedSessionIdFromCookie() { @@ -388,8 +389,11 @@ notImplemented(); } + public void setupGetParameterMap(Map map) { + this.parameterMap.setValue(map); + } + public Map getParameterMap() { - notImplemented(); - return null; + return (Map) parameterMap.getValue(); } } |
From: Jeff M. <cus...@us...> - 2003-03-18 14:28:47
|
Update of /cvsroot/mockobjects/mockobjects-java In directory sc8-pr-cvs1:/tmp/cvs-serv22955 Modified Files: build.xml env.txt Log Message: Pepper Mocks with ReturnValue Index: build.xml =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/build.xml,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- build.xml 13 Jan 2003 13:46:56 -0000 1.31 +++ build.xml 18 Mar 2003 14:28:43 -0000 1.32 @@ -15,11 +15,11 @@ <property name="out.src.examples.dir" value="${out.src.dir}/examples" /> <property name="out.xdoc.doc.dir" value="${out.dir}/xdoc/doc" /> <property name="out.xdoc.site.dir" value="${out.dir}/xdoc/site" /> + <property name="conf.dir" value="conf" /> <target name="project-properties"> <property name="project.fullname" value="Mock Objects" /> <property name="project.version" value="0.08dev" /> - <property name="project.name" value="mockobjects" /> <property name="year" value="2002" /> <property name="debug" value="on" /> <property name="optimize" value="off" /> @@ -33,7 +33,6 @@ <property name="src.jdk.dir" value="${src.dir}/jdk" /> <property name="src.httpclient.dir" value="${src.dir}/extensions" /> <property name="src.examples.dir" value="${src.dir}/examples" /> - <property name="conf.dir" value="conf" /> <property name="doc.dir" value="doc" /> <property name="xdoc.dir" value="${doc.dir}/xdocs" /> <property name="skin.dir" value="${doc.dir}/skins" /> @@ -44,12 +43,12 @@ <target name="deliverable-names" depends="project-properties"> <property name="dist.dir" value="dist" /> - <property name="jar.base.name" value="mockobjects-${project.version}" /> + <property name="jar.base.name" value="${ant.project.name}-${project.version}" /> <property name="alt.jar.base.name" value="alt-${project.version}" /> - <property name="sources.zip.name" value="${project.name}-src" /> - <property name="site.name" value="${project.name}-website" /> - <property name="javadoc.name" value="${project.name}-javadoc" /> - <property name="project.zip.name" value="${project.name}-${project.version}" /> + <property name="sources.zip.name" value="${ant.project.name}-src" /> + <property name="site.name" value="${ant.project.name}-website" /> + <property name="javadoc.name" value="${ant.project.name}-javadoc" /> + <property name="project.zip.name" value="${ant.project.name}-${project.version}" /> </target> <target name="useful-file-patterns"> @@ -246,12 +245,12 @@ </target> <target name="jar" - depends="jar-core, jar-jdk, jar-j2ee"/> + depends="junit, jar-core, jar-jdk, jar-j2ee"/> <target name="jar-core" - depends="deliverable-names, junit" + depends="compile-core, deliverable-names" description="Generate core mockobjects jar"> - <jar jarfile="${out.dir}/${jar.base.name}-core.jar" + <jar jarfile="${out.dir}/${ant.project.name}-core-${project.version}.jar" manifest="${conf.dir}/manifest"> <fileset dir="${core.classes}"> <exclude name="test/**"/> @@ -260,7 +259,7 @@ </target> <target name="jar-jdk" - depends="deliverable-names, junit" + depends="deliverable-names" description="Generate jdk mockobjects jar"> <antcall target="_inner-jar"> <param name="jarfile.name" @@ -272,7 +271,7 @@ </target> <target name="jar-j2ee" - depends="deliverable-names, junit" + depends="deliverable-names" if="j2ee.version" description="Generate j2ee mockobjects jar"> <antcall target="_inner-jar"> @@ -285,7 +284,7 @@ </target> <target name="_inner-jar" - depends="deliverable-names, junit" > + depends="deliverable-names" > <!-- requires jarfile.name, alt.jarfile.name, classes.dir --> <jar jarfile="${jarfile.name}" manifest="${conf.dir}/manifest"> @@ -306,7 +305,7 @@ <target name="jar-ext-httpclient" depends="junit, compile-ext-httpclient" description="Generate extension mockobjects jar"> - <jar jarfile="${out.dir}/mockobjects-httpclient.jar" + <jar jarfile="${out.dir}/${ant.project.name}-httpclient.jar" manifest="${conf.dir}/manifest"> <fileset dir="${httpclient.classes}"> <exclude name="alt/**"/> @@ -512,7 +511,7 @@ <target description="Generate the distributables" name="dist" depends="call-me-first, prepare-dist, zip-java-sources"> - <zip zipfile="${dist.dir}/mockobjects${project.version}.zip"> + <zip zipfile="${dist.dir}/${ant.project.name}${project.version}.zip"> <zipfileset dir="${out.dir}" prefix="lib"> <include name="*.jar" /> </zipfileset> @@ -520,7 +519,7 @@ <zipfileset dir="${out.doc.dir}" prefix="doc" /> <zipfileset dir="${out.dir}" prefix="src"> - <include name="mockobjects-${project.version}-src.zip" /> + <include name="${ant.project.name}-${project.version}-src.zip" /> </zipfileset> </zip> </target> @@ -567,5 +566,25 @@ </exec> </target> --> + + + <target name="src" depends="clean,prepare-dist"> + <property name="dist.name" + value="${ant.project.name}-${project.version}"/> + <copy todir="${dist.dir}/${dist.name}"> + <fileset dir="${basedir}"> + <include name="${src.dir}/**"/> + <include name="build.xml"/> + <include name="${lib.dir}/**"/> + <include name="${conf.dir}/**"/> + </fileset> + </copy> + <tar tarfile="${dist.name}-src.tar" basedir="${dist.dir}"> + </tar> + <gzip zipfile="${dist.name}-src.tgz" + src="${dist.name}-src.tar" /> + <delete file="${dist.name}-src.tar" /> + </target> + </project> Index: env.txt =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/env.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- env.txt 15 Oct 2002 13:53:11 -0000 1.2 +++ env.txt 18 Mar 2003 14:28:43 -0000 1.3 @@ -1,4 +1,3 @@ -clean-compiled jar:/usr/java/j2sdk1.3.1: +clean-compiled jar:/opt/IBMJava2-131: clean-compiled jar:/usr/java/j2sdk1.4.1: -clean-compiled jar:/usr/java/jdk1.3.1_01:-Dj2ee.lib=lib/j2ee.jar -clean-compiled jar:/usr/java/jdk1.3.1_03:-Dj2ee.lib=lib/j2ee.jar +clean-compiled jar:/opt/IBMJava2-131:-Dj2ee.lib=lib/j2ee.jar |
From: Jeff M. <cus...@us...> - 2003-03-18 14:28:21
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects In directory sc8-pr-cvs1:/tmp/cvs-serv22766/src/core/test/mockobjects Modified Files: TestReturnValue.java Log Message: Added Long support to ReturnValue Index: TestReturnValue.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/TestReturnValue.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TestReturnValue.java 21 Feb 2003 14:08:26 -0000 1.3 +++ TestReturnValue.java 18 Mar 2003 14:28:18 -0000 1.4 @@ -28,6 +28,13 @@ assertEquals(13, value.getIntValue()); } + public void testLongValue(){ + long now = System.currentTimeMillis(); + value.setValue(now); + assertEquals(now, value.getLongValue()); + value.getIntValue(); + } + public void testValueNotSet() { try { value.getValue(); |
From: Jeff M. <cus...@us...> - 2003-03-18 14:28:21
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects In directory sc8-pr-cvs1:/tmp/cvs-serv22766/src/core/com/mockobjects Modified Files: ReturnValue.java Log Message: Added Long support to ReturnValue Index: ReturnValue.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/ReturnValue.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ReturnValue.java 21 Feb 2003 14:08:26 -0000 1.3 +++ ReturnValue.java 18 Mar 2003 14:28:17 -0000 1.4 @@ -83,7 +83,7 @@ * @return the current value converted to an int */ public int getIntValue() { - return ((Integer)getValue()).intValue(); + return ((Number)getValue()).intValue(); } /** @@ -93,4 +93,21 @@ public void setValue(int value) { setValue(new Integer(value)); } + + /** + * @param value value to be returned by getLongValue. Calling getValue after this method will return + * a Long wrapper around the value. + */ + public void setValue(long value) { + setValue(new Long(value)); + } + + /** + * @return the current value converted to an long + */ + public long getLongValue() { + return ((Number)getValue()).longValue(); + } + + } |
From: Marvin L. <m_...@at...> - 2003-03-13 02:15:31
|
Hi, I just started using Mock Objects a while ago. It is great. The following is a small patch to make MockHttpSession.removeAttribute() remove the attribute from the myAttributeValues HashMap. Index: MockHttpSession.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet/MockHttpSession.java,v retrieving revision 1.3 diff -u -r1.3 MockHttpSession.java --- MockHttpSession.java 28 Aug 2002 18:27:11 -0000 1.3 +++ MockHttpSession.java 13 Mar 2003 02:01:07 -0000 @@ -93,6 +93,7 @@ public void removeAttribute(String anAttributeName) { myRemovedAttributes.addActual(anAttributeName); + myAttributeValues.remove(anAttributeName); } public void removeValue(String arg1) { |
From: Ewald A. <mo...@ew...> - 2003-03-10 17:14:11
|
Hello all, > A guess: http://mockpp.sourceforge.net/ good guess :-) unfortunately I forgot the most important thing :-( greetings -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de mobil/sms:+49-162-8001240 |
From: Francois B. <fbe...@ft...> - 2003-03-10 17:04:38
|
Log message: * MockOutputStream.java: Added expectations for flush() calls on MockOutputStream. Patch: Index: src/jdk/common/com/mockobjects/io/MockOutputStream.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/io/MockOutputStream.java,v retrieving revision 1.3 diff -u -r1.3 MockOutputStream.java --- src/jdk/common/com/mockobjects/io/MockOutputStream.java 8 Jul 2002 18:31:29 -0000 1.3 +++ src/jdk/common/com/mockobjects/io/MockOutputStream.java 10 Mar 2003 17:00:14 -0000 @@ -12,6 +12,7 @@ public class MockOutputStream extends OutputStream implements Verifiable { private ExpectationValue myWriteWasCalled = new ExpectationValue("MockOutputStream.writeWasCalled"); private ExpectationCounter myCloseCalls = new ExpectationCounter("MockOutputStream.close()"); + private ExpectationCounter myFlushCalls = new ExpectationCounter("MockOutputStream.flush()"); private ByteArrayOutputStream myBuffer = new ByteArrayOutputStream(); private boolean shouldThrowException = false; @@ -27,6 +28,10 @@ myCloseCalls.inc(); } + public void flush() throws IOException { + myFlushCalls.inc(); + } + public String getContents() { return myBuffer.toString(); } @@ -42,6 +47,10 @@ myCloseCalls.setExpected(closeCall); } + public void setExpectedFlushCalls(int flushCall) { + myFlushCalls.setExpected(flushCall); + } + public void setExpectingWriteCalls(boolean expectingWriteCall) { myWriteWasCalled.setExpected(expectingWriteCall); } @@ -56,7 +65,7 @@ public void write(int b) throws IOException { myWriteWasCalled.setActual(true); - if(shouldThrowException) { + if (shouldThrowException) { throw new IOException("Test IOException generated by request"); } myBuffer.write(b); -- http://www.fastmail.fm - Choose from over 50 domains or use your own |
From: Steve F. <ste...@m3...> - 2003-03-09 13:30:41
|
Welcome to the club, but is there a URL? Steve Ewald Arnold wrote: > The final release of mockpp is available. > > mockpp is a platform independent generic unit testing framework for C++. It's > goal is to facilitate developing unit tests in the spirit of > Mock Objects (http://www.mockobjects.com) and EasyMock > (http://www.easymock.org). > > Mockpp has no own testing framework. So CppUnit (http://cppunit.sf.net) is > recommended. > > The main development platform of mockpp is Linux. But it is intended to be > platform independent and a port to Borland BCB is already in work. > > Contributions, ports to other platforms and comments are highly welcome. > > greetings > |
From: Ewald A. <mo...@ew...> - 2003-03-08 15:28:23
|
The final release of mockpp is available. mockpp is a platform independent generic unit testing framework for C++. It= 's=20 goal is to facilitate developing unit tests in the spirit of=20 Mock Objects (http://www.mockobjects.com) and EasyMock=20 (http://www.easymock.org). Mockpp has no own testing framework. So CppUnit (http://cppunit.sf.net) is= =20 recommended. The main development platform of mockpp is Linux. But it is intended to be= =20 platform independent and a port to Borland BCB is already in work.=20 Contributions, ports to other platforms and comments are highly welcome. greetings =2D-=20 Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de mobil/sms:+49-162-8001240 |
From: Karen<Inc...@ya...> - 2003-03-05 07:07:29
|
WOULD YOU LIKE TO HAVE YOUR MESSAGE SEEN BY OVER 15.5 MILLION OPT-IN, TARGETED PEOPLE DAILY? Below contains all the information you will ever need to market your product or service on the Internet. If you have a product, service, or message that you would like to get out to Thousands, Hundreds of Thousands, or even Millions of people, you have several options. Traditional methods include print advertising, direct mail, radio, and television advertising. They are all effective, but they all have two catches: They're EXPENSIVE and TIME CONSUMING. Not only that, you only get ONE SHOT at making your message heard by the right people. Also, Internet Search Engine Submissions, Classified Ads, Newsgroup Postings simply DO NOT WORK effectively. Now this has all changed! Thanks to the top programmers in the world and their NEW EMAIL TECHNOLOGY, You can send millions of email messages daily for FREE...Without getting terminated from your current Internet connection! It's very simple to do and you can be increasing your sales within minutes of installing this new extraordinary software! Besides...It's the only real way to advertise on the Internet that works...Period! >>>WE WILL SUPPLY YOU WITH OVER 15.5 MILLION OPT-IN EMAIL ADDRESSES TO GET YOU STARTED RIGHT AWAY! >>>PLUS FREE EMAIL ADDRESS DOWNLOADS FOR LIFE! >>>ALSO, YOU WILL RECEIVE $2,000 WORTH OF EMAIL MARKETING SOFTWARE FREE! Including...... BROADCAST EMAIL SENDING SOFTWARE...(send millions of email advertisements daily with a few clicks of your mouse, without getting your ISP trerminated. We used the same software to send you this email) EMAIL EXTRACTION SOFTWARE...(retrieve new targeted email addresses daily. Hundreds of thousands of them) LIST MANAGEMENT SOFTWARE...(keep your lists clean, opt-in and manage all your remove requests, leads, sales etc...) and much...much more! Hurry...This extraordinary offer ends soon! To find out more information, Do not respond by email. Instead, click on the link below or copy and paste the exact web site address below into your Internet browser. http://www.beenteresting.com/504305/addresses.htm ______________________________________________________ Want to be removed from our email list? You were sent this email because you used our Opt-in service. We hope you enjoy reading our messages. However, if you'd rather not receive future e-mails from us, Click on the link below http://www.beenteresting.com/504305/remove.htm Thank you for your cooperation ________________________________________________________ |
From: Steve F. <st...@m3...> - 2003-02-28 12:08:37
|
You may well be right. Anyone think the opposite? b.t.w. I'd love to hear more about your experiences. In the meantime, you might also want to take a look at the new dynamic mock stuff in the library. S. ric...@vo... wrote: > Hi all, > > We're using mockobjects heavily for our unit tests. > > Currently we're testing a sql-update with PreparedStatement. > > I noticed that CommonMockPreparedStatement is using ExpectationSet, which is > using HashSet for internal storage. Since HashSet doesn't have a guaranteed > iteration order, it is in my opinion not suitable for PreparedStatement. > CommonMockPreparedStatement should use ExpectationList instead, so the order > is guaranteed (which is very important in a PreparedStatement...) > > Richard. > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Mockobjects-java-users mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-users |
From: A. <rem...@ke...> - 2003-02-26 08:19:36
|
Le mer 26/02/2003 =E0 00:52, Steve Freeman a =E9crit : > Works for me. Maybe it was transient. >=20 > S. yes, it was. I just waited one hour more and it was ok. The wait is always hard on me. :-) Sorry for my hastyness. Remy --=20 R=E9my Amouroux <rem...@ke...> Kelkoo |
From: Steve F. <st...@m3...> - 2003-02-25 23:52:21
|
Works for me. Maybe it was transient. S. R=E9my Amouroux wrote: > Hi all >=20 > Following the instructions on the CVS page of the project, I tried to > get the CVS tree of the project through the anonymous login. I tried > different way to do it, but each time it came to: >=20 > #> cvs -d:pserver:ano...@cv...:/cvsroot/mockobjects co > mockobjects-java > cvs [checkout aborted]: end of file from server (consult above messages > if any) >=20 > I then tried to get the CVS tree of another project. I chose junit. And > I was able to get what I wanted. So it seems that it's specific to the > mockobjects project. >=20 > Any idea where this problem comes from ? >=20 > Regards >=20 > Remy >=20 --=20 [Come to http://www.ot2003.org] |
From: A. <rem...@ke...> - 2003-02-25 21:45:25
|
Hi all Following the instructions on the CVS page of the project, I tried to get the CVS tree of the project through the anonymous login. I tried different way to do it, but each time it came to: #> cvs -d:pserver:ano...@cv...:/cvsroot/mockobjects co mockobjects-java cvs [checkout aborted]: end of file from server (consult above messages if any) I then tried to get the CVS tree of another project. I chose junit. And I was able to get what I wanted. So it seems that it's specific to the mockobjects project. Any idea where this problem comes from ? Regards Remy --=20 R=E9my Amouroux <rem...@ke...> Kelkoo |
From: Jeff M. <je...@mk...> - 2003-02-25 17:49:01
|
The mock objects project is still active. It has slowed down a bit, but this is largely due to most of the common mocks having been implemented. My approach has been to only implement those parts of the mocks that are being used by someone, as otherwise we're starting to guess how they are used rather than implementing what is actually required. There's probably quite a bit of work which could be done retrofitting the ReturnValue class into things, but that's waiting 'til I get really bored. If there are any methods you need just grab the source from CVS add the methods to that and then send me a patch file and we'll apply it. Remy Amouroux wrote: >I tried to use mockobjects classes and it was quite useful. >The problem is that I came to some unimplemented methods in >some classes (HttpServlet). > >I need to know if you decided to stop working on the project >because there are other mock objects packages available >(which ones ?) or simply because you did not have the time to. >In the latter case, I would want to become member of the >project as a developper to start developping the methods I'm >missing. > >regards > >Remy Amouroux > > |
From: Jeff M. <cus...@us...> - 2003-02-25 17:41:40
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv1210/src/j2ee/1.3/com/mockobjects/servlet Modified Files: MockHttpServletRequest.java Log Message: Changed MockHttpServletRequest to make use of ReturnValue Index: MockHttpServletRequest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet/MockHttpServletRequest.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- MockHttpServletRequest.java 23 Jan 2003 11:43:00 -0000 1.12 +++ MockHttpServletRequest.java 25 Feb 2003 17:41:30 -0000 1.13 @@ -18,24 +18,25 @@ * @version $Revision$ */ public class MockHttpServletRequest extends MockObject - implements HttpServletRequest { + private Dictionary myParameters = new Hashtable(); private Dictionary myHeaders = new Hashtable(); - private HttpSession myHttpSession; - private String myContentTypeToReturn; - private String myContextPath; - private String myPathInfo; - private String myRemoteAddress; - private final ReturnValue myRequestURI = new ReturnValue("request URI"); + private final ReturnValue myHttpSession = new ReturnValue("session"); + private final ReturnValue myContentTypeToReturn = new ReturnValue("content type"); + private final ReturnValue myContextPath = new ReturnValue("context path"); + private final ReturnValue myPathInfo = new ReturnValue("path info"); + private final ReturnValue myRemoteAddress = new ReturnValue("remote address"); + private final ReturnValue myRequestURI = new ReturnValue("request uri"); private final ReturnValue method = new ReturnValue("method"); private final ReturnValue protocol = new ReturnValue("protocol"); - private ServletInputStream myInputStream; - private Principal myUserPrincipal; + private final ReturnValue inputStream = new ReturnValue("input stream"); + private final ReturnValue myUserPrincipal = new ReturnValue("user principal"); private Vector myAttributesNames; - private String queryString; - private String scheme; - private String serverName; + private final ReturnValue queryString = new ReturnValue("query string"); + private final ReturnValue scheme = new ReturnValue("scheme"); + private final ReturnValue serverName = new ReturnValue("server name"); + private final ReturnValue reader = new ReturnValue("reader"); private ExpectationSet mySetAttributes = new ExpectationSet("HttpServletRequest.setAttribute"); private ExpectationSet myRemoveAttributes = new ExpectationSet("HttpServletRequest.removeAttribute"); @@ -76,15 +77,16 @@ } public int getContentLength() { + notImplemented(); return 0; } public String getContentType() { - return myContentTypeToReturn; + return (String)myContentTypeToReturn.getValue(); } public void setupGetContentType(String aContentType) { - myContentTypeToReturn = aContentType; + myContentTypeToReturn.setValue(aContentType); } public void setExpectedContentType(String aContentType) { @@ -96,11 +98,11 @@ } public String getContextPath() { - return myContextPath; + return (String)myContextPath.getValue(); } public void setupGetContextPath(String contextPath) { - myContextPath = contextPath; + myContextPath.setValue(contextPath); } public Cookie[] getCookies() { @@ -109,6 +111,7 @@ } public long getDateHeader(String arg1) { + notImplemented(); return 0; } @@ -126,16 +129,17 @@ return null; } - public void setupGetInputStream(ServletInputStream anInputStream) { - this.myInputStream = anInputStream; + public void setupGetInputStream(ServletInputStream inputStream) { + this.inputStream.setValue(inputStream); } public ServletInputStream getInputStream() - throws java.io.IOException { - return myInputStream; + throws IOException { + return (ServletInputStream)inputStream.getValue(); } public int getIntHeader(String arg1) { + notImplemented(); return 0; } @@ -174,7 +178,7 @@ } public String getPathInfo() { - return myPathInfo; + return (String)myPathInfo.getValue(); } public String getPathTranslated() { @@ -191,12 +195,15 @@ } public String getQueryString() { - return queryString; + return (String)queryString.getValue(); } - public BufferedReader getReader() throws IOException { - notImplemented(); - return null; + public BufferedReader getReader() { + return (BufferedReader)reader.getValue(); + } + + public void setupGetReader(BufferedReader reader) throws IOException { + this.reader.setValue(reader); } public String getRealPath(String arg1) { @@ -205,11 +212,11 @@ } public void setupGetRemoteAddr(String remoteAddress) { - this.myRemoteAddress = remoteAddress; + this.myRemoteAddress.setValue(remoteAddress); } public String getRemoteAddr() { - return myRemoteAddress; + return (String)myRemoteAddress.getValue(); } public String getRemoteHost() { @@ -242,14 +249,15 @@ } public String getScheme() { - return scheme; + return (String)scheme.getValue(); } public String getServerName() { - return serverName; + return (String)serverName.getValue(); } public int getServerPort() { + notImplemented(); return 0; } @@ -262,11 +270,11 @@ } public HttpSession getSession() { - return myHttpSession; + return (HttpSession)myHttpSession.getValue(); } public void setSession(HttpSession httpSession) { - this.myHttpSession = httpSession; + this.myHttpSession.setValue(httpSession); } public HttpSession getSession(boolean arg1) { @@ -275,34 +283,40 @@ } public void setupGetUserPrincipal(Principal userPrincipal) { - this.myUserPrincipal = userPrincipal; + this.myUserPrincipal.setValue(userPrincipal); } public Principal getUserPrincipal() { - return myUserPrincipal; + return (Principal)myUserPrincipal.getValue(); } public boolean isRequestedSessionIdFromCookie() { + notImplemented(); return false; } public boolean isRequestedSessionIdFromUrl() { + notImplemented(); return false; } public boolean isRequestedSessionIdFromURL() { + notImplemented(); return false; } public boolean isRequestedSessionIdValid() { + notImplemented(); return false; } public boolean isSecure() { + notImplemented(); return false; } public boolean isUserInRole(java.lang.String arg1) { + notImplemented(); return false; } @@ -350,29 +364,32 @@ } public void setupPathInfo(String pathInfo) { - myPathInfo = pathInfo; + myPathInfo.setValue(pathInfo); } public void setupQueryString(String aQueryString) { - queryString = aQueryString; + queryString.setValue(aQueryString); } public void setupScheme(String aScheme) { - scheme = aScheme; + scheme.setValue(aScheme); } public void setupServerName(String aServerName) { - serverName = aServerName; + serverName.setValue(aServerName); } public StringBuffer getRequestURL() { + notImplemented(); return null; } public void setCharacterEncoding(String s) { + notImplemented(); } public Map getParameterMap() { + notImplemented(); return null; } } |
From: cpp g. <cpp...@ho...> - 2003-02-24 16:29:30
|
FYI: If you are in the San Diego area, come see on Mar 6 for a Mock Objects demonstration. See below for more details. John ---- XPSD mailing list: http://groups.yahoo.com/groups/xpsandiego/join XPSD website : www.xpsd.com contacts : Carlton Nettleton: cne...@sa... June Clarke : joo...@ya... John Arrizza : cpp...@ho... >Reply-To: xps...@ya... >To: xps...@ya... >The XP-San Diego users group will be holding our next meeting: > > > >Thursday Mar 6 from 6 - 8PM. > > > >The topic is "Mock Objects" presented by Kral Ferch. > > > >Kral is a firm believer in the eXtreme Programming approach to software >development. For the last 2 years, he has been trying to use XP as much as >possible as well as evangelizing it to others. For his talk, he will first >answer the questions "What are Mock Objects?" and "Why should I use them?" >Then he will present some sample C# code showing a couple of different ways >to implement Mock Objects. > > > >For people who want a little head start, the site > >http://www.mockobjects.com was the inspiration for much of this talk. > > > >This is an open meeting; please invite anyone interested in XP or Mock >Objects! Please RSVP by replying to this email so that an appropriately >sized room can be scheduled. > > > >Alaris Medical is hosting the meeting. Thanks again to Nobuo Fukaya for >allowing us to use Alaris's site! > > > >The address is: Building A, 2nd floor, Conference room 2D 10221 Wateridge >Circle > > > >http://www.mapquest.com/maps/map.adp?country=US&;addtohistory=&address=10221+Wateridge+Circle&city=san+diego&state=ca&zipcode=&homesubmit.x=24&homesubmit.y=15 > > > >Wateridge is two exits off of Lusk. If you take the East-most exit, you >will arrive at the entrance with the buildings on your left and a parking >structure on your right. Park there and walk up two sets of stairs to the >second floor main foyer of building A. > > > >If you take the West-most exit, you can park on the street and walk to the >second floor main foyer directly. > > > > > > > >http://www.xpsd.com > > > >--------------------------------- >Do you Yahoo!? >Yahoo! Shopping - Send Flowers for Valentine's Day _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus |
From: Jeff M. <cus...@us...> - 2003-02-21 14:08:29
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects In directory sc8-pr-cvs1:/tmp/cvs-serv29954/src/core/test/mockobjects Modified Files: TestReturnValue.java Log Message: Added int support to return value Index: TestReturnValue.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/TestReturnValue.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TestReturnValue.java 2 Jan 2003 15:57:40 -0000 1.2 +++ TestReturnValue.java 21 Feb 2003 14:08:26 -0000 1.3 @@ -23,6 +23,11 @@ assertTrue(value.getBooleanValue()); } + public void testIntValue(){ + value.setValue(13); + assertEquals(13, value.getIntValue()); + } + public void testValueNotSet() { try { value.getValue(); |
From: Jeff M. <cus...@us...> - 2003-02-21 14:08:29
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects In directory sc8-pr-cvs1:/tmp/cvs-serv29954/src/core/com/mockobjects Modified Files: ReturnValue.java Log Message: Added int support to return value Index: ReturnValue.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/ReturnValue.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ReturnValue.java 2 Jan 2003 15:57:39 -0000 1.2 +++ ReturnValue.java 21 Feb 2003 14:08:26 -0000 1.3 @@ -72,7 +72,25 @@ setValue(new Boolean(value)); } + /** + * @return the current value converted to a boolean + */ public boolean getBooleanValue() { return ((Boolean)getValue()).booleanValue(); } -} + + /** + * @return the current value converted to an int + */ + public int getIntValue() { + return ((Integer)getValue()).intValue(); + } + + /** + * @param value value to be returned by getIntValue. Calling getValue after this method will return + * a Integer wrapper around the value. + */ + public void setValue(int value) { + setValue(new Integer(value)); + } +} \ No newline at end of file |
From: Jeff M. <cus...@us...> - 2003-02-21 14:07:29
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/jms In directory sc8-pr-cvs1:/tmp/cvs-serv29556/src/j2ee/common/com/mockobjects/jms Modified Files: MockMessageConsumer.java MockQueue.java MockQueueReceiver.java MockQueueSession.java Log Message: Added some more stuff Index: MockMessageConsumer.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/jms/MockMessageConsumer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MockMessageConsumer.java 23 Feb 2002 18:50:35 -0000 1.2 +++ MockMessageConsumer.java 21 Feb 2003 14:07:24 -0000 1.3 @@ -13,6 +13,7 @@ new ExpectationCounter("MockMessageConsumer.receive"); private ExpectationValue messageListener = new ExpectationValue("messageListener"); + private final ExpectationValue timeout = new ExpectationValue("timeout"); public void setExpectedMessageListener(MessageListener messageListener){ this.messageListener.setExpected(messageListener); @@ -50,6 +51,7 @@ } public Message receive(long timeout) throws JMSException { + this.timeout.setActual(timeout); throwExceptionIfAny(); myReceiveCalls.inc(); if (myExpiresOnTimeout) { @@ -59,6 +61,9 @@ } } + public void setExpectedTimeout(long timeout){ + this.timeout.setExpected(timeout); + } public Message receiveNoWait() throws JMSException { throwExceptionIfAny(); Index: MockQueue.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/jms/MockQueue.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockQueue.java 22 Feb 2002 16:25:05 -0000 1.1 +++ MockQueue.java 21 Feb 2003 14:07:24 -0000 1.2 @@ -1,8 +1,9 @@ package com.mockobjects.jms; +import com.mockobjects.MockObject; + import javax.jms.JMSException; import javax.jms.Queue; -import com.mockobjects.MockObject; public class MockQueue extends MockObject implements Queue { @@ -24,7 +25,7 @@ return myName.equals(((Queue) object).getQueueName()); } catch (JMSException e) { throw new junit.framework.AssertionFailedError( - "JMSException caught while getting actual queue name"); + "JMSException caught while getting actual queue name"); } } Index: MockQueueReceiver.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/jms/MockQueueReceiver.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockQueueReceiver.java 22 Feb 2002 16:25:05 -0000 1.1 +++ MockQueueReceiver.java 21 Feb 2003 14:07:25 -0000 1.2 @@ -5,9 +5,6 @@ public class MockQueueReceiver extends MockMessageConsumer implements QueueReceiver { - public MockQueueReceiver() { - } - public Queue getQueue() { notImplemented(); return null; Index: MockQueueSession.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/jms/MockQueueSession.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockQueueSession.java 22 Feb 2002 16:25:05 -0000 1.1 +++ MockQueueSession.java 21 Feb 2003 14:07:25 -0000 1.2 @@ -1,75 +1,89 @@ package com.mockobjects.jms; import com.mockobjects.*; + import javax.jms.*; public class MockQueueSession extends MockSession implements QueueSession { - protected ExpectationValue mySendingQueue = new ExpectationValue("MockQueueSession.createSender"); - protected ExpectationValue myReceivingQueue = new ExpectationValue("MockQueueSession.createReceiver"); - - private QueueReceiver myReceiver; - private QueueSender mySender; - private TemporaryQueue myTemporaryQueue; - - public MockQueueSession() { - } - - public QueueBrowser createBrowser(Queue queue) throws JMSException { - notImplemented(); - return null; - } - - public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException { - notImplemented(); - return null; - } - - public Queue createQueue(String queueName) throws JMSException { - throwExceptionIfAny(); - return new MockQueue(queueName); - } - - public QueueReceiver createReceiver(Queue queue) throws JMSException { - throwExceptionIfAny(); - myReceivingQueue.setActual(queue); - return myReceiver; - } - - public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException { - myReceivingQueue.setActual(queue); - throwExceptionIfAny(); - return myReceiver; - } - - public QueueSender createSender(Queue queue) throws JMSException { - mySendingQueue.setActual(queue); - throwExceptionIfAny(); - return mySender; - } - - public TemporaryQueue createTemporaryQueue() throws JMSException { - throwExceptionIfAny(); - return myTemporaryQueue; - } - - public void setExpectedSendingQueue(Queue queue) { - mySendingQueue.setExpected(queue); - } - - public void setExpectedReceivingQueue(Queue queue) { - myReceivingQueue.setExpected(queue); - } - - public void setupReceiver(QueueReceiver receiver) { - myReceiver = receiver; - } - - public void setupSender(QueueSender sender) { - mySender = sender; - } - - public void setupTemporaryQueue(MockTemporaryQueue temporaryQueue) { - myTemporaryQueue = temporaryQueue; - } + private final ExpectationValue mySendingQueue = new ExpectationValue("MockQueueSession.createSender"); + private final ExpectationValue myReceivingQueue = new ExpectationValue("MockQueueSession.createReceiver"); + private final ExpectationValue messageSelector = new ExpectationValue("message selector"); + private final ExpectationValue queue = new ExpectationValue("queue"); + + private final ReturnValue myReceiver = new ReturnValue("reciever"); + private final ReturnValue mySender = new ReturnValue("reciever"); + private final ReturnValue myTemporaryQueue = new ReturnValue("reciever"); + private final ReturnValue queueBrowser = new ReturnValue("queue browser"); + + public QueueBrowser createBrowser(Queue queue) throws JMSException { + this.queue.setActual(queue); + return (QueueBrowser) queueBrowser.getValue(); + } + + public void setExpectedQueue(Queue queue) { + this.queue.setExpected(queue); + } + + public void setupCreateQueueBrowser(QueueBrowser browser) { + this.queueBrowser.setValue(browser); + } + + public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException { + notImplemented(); + return null; + } + + public Queue createQueue(String queueName) throws JMSException { + throwExceptionIfAny(); + return new MockQueue(queueName); + } + + public QueueReceiver createReceiver(Queue queue) throws JMSException { + throwExceptionIfAny(); + myReceivingQueue.setActual(queue); + return (QueueReceiver) myReceiver.getValue(); + } + + public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException { + this.messageSelector.setActual(messageSelector); + myReceivingQueue.setActual(queue); + throwExceptionIfAny(); + return (QueueReceiver) myReceiver.getValue(); + } + + public QueueSender createSender(Queue queue) throws JMSException { + mySendingQueue.setActual(queue); + throwExceptionIfAny(); + return (QueueSender) mySender.getValue(); + } + + public TemporaryQueue createTemporaryQueue() throws JMSException { + throwExceptionIfAny(); + return (TemporaryQueue) myTemporaryQueue.getValue(); + } + + public void setExpectedSendingQueue(Queue queue) { + mySendingQueue.setExpected(queue); + } + + public void setExpectedReceivingQueue(Queue queue) { + myReceivingQueue.setExpected(queue); + } + + public void setupReceiver(QueueReceiver receiver) { + myReceiver.setValue(receiver); + } + + public void setupSender(QueueSender sender) { + mySender.setValue(sender); + } + + public void setupTemporaryQueue(MockTemporaryQueue temporaryQueue) { + myTemporaryQueue.setValue(temporaryQueue); + } + + public void setExpectedMessageSelector(String messageSelector) { + this.messageSelector.setExpected(messageSelector); + } } |
From: Jeff M. <cus...@us...> - 2003-02-21 12:17:41
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql In directory sc8-pr-cvs1:/tmp/cvs-serv8469/src/jdk/common/com/mockobjects/sql Modified Files: CommonMockConnection.java Log Message: Patch from François Beausoleil to add result set type and concurrency support Index: CommonMockConnection.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql/CommonMockConnection.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- CommonMockConnection.java 9 Dec 2002 18:20:14 -0000 1.6 +++ CommonMockConnection.java 21 Feb 2003 12:17:38 -0000 1.7 @@ -68,7 +68,7 @@ * Exceptions to throw can be registered for calling createStatement, * preparedStatement, or close. * Several less-often-used methods are not implemented. - * If a notImplemented method is are needed for your project, please submit + * If a notImplemented method is needed for your project, please submit * a patch. * @see <a href="http://java.sun.com/j2se/1.3/docs/api/java/sql/Connection.html">javax.sql.Connection</a> * @author @@ -89,6 +89,9 @@ private boolean autoCommit = false; + private final ExpectationValue myResultSetConcurrency; + private final ExpectationValue myResultSetType; + private final ExpectationList myAutoCommit; private final ExpectationCounter myCloseCalls; private final ExpectationCounter myCommitCalls; @@ -132,6 +135,8 @@ myPreparedStatements = new ReturnObjectList(name + ".PreparedStatements"); myPreparedStatementStrings = new ExpectationList(name + ".preparedStatementString"); myRollbackCalls = new ExpectationCounter(name + ".rollback"); + myResultSetType = new ExpectationValue(name + ".resultSetType"); + myResultSetConcurrency = new ExpectationValue(name + ".resultSetConcurrency"); } /** @@ -191,6 +196,31 @@ // --------------------------------------------------------------------- setup /** + * Sets expectations about the possible value of the + * <code>resultSetConcurrency</code> parameter of + * {@link #createStatement(int, int) createStatement()} calls. + * + * @param resultSetConcurrency One of the constants starting with CONCUR + * in {@link java.sql.ResultSet}. + */ + public void setExpectedResultSetConcurrency(int resultSetConcurrency) { + myResultSetConcurrency.setExpected(resultSetConcurrency); + } + + /** + * Sets expectations about the possible value of the + * <code>resultSetType</code> parameter of + * {@link #createStatement(int, int) createStatement()} calls. + * + * @param resultSetType One of the constants starting with TYPE + * in {@link java.sql.ResultSet}. + */ + public void setExpectedResultSetType(int resultSetType) { + myResultSetType.setExpected(resultSetType); + } + + + /** * @deprecated * Adds a PreparedStatement to be return by prepareStatement * @see CommonMockConnection2 @@ -363,8 +393,13 @@ int resultSetType, int resultSetConcurrency) throws SQLException { - notImplemented(); - return null; + myCreateStatementCalls.inc(); + throwStatementExceptionIfAny(); + + myResultSetType.setActual(resultSetType); + myResultSetConcurrency.setActual(resultSetConcurrency); + + return myStatement; } public boolean getAutoCommit() throws SQLException { |