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-01-02 16:04:59
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/1.4/com/mockobjects/constraint In directory sc8-pr-cvs1:/tmp/cvs-serv20181/src/jdk/1.4/com/mockobjects/constraint Modified Files: Matches.java Log Message: Replaced StreamFactory and FileFactory with IOFactory Added implementations of File.exists, File.mkdirs and File.getParentFile Index: Matches.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/1.4/com/mockobjects/constraint/Matches.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Matches.java 12 Nov 2002 17:42:41 -0000 1.1 +++ Matches.java 2 Jan 2003 16:04:25 -0000 1.2 @@ -1,6 +1,7 @@ -/* Copyright (c) 2002 Nat Pryce. All rights reserved. - * - * Created on February 10, 2002, 11:35 PM +/* + * Copyright (c) 2002 Nat Pryce. All rights reserved. + * + * Created on February 10, 2002, 11:35 PM */ package com.mockobjects.constraint; @@ -8,36 +9,35 @@ import java.util.regex.Pattern; -/** Is the value a string that matches a regular expression? +/** + * Is the value a string that matches a regular expression? */ -public class Matches implements Constraint -{ +public class Matches implements Constraint { private Pattern _pattern; - private Matcher _matcher; - + /** Creates a new Matches predicate. - * + * * @param regex - * A regular expression string used to create a + * A regular expression string used to create a * {@link java.util.regex.Pattern}. The {@link #eval} method * returns true when applied to Strings that match this pattern. - * Matching is tested by calling the + * Matching is tested by calling the * {@link java.util.regex.Matcher#matches} method of a * {@link java.util.regex.Matcher} object. */ - public Matches( String regex ) { + public Matches(String regex) { _pattern = Pattern.compile(regex); } - - public boolean eval( Object arg ) { - if( arg instanceof String ) { - Matcher matcher = _pattern.matcher((String)arg); + + public boolean eval(Object arg) { + if (arg instanceof String) { + Matcher matcher = _pattern.matcher((String) arg); return matcher.matches(); } else { return false; } } - + public String toString() { return "a string that matches <" + _pattern.toString() + ">"; } |
From: Jeff M. <cus...@us...> - 2003-01-02 16:04:57
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/1.3/com/mockobjects/sql In directory sc8-pr-cvs1:/tmp/cvs-serv20181/src/jdk/1.3/com/mockobjects/sql Modified Files: MockConnection.java Log Message: Replaced StreamFactory and FileFactory with IOFactory Added implementations of File.exists, File.mkdirs and File.getParentFile Index: MockConnection.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/1.3/com/mockobjects/sql/MockConnection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MockConnection.java 4 Dec 2002 12:39:24 -0000 1.2 +++ MockConnection.java 2 Jan 2003 16:04:24 -0000 1.3 @@ -3,6 +3,7 @@ /** * @deprecated Use temporary class MockConnection2 * @see MockConnection2 + * @version $Revision$ */ public class MockConnection extends CommonMockConnection{ } |
From: Jeff M. <cus...@us...> - 2003-01-02 16:04:36
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/io In directory sc8-pr-cvs1:/tmp/cvs-serv20181/src/jdk/common/com/mockobjects/io Modified Files: MockFile.java Added Files: MockIOFactory.java Removed Files: MockFileFactory.java MockStreamFactory.java Log Message: Replaced StreamFactory and FileFactory with IOFactory Added implementations of File.exists, File.mkdirs and File.getParentFile --- NEW FILE: MockIOFactory.java --- package com.mockobjects.io; import alt.java.io.File; import alt.java.io.IOFactory; import com.mockobjects.ExpectationValue; import com.mockobjects.MockObject; import com.mockobjects.ReturnValue; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.OutputStream; public class MockIOFactory extends MockObject implements IOFactory { private final ExpectationValue myFile = new ExpectationValue("file"); private final ReturnValue inputStream = new ReturnValue("input stream"); private final ReturnValue outputStream = new ReturnValue("output stream"); private final ReturnValue file = new ReturnValue("file"); private final ExpectationValue fileName = new ExpectationValue("file name"); public void setExpectedFile(File aFile) { myFile.setExpected(aFile); } public void setupInputStream(InputStream inputStream) { this.inputStream.setValue(inputStream); } public InputStream createInputStream(File aFile) throws FileNotFoundException { myFile.setActual(aFile); return (InputStream)inputStream.getValue(); } public void setupOutputStream(OutputStream outputStream) { this.outputStream.setValue(outputStream); } public OutputStream createOutputStream(File aFile) throws FileNotFoundException { myFile.setActual(aFile); return (OutputStream)outputStream.getValue(); } public void setupCreateFile(File file) { this.file.setValue(file); } public void setExpectedFileName(String fileName){ this.fileName.setExpected(fileName); } public File createFile(String fileName) { this.fileName.setActual(fileName); return (File)file.getValue(); } } Index: MockFile.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/io/MockFile.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- MockFile.java 29 Nov 2002 09:20:08 -0000 1.3 +++ MockFile.java 2 Jan 2003 16:04:29 -0000 1.4 @@ -2,6 +2,8 @@ import com.mockobjects.MockObject; import com.mockobjects.ExpectationValue; +import com.mockobjects.ReturnValue; +import com.mockobjects.ExpectationCounter; import java.io.IOException; import java.io.FilenameFilter; @@ -17,6 +19,10 @@ new ExpectationValue("filename filter"); private String myParent; private String fileName; + 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 File[] myFilesToReturn; @@ -39,9 +45,12 @@ return myParent; } + public void setupGetParentFile(File parentFile){ + this.parentFile.setValue(parentFile); + } + public File getParentFile() { - notImplemented(); - return null; + return (File)parentFile.getValue(); } public File createTempFile(String prefix, String suffix, File directory) throws IOException { @@ -107,9 +116,12 @@ return false; } + public void setupExists(boolean exists){ + this.exists.setValue(exists); + } + public boolean exists() { - notImplemented(); - return false; + return exists.getBooleanValue(); } public boolean isDirectory() { @@ -189,9 +201,14 @@ return false; } + public void setupMkdirs(boolean mkdirs, int count){ + mkdirsCounter.setExpected(count); + this.mkdirs.setValue(mkdirs); + } + public boolean mkdirs() { - notImplemented(); - return false; + mkdirsCounter.inc(); + return mkdirs.getBooleanValue(); } public boolean renameTo(File dest) { --- MockFileFactory.java DELETED --- --- MockStreamFactory.java DELETED --- |
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/alt/java/io In directory sc8-pr-cvs1:/tmp/cvs-serv20181/src/jdk/common/alt/java/io Added Files: IOFactory.java IOFactoryImpl.java Removed Files: FileFactory.java FileFactoryImpl.java StreamFactory.java StreamFactoryImpl.java Log Message: Replaced StreamFactory and FileFactory with IOFactory Added implementations of File.exists, File.mkdirs and File.getParentFile --- NEW FILE: IOFactory.java --- package alt.java.io; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.OutputStream; public interface IOFactory { InputStream createInputStream(File aFile) throws FileNotFoundException; OutputStream createOutputStream(File aFile) throws FileNotFoundException; File createFile(String fileName); } --- NEW FILE: IOFactoryImpl.java --- package alt.java.io; import java.io.*; public class IOFactoryImpl implements IOFactory { public InputStream createInputStream(File aFile) throws FileNotFoundException { return new FileInputStream(aFile.getRealFile()); } public OutputStream createOutputStream(File aFile) throws FileNotFoundException { return new FileOutputStream(aFile.getRealFile()); } public File createFile(String fileName) { return new FileImpl(fileName); } } --- FileFactory.java DELETED --- --- FileFactoryImpl.java DELETED --- --- StreamFactory.java DELETED --- --- StreamFactoryImpl.java DELETED --- |
From: Jeff M. <cus...@us...> - 2003-01-02 15:57:44
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects In directory sc8-pr-cvs1:/tmp/cvs-serv17328/src/core/test/mockobjects Modified Files: TestReturnValue.java Log Message: Fixed error handling nulls in ReturnValue Index: TestReturnValue.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/TestReturnValue.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestReturnValue.java 31 Dec 2002 13:40:02 -0000 1.1 +++ TestReturnValue.java 2 Jan 2003 15:57:40 -0000 1.2 @@ -18,6 +18,11 @@ assertEquals(this, value.getValue()); } + public void testGetBooleanValue(){ + value.setValue(true); + assertTrue(value.getBooleanValue()); + } + public void testValueNotSet() { try { value.getValue(); |
From: Jeff M. <cus...@us...> - 2003-01-02 15:57:43
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects In directory sc8-pr-cvs1:/tmp/cvs-serv17328/src/core/com/mockobjects Modified Files: ReturnValue.java Log Message: Fixed error handling nulls in ReturnValue Index: ReturnValue.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/ReturnValue.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ReturnValue.java 31 Dec 2002 13:40:01 -0000 1.1 +++ ReturnValue.java 2 Jan 2003 15:57:39 -0000 1.2 @@ -54,14 +54,25 @@ } /** - * - * @param value value to be returned be getValue. null can be use to force getValue to return null. + * @param value value to be returned by getValue. null can be use to force getValue to return null. */ public void setValue(Object value) { if(value==null){ - value = Null.NULL; + this.value = Null.NULL; }else{ this.value = value; } + } + + /** + * @param value value to be returned by getBooleanValue. Calling getValue after this method will return + * a Boolean wrapper around the value. + */ + public void setValue(boolean value){ + setValue(new Boolean(value)); + } + + public boolean getBooleanValue() { + return ((Boolean)getValue()).booleanValue(); } } |
From: Jeff M. <cus...@us...> - 2002-12-31 15:25:51
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/io In directory sc8-pr-cvs1:/tmp/cvs-serv9545/src/jdk/common/com/mockobjects/io Added Files: MockFileFactory.java Log Message: Added FileFactory --- NEW FILE: MockFileFactory.java --- package com.mockobjects.io; import alt.java.io.FileFactory; import alt.java.io.File; import com.mockobjects.ReturnValue; import com.mockobjects.ExpectationValue; import com.mockobjects.MockObject; /** * @version $Revision: 1.1 $ */ public class MockFileFactory extends MockObject implements FileFactory { private final ReturnValue file = new ReturnValue("file"); private final ExpectationValue fileName = new ExpectationValue("file name"); public void setupCreateFile(File file) { this.file.setValue(file); } public void setExpectedFileName(String fileName){ this.fileName.setExpected(fileName); } public File createFile(String fileName) { this.fileName.setActual(fileName); return (File)file.getValue(); } } |
From: Jeff M. <cus...@us...> - 2002-12-31 15:24:54
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/alt/java/io In directory sc8-pr-cvs1:/tmp/cvs-serv8920/src/jdk/common/alt/java/io Added Files: FileFactoryImpl.java FileFactory.java Log Message: Added FileFactory --- NEW FILE: FileFactoryImpl.java --- package alt.java.io; /** * @version $Revision: 1.1 $ */ public class FileFactoryImpl implements FileFactory{ public File createFile(String fileName) { return new FileImpl(fileName); } } --- NEW FILE: FileFactory.java --- package alt.java.io; /** * @version $Revision: 1.1 $ */ public interface FileFactory { File createFile(String fileName); } |
From: Jeff M. <cus...@us...> - 2002-12-31 15:23:34
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/io In directory sc8-pr-cvs1:/tmp/cvs-serv7992/src/jdk/common/com/mockobjects/io Modified Files: MockStreamFactory.java Log Message: Allow checking of file object in MockStreamFactory Index: MockStreamFactory.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/io/MockStreamFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MockStreamFactory.java 31 Dec 2002 14:36:05 -0000 1.2 +++ MockStreamFactory.java 31 Dec 2002 15:23:29 -0000 1.3 @@ -34,6 +34,7 @@ } public OutputStream createOutputStream(File aFile) throws FileNotFoundException { + myFile.setActual(aFile); return (OutputStream)outputStream.getValue(); } } |
From: Jeff M. <cus...@us...> - 2002-12-31 15:22:37
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/1.3 In directory sc8-pr-cvs1:/tmp/cvs-serv5815/src/jdk/1.3 Removed Files: readme.txt Log Message: Remove redundent file --- readme.txt DELETED --- |
From: Jeff M. <cus...@us...> - 2002-12-31 14:44:32
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql In directory sc8-pr-cvs1:/tmp/cvs-serv18775/src/jdk/common/com/mockobjects/sql Modified Files: MockResultSet.java Log Message: Change getMetaData to use ReturnValue Index: MockResultSet.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql/MockResultSet.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- MockResultSet.java 9 Dec 2002 18:20:09 -0000 1.4 +++ MockResultSet.java 31 Dec 2002 14:44:26 -0000 1.5 @@ -1,65 +1,8 @@ -/* - * - * ==================================================================== - * - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowlegement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowlegement may appear in the software itself, - * if and wherever such third-party acknowlegements normally appear. - * - * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact ap...@ap.... - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Group. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ - package com.mockobjects.sql; import com.mockobjects.ExpectationCounter; import com.mockobjects.MockObject; +import com.mockobjects.ReturnValue; import java.io.InputStream; import java.io.Reader; @@ -78,22 +21,21 @@ * To force throwing a SQLException on a getter, * set the corresponding value to be of type SQLException. */ -abstract public class MockResultSet extends MockObject implements ResultSet { +abstract class MockResultSet extends MockObject implements ResultSet { private final ExpectationCounter myCloseCalls; protected final ExpectationCounter myNextCalls; - private ResultSetMetaData myMetaData; - - private Statement myStatement; + private final ReturnValue myMetaData = new ReturnValue("meta data"); + private final ReturnValue myStatement = new ReturnValue("statement"); public MockResultSet() { this(MockResultSet.class.getName()); } public MockResultSet(String name) { - myCloseCalls =new ExpectationCounter(name+".close"); - myNextCalls =new ExpectationCounter(name+".next"); + myCloseCalls = new ExpectationCounter(name + ".close"); + myNextCalls = new ExpectationCounter(name + ".next"); } public void setExpectedCloseCalls(int calls) { @@ -107,11 +49,11 @@ // --------------------------------------------------------------------- setup public void setupMetaData(ResultSetMetaData metaData) { - myMetaData = metaData; + myMetaData.setValue(metaData); } public void setupStatement(Statement statement) { - myStatement = statement; + myStatement.setValue(statement); } // ------------------------------------------------------------------ abstract @@ -277,7 +219,7 @@ } public ResultSetMetaData getMetaData() throws SQLException { - return myMetaData; + return (ResultSetMetaData) myMetaData.getValue(); } public Ref getRef(int i) throws SQLException { @@ -297,7 +239,7 @@ } public Statement getStatement() throws SQLException { - return myStatement; + return (Statement) myStatement.getValue(); } public String getString(int columnIndex) throws SQLException { @@ -484,7 +426,7 @@ /** * Calls notImplemented. Returns false. */ - public boolean last() throws SQLException { + public boolean last() throws SQLException { notImplemented(); return false; } |
From: Jeff M. <cus...@us...> - 2002-12-31 14:36:09
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/io In directory sc8-pr-cvs1:/tmp/cvs-serv14343/src/jdk/common/com/mockobjects/io Modified Files: MockStreamFactory.java Log Message: Ditto Index: MockStreamFactory.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/io/MockStreamFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockStreamFactory.java 19 Jun 2002 15:26:24 -0000 1.1 +++ MockStreamFactory.java 31 Dec 2002 14:36:05 -0000 1.2 @@ -4,25 +4,36 @@ import alt.java.io.StreamFactory; import com.mockobjects.ExpectationValue; import com.mockobjects.MockObject; +import com.mockobjects.ReturnValue; import java.io.FileNotFoundException; import java.io.InputStream; +import java.io.OutputStream; public class MockStreamFactory extends MockObject implements StreamFactory { private final ExpectationValue myFile = new ExpectationValue("file"); - private InputStream myInputStream; + private final ReturnValue inputStream = new ReturnValue("input stream"); + private final ReturnValue outputStream = new ReturnValue("input stream"); public void setExpectedFile(File aFile) { myFile.setExpected(aFile); } public void setupInputStream(InputStream inputStream) { - this.myInputStream = inputStream; + this.inputStream.setValue(inputStream); } public InputStream createInputStream(File aFile) throws FileNotFoundException { myFile.setActual(aFile); - return myInputStream; + return (InputStream)inputStream.getValue(); + } + + public void setupOutputStream(OutputStream outputStream) { + this.outputStream.setValue(outputStream); + } + + public OutputStream createOutputStream(File aFile) throws FileNotFoundException { + return (OutputStream)outputStream.getValue(); } } |
From: Jeff M. <cus...@us...> - 2002-12-31 14:35:32
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/alt/java/io In directory sc8-pr-cvs1:/tmp/cvs-serv13763/src/jdk/common/alt/java/io Modified Files: StreamFactory.java StreamFactoryImpl.java Log Message: Added OutputStream to StreamFactory Index: StreamFactory.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/alt/java/io/StreamFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- StreamFactory.java 19 Jun 2002 15:26:23 -0000 1.1 +++ StreamFactory.java 31 Dec 2002 14:35:26 -0000 1.2 @@ -2,7 +2,9 @@ import java.io.FileNotFoundException; import java.io.InputStream; +import java.io.OutputStream; public interface StreamFactory { InputStream createInputStream(File aFile) throws FileNotFoundException; + OutputStream createOutputStream(File aFile) throws FileNotFoundException; } Index: StreamFactoryImpl.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/alt/java/io/StreamFactoryImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- StreamFactoryImpl.java 19 Jun 2002 15:26:23 -0000 1.1 +++ StreamFactoryImpl.java 31 Dec 2002 14:35:26 -0000 1.2 @@ -1,11 +1,13 @@ package alt.java.io; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; +import java.io.*; public class StreamFactoryImpl implements StreamFactory { public InputStream createInputStream(File aFile) throws FileNotFoundException { return new FileInputStream(aFile.getRealFile()); + } + + public OutputStream createOutputStream(File aFile) throws FileNotFoundException { + return new FileOutputStream(aFile.getRealFile()); } } |
From: Jeff M. <cus...@us...> - 2002-12-31 13:44:32
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/helpers In directory sc8-pr-cvs1:/tmp/cvs-serv18536/src/j2ee/1.3/com/mockobjects/helpers Modified Files: AbstractServletTestHelper.java Log Message: Set context on config Index: AbstractServletTestHelper.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/helpers/AbstractServletTestHelper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- AbstractServletTestHelper.java 25 Nov 2002 12:37:22 -0000 1.2 +++ AbstractServletTestHelper.java 31 Dec 2002 13:44:28 -0000 1.3 @@ -17,6 +17,7 @@ request.setSession(httpSession); servletContext.setupGetRequestDispatcher(requestDispatcher); httpSession.setupServletContext(servletContext); + servletConfig.setServletContext(servletContext); } public MockHttpServletRequest getRequest() { |
From: Jeff M. <cus...@us...> - 2002-12-31 13:43:06
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv17988/src/j2ee/1.3/com/mockobjects/servlet Modified Files: MockHttpServletRequest.java Log Message: Added support for protocol and change method to use ReturnValue Index: MockHttpServletRequest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet/MockHttpServletRequest.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- MockHttpServletRequest.java 10 Nov 2002 11:15:55 -0000 1.10 +++ MockHttpServletRequest.java 31 Dec 2002 13:43:01 -0000 1.11 @@ -12,6 +12,8 @@ import java.io.IOException; import java.security.Principal; +import com.mockobjects.ReturnValue; + /** * @version $Revision$ */ @@ -26,7 +28,8 @@ private String myPathInfo; private String myRemoteAddress; private String myRequestURI; - private String myMethod; + private final ReturnValue method = new ReturnValue("method"); + private final ReturnValue protocol = new ReturnValue("protocol"); private ServletInputStream myInputStream; private Principal myUserPrincipal; private Vector myAttributesNames; @@ -118,7 +121,7 @@ return null; } - public Enumeration getHeaders(java.lang.String arg1) { + public Enumeration getHeaders(String arg1) { notImplemented(); return null; } @@ -147,11 +150,11 @@ } public void setupGetMethod(String aMethod) { - this.myMethod = aMethod; + this.method.setValue(aMethod); } public String getMethod() { - return myMethod; + return (String)method.getValue(); } public String getParameter(String paramName) { @@ -180,8 +183,11 @@ } public String getProtocol() { - notImplemented(); - return null; + return (String)protocol.getValue(); + } + + public void setupGetProtocol(String protocol) { + this.protocol.setValue(protocol); } public String getQueryString() { @@ -217,7 +223,7 @@ } public RequestDispatcher getRequestDispatcher( - java.lang.String arg1) { + String arg1) { notImplemented(); return null; } |
From: Jeff M. <cus...@us...> - 2002-12-31 13:40:56
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql In directory sc8-pr-cvs1:/tmp/cvs-serv16997/src/jdk/common/com/mockobjects/sql Modified Files: MockDriver.java Log Message: Tidy imports Index: MockDriver.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/com/mockobjects/sql/MockDriver.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockDriver.java 13 Apr 2002 15:08:23 -0000 1.1 +++ MockDriver.java 31 Dec 2002 13:40:52 -0000 1.2 @@ -1,7 +1,7 @@ package com.mockobjects.sql; import java.sql.*; -import java.util.*; +import java.util.Properties; public class MockDriver implements Driver{ public static MockDriver myDriver = new MockDriver(); |
From: Jeff M. <cus...@us...> - 2002-12-31 13:40:06
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects In directory sc8-pr-cvs1:/tmp/cvs-serv16525/src/core/test/mockobjects Added Files: TestReturnValue.java Log Message: Added ReturnValue class --- NEW FILE: TestReturnValue.java --- package test.mockobjects; import com.mockobjects.util.TestCaseMo; import com.mockobjects.ReturnValue; import junit.framework.AssertionFailedError; public class TestReturnValue extends TestCaseMo { private final ReturnValue value = new ReturnValue(getName()); public void testGetNull(){ value.setValue(null); assertTrue(value.getValue()==null); } public void testGetValue(){ value.setValue(this); assertEquals(this, value.getValue()); } public void testValueNotSet() { try { value.getValue(); fail("Error not thrown"); } catch (AssertionFailedError e) { assertEquals("The return value \"" + getName() + "\" has not been set.", e.getMessage()); } } public TestReturnValue(String name) { super(name); } public static void main(String[] args) { start(new String[] { TestReturnValue.class.getName()}); } } |
From: Jeff M. <cus...@us...> - 2002-12-31 13:40:05
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects In directory sc8-pr-cvs1:/tmp/cvs-serv16525/src/core/com/mockobjects Added Files: ReturnValue.java Log Message: Added ReturnValue class --- NEW FILE: ReturnValue.java --- package com.mockobjects; import com.mockobjects.util.AssertMo; import com.mockobjects.util.Null; /** * <p>The ReturnValue class allows a value to be setup which will then be returned upon a specific * method call. If </code>value.getValue()</code> is called before <code>value.setValue(value)</code> * the ReturnValue will raise an error warning that this value has not been set. If the required * return value is <code>null</code> the return value can be set like this * <code>value.setValue(null)</code> in this case calling <code>value.getValue()</code> * will return null.<p> * * <p>The advantage of this is provide better information to the user of a mock when * interacting with third party code which may expect certain values to have been set.</p> * * e.g. * <pre> * private final ReturnValue value = new ReturnValue("value"); * * public void setupValue(Integer value){ * value.setValue(value); * } * * public Integer getValue(){ * return (Integer)value.getValue(); * } * </pre> * @version $Revision: 1.1 $ */ public class ReturnValue { private final String name; private Object value; /** * @param name the name used to identify the ReturnValue when an error is raised */ public ReturnValue(String name) { this.name = name; } /** * @return the value set using setValue * @exception junit.framework.AssertionFailedError throw if setValue has not been called */ public Object getValue() { AssertMo.assertNotNull("The return value \"" + name + "\" has not been set.", value); if(value instanceof Null){ return null; } return value; } /** * * @param value value to be returned be getValue. null can be use to force getValue to return null. */ public void setValue(Object value) { if(value==null){ value = Null.NULL; }else{ this.value = value; } } } |
From: Jeff M. <cus...@us...> - 2002-12-31 13:39:28
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/helpers In directory sc8-pr-cvs1:/tmp/cvs-serv16278/src/j2ee/1.3/com/mockobjects/helpers Modified Files: FilterTestHelper.java Log Message: Tidy imports Index: FilterTestHelper.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/helpers/FilterTestHelper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- FilterTestHelper.java 14 Oct 2002 22:58:28 -0000 1.1 +++ FilterTestHelper.java 31 Dec 2002 13:39:24 -0000 1.2 @@ -4,8 +4,6 @@ import com.mockobjects.servlet.MockFilterConfig; import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; import javax.servlet.ServletException; import java.io.IOException; |
From: Jeff M. <je...@mk...> - 2002-12-30 10:14:02
|
> > I am also not yet sure about ReturnObjectList. I assume it is intended to hold > values returned by a single method. This way it only holds values of the same > type, e.g. a sequence of characters to simulate a file stream. > Yup, the ReturnObjectList is a list of objects which is used to setup the values returned by a method call. It's a verifiable object so you can check that all the objects in the list have been pulled out (size()==0) and will through an error if you try and remove objects when the list is empty. -- jeff martin information technologist mkodo limited mobile: 44 (0) 78 5547 8331 phone: 44 (0) 20 2226 4545 email: je...@mk... www.mkodo.com |
From: Ewald A. <mo...@ew...> - 2002-12-28 10:57:29
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello all, > I do not know C++ iterators, so I do not exactly understand your comment. Simply speaking, in C++ iterator are some kind of intelligent pointers and if you work on a sequence your need one to "point" to the beginning and one to "point" to the end. While processing the "cursor" iterator is incremented and the end is reached when cursor==end is true. There is nothing like an end() method. > values indexed by key. List is conceptually like an array, accessed > through in index. A Set is a collection which holds only one of each > value. So if I got this right, a list expectation is to enforce presence *and* order whereas a set just checks presence? I am also not yet sure about ReturnObjectList. I assume it is intended to hold values returned by a single method. This way it only holds values of the same type, e.g. a sequence of characters to simulate a file stream. There are some more files in the dynamic subdirectory. ExpectedCall.java, ExpectedReturn.java or Mock.java for example. Are they of general use? I must admit I don't understand the purpose of them. Maybe it all relies too much on the reflection api to make use of it. BTW: in the meanwhile cvs is rather complete (as far as I can say yet) and compiles cleanly on my side. bye Ewald - -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de mobil/sms:+49-162-8001240 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+DBTkXyQcrD0ZXUYRAtrRAJ9zPMSSf+zy+bcTENwul2fioNdu9ACeKsWR tjVHyTZBRvs75GbM/vd2ZCQ= =OsEt -----END PGP SIGNATURE----- |
From: Francois B. <fbe...@ft...> - 2002-12-23 21:30:23
|
Hello Ewald, Please see embedded comments. On Mon, 23 Dec 2002 21:12:07 +0100, "Ewald Arnold" <mo...@ew...> said: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello, > > I have started really transforming the files and came across some > questions: > > > In AbstractExpectationcollention there is > > - - Object[] ==> similar to C array: int[3] = { 1, 2, 3} ? > Probably replace by std::vector. In Java, all objects are subclasses of a root class: Object. This allows an Object[] array to hold any type of objects in the Java universe. > > - - Enumeration ==> no idea Enumeration is just a kind of iterator. > > - - Iterator ==> similar to C++ iterators ? > Except maybe that c++ iterators don't know anything about their end, > so you need two of them. I do not know C++ iterators, so I do not exactly understand your comment. > > > Why are there ExpectationList, ExpectationMap and ExpectationSet? They > seem to > have the same interface and function though their inheritance tree is > different. In the Java Collections Framework, there are three types of collections: List, Set and Map. Map is a dictionnary-like collection. It holds values indexed by key. List is conceptually like an array, accessed through in index. A Set is a collection which holds only one of each value. For example: Set s = new ...; s.add("a"); s.add("b"); s.add("a"); assertEquals("duplicate values not added", 2, s.size()); List l = new ...; l.add("a"); l.add("b"); l.add("a"); assertEquals("duplicate values added", 3, l.size()); > > > In ExpectationValue::verify() I added a check for expectNothing, taken > from > ExpectationValueDouble, seems to be forgotton. The same for the check for > null which seems to test for an unused/unassigned element. > > if( expectNothing ) { > AssertMo.assertNull( myName + " expected no value", > actualValue ); > } else if( expectedValue != null ) { Maybe the MockObjects framework is missing a test in ExpectationDouble... I'll let someone else check on that. > > cheers > Ewald > <snip /> Bye ! Francois Beausoleil -- http://fastmail.fm - I mean, what is it about a decent email service? |
From: Ewald A. <mo...@ew...> - 2002-12-23 20:12:19
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I have started really transforming the files and came across some questions: In AbstractExpectationcollention there is - - Object[] ==> similar to C array: int[3] = { 1, 2, 3} ? Probably replace by std::vector. - - Enumeration ==> no idea - - Iterator ==> similar to C++ iterators ? Except maybe that c++ iterators don't know anything about their end, so you need two of them. Why are there ExpectationList, ExpectationMap and ExpectationSet? They seem to have the same interface and function though their inheritance tree is different. In ExpectationValue::verify() I added a check for expectNothing, taken from ExpectationValueDouble, seems to be forgotton. The same for the check for null which seems to test for an unused/unassigned element. if( expectNothing ) { AssertMo.assertNull( myName + " expected no value", actualValue ); } else if( expectedValue != null ) { cheers Ewald - -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de mobil/sms:+49-162-8001240 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+B24cXyQcrD0ZXUYRAmk2AKC/W/ldhRZky6mqCI04NqP1ctpkiwCgm1Yh zp3532VNgBp0EFeYKfhrWEc= =Zkxg -----END PGP SIGNATURE----- |
From: Ewald A. <mo...@ew...> - 2002-12-23 09:11:23
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I have commited the first time to mockpp cvs. I prepared the development files around the project and transformed all the java files I think I will need. The whole does not compile at all, I just transformed the syntax more or less so don't expect too much yet. cheers Ewald - -- Ewald Arnold, Germany mailto:ewald at ewald-arnold dot de mobil/sms:+49-162-8001240 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+BtMSXyQcrD0ZXUYRAg31AJ0TdhYeJ1lHcOJSrmTsG3ov4rCyeQCfexkZ W8rMe8g9KYkll53e9P1cQdM= =WP/q -----END PGP SIGNATURE----- |
From: Steve F. <st...@m3...> - 2002-12-20 10:26:12
|
While C++ may be missing reflection (except for the dynamic casts), you might be able to do something interesting with templates and macros. We didn't always have the Verifier, so it's perfectly possible to do set up the verify method by hand. S. Scott Lamb wrote: > Ewald Arnold wrote: >> - Verfier.java contains some parameters of type "Field". What does >> this mean and how could one solve this with c++? > > Hmm, that's using the Java introspection API. C++ doesn't have anything > like that. I don't think a verifier for an arbitrary class is possible. > You'll need to make each class call verify for each of its verifiable > members. Maybe verifiable could take a parameter of a collection to add > itself to so this is easier. |