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. <je...@mk...> - 2002-08-30 14:31:00
|
Umm, am I missing something? On Fri, 2002-08-30 at 13:35, Ted Husted wrote: > Okey-doke. #602384 > > http://sourceforge.net/tracker/?group_id=18189&atid=318189 > > -Ted. > > Jeff Martin wrote: > > >Just for a laugh I've started on a FAQ page for the web site. > > > >http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/mockobjects/mockobjects-java/doc/html/faq.html?rev=1.1 > > > >It'd be really cool if people could hack this file about adding new > >questions and answering the ones that are already there. > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- 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: Ted H. <hu...@ap...> - 2002-08-30 12:35:32
|
Okey-doke. #602384 http://sourceforge.net/tracker/?group_id=18189&atid=318189 -Ted. Jeff Martin wrote: >Just for a laugh I've started on a FAQ page for the web site. > >http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/mockobjects/mockobjects-java/doc/html/faq.html?rev=1.1 > >It'd be really cool if people could hack this file about adding new >questions and answering the ones that are already there. > |
From: Jeff M. <je...@mk...> - 2002-08-29 13:01:32
|
Just for a laugh I've started on a FAQ page for the web site. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/mockobjects/mockobjects-java/doc/html/faq.html?rev=1.1 It'd be really cool if people could hack this file about adding new questions and answering the ones that are already there. -- 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: Jeff M. <cus...@us...> - 2002-08-29 12:57:54
|
Update of /cvsroot/mockobjects/mockobjects-java/doc/html In directory usw-pr-cvs1:/tmp/cvs-serv23730/html Modified Files: template.txt Added Files: faq.html Log Message: Added faq page --- NEW FILE: faq.html --- <ul> <li> <h3>What's a mock object?</h3> <p> It's a thing! </p> </li> <li> <h3>What's an expectation?</h3> <p> It's another thing! </p> </li> <li> <h3>Why should I bother?</h3> <p> </p> </li> <li> <h3>Why do I have to call setup???? to instead of set??? to add something to a map?</h3> <p> </p> </li> <li> <h3>Who do I contribute changes back to the mock objects project?</h3> <p> </p> </li> <li> <h3>What does it mean when I get a NotImplementedException?</h3> <p> </p> </li> <li> <h3>How do I write a mock?</h3> <p> </p> </li> <li> <h3>Why don't mocks verify their expectations?</h3> <p> </p> </li> <li> <h3>What are the alt.* packages for?</h3> <p> </p> </li> <li> <h3>What do I do if I can't find a mock for a class?</h3> <p> </p> </li> <li> <h3>Are there any tools to help create mocks?</h3> <p> </p> </li> <li> <h3>Why are the internals of mock private when there just test classes?</h3> <p> </p> </li> </ul> Index: template.txt =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/doc/html/template.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- template.txt 29 Aug 2002 12:17:21 -0000 1.1 +++ template.txt 29 Aug 2002 12:57:50 -0000 1.2 @@ -24,10 +24,9 @@ td.c7 '{'color: #ffffff; font-family: arial,helvetica,sanserif; font-size: 119%'}' li.c6 '{'list-style: none'}' - a.c5 '{'font-size: 80%'}' + a.menu '{'font-size: 80%'}' span.c4 '{'font-family: arial,helvetica,sanserif'}' span.c3 '{'font-size: 80%'}' - span.c2 '{'color: #000000; font-size: 119%'}' span.c1 '{'font-size: 64%'}' </style> </head> @@ -60,79 +59,32 @@ </td> <td nowrap="1" valign="top" width="14%"> - <span class="c1">Last update : September 8 - 2001</span><br> - <span class="c4"><br> - <span class="c2">About</span><br> - </span> - <ul class="noindent"> - <li><a href="./index.html" class="c5">Home</a></li> +<h4>About</h4> + <a href="./index.html" class="menu">Home</a><br> + <a href="./todo.html" class="menu">Roadmap/Todo</a><br> + <a href="./changes.html" class="menu">Changes</a><br> + <a href="./license.html" class="menu">License</a><br> + +<h4>Downloads</h4> + <a href="./downloads.html" class="menu">Downloads</a><br> + +<h4>Documentation</h4> + <a href="./endotesting.html" class="menu">Introduction</a><br> + <a href="./faq.html" class="menu">FAQ</a><br> + <a href="./papers.html" class="menu">Papers</a><br> + <a href="./naming_conventions.html" class="menu">Naming conventions</a><br> + <a target="" href="javadoc/index.html" class="menu">API Reference</a><br> + +<h4>Support</h4> + <a target="" href="http://sourceforge.net/tracker/?atid=118189&group_id=18189&func=browse" class="menu">Bug database</a><br> + <a target="" href="http://sourceforge.net/mail/?group_id=18189" class="menu">Mailing list</a><br> + +<h4>Developers</h4> + <a target="" href="http://sourceforge.net/cvs/?group_id=18189" class="menu">CVS</a><br> + <a href="./coding_conventions.html" class="menu">Coding conventions</a><br> + <a href="./release_process.html" class="menu">Release process</a><br> - <li><a href="./todo.html" class= - "c5">Roadmap/Todo</a></li> - - <li><a href="./changes.html" class= - "c5">Changes</a></li> - - <li><a href="./license.html" class= - "c5">License</a></li> - - <li class="c6"><br> - <br> - <span class="c2">Downloads</span><br> - </li> - - <li><a href="./downloads.html" class= - "c5">Downloads</a></li> - - <li class="c6"><br> - <br> - <span class="c2">Documentation</span><br> - </li> - - <li><a href="./endotesting.html" class= - "c5">Introduction</a></li> - - <li><a href="./papers.html" class="c5">Papers</a></li> - - <li><a href="./naming_conventions.html" class= - "c5">Naming conventions</a></li> - - <li><a target="" href="javadoc/index.html" class= - "c5">API Reference</a></li> - - <li class="c6"><br> - <br> - <span class="c2">Support</span><br> - </li> - - <li><a target="" href= - "http://sourceforge.net/tracker/?atid=118189&group_id=18189&func=browse" - class="c5">Bug database</a></li> - - <li><a target="" href= - "http://sourceforge.net/mail/?group_id=18189" class= - "c5">Mailing list</a></li> - - <li class="c6"><br> - <br> - <span class="c2">Developers</span><br> - </li> - - <li><a target="" href= - "http://sourceforge.net/cvs/?group_id=18189" class= - "c5">CVS</a></li> - - <li><a href="./coding_conventions.html" class= - "c5">Coding conventions</a></li> - - <li><a href="./release_process.html" class="c5">Release - process</a></li> - - <li class="c6"><br> - </li> - </ul> </td> <td align="left" valign="top" width="*"> |
From: Jeff M. <cus...@us...> - 2002-08-29 12:57:53
|
Update of /cvsroot/mockobjects/mockobjects-java/doc In directory usw-pr-cvs1:/tmp/cvs-serv23730 Modified Files: site.xml Log Message: Added faq page Index: site.xml =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/doc/site.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- site.xml 29 Aug 2002 12:17:21 -0000 1.1 +++ site.xml 29 Aug 2002 12:57:49 -0000 1.2 @@ -20,6 +20,7 @@ <arg value="html/release_process.html"/> <arg value="html/todo.html"/> <arg value="html/index.html"/> + <arg value="html/faq.html"/> </java> </target> |
From: Jeff M. <je...@mk...> - 2002-08-29 12:28:54
|
I've just checked in a simplified version of the web site build process which I hope will make it easier for anyone to publish unto the web site. Basically i inserts html bodies into a standard template for the site. The idea being that to write a page you just use things like <h1>This is the title</h1> <p>First paragraph</p> this is then embedded into the template html to added the headers/menus etc. This will also contain css to make sure the pages look pretty. This will hopefully make it easier to write pages if you already know html and you can use most html editors to edit them. The system is all self contained so there's no need to go off and download a third party tool and try and get it to run. just try the following. cd doc ant -f site.xml Here's one I made earlier http://www.custommonkey.org/mock/index.html Still need tidying up and work done on style sheets etc. -- 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: Jeff M. <cus...@us...> - 2002-08-29 12:17:24
|
Update of /cvsroot/mockobjects/mockobjects-java/doc/html In directory usw-pr-cvs1:/tmp/cvs-serv10521/html Added Files: alt.html changes.html coding_conventions.html downloads.html endotesting.html index.html license.html naming_conventions.html papers.html release_process.html template.txt todo.html Log Message: Add simplified build sytem for web site --- NEW FILE: alt.html --- <html> <head> <title>alt.java why?</title> </head> </html> --- NEW FILE: changes.html --- <div class="c9"> <table cellpadding="2" cellspacing="0" border="0" width="100%"> <tr> <td bgcolor="#525D76"><span class= "c7"><b>0.01 (release on August 12 2001</b></span> </td> </tr> <tr> <td> <span class="c8"><br> </span> <ul> <li><img align="absmiddle" border="0" alt="update" src="images/update.jpg"> The distribution zip now includes a zip of the sources. (SMGF)</li> <li><img align="absmiddle" border="0" alt="update" src="images/update.jpg"> Improved the build process and generate the user web site from XML files using stylebook. (VMA)</li> <li><img align="absmiddle" border="0" alt="add" src="images/add.jpg"> Added a user web site (in addition to the <a href= "http://sf.net/projects/mockobjects">developer's web site</a> provided by SourceForge). Added a project description, todo and changes pages. (VMA)</li> </ul> </td> </tr> </table> </div> <br> --- NEW FILE: coding_conventions.html --- <div class="c11"> <table cellpadding="2" cellspacing="0" border="0" width="100%"> <tr> <td bgcolor="#525D76" class="c7"> <b>Forewords</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">This document describes a list of coding conventions that are required for code submissions to the project. By default, the coding conventions for most Open Source Projects should follow the existing coding conventions in the code that you are working on. For example, if the bracket is on the same line as the if statement, then you should write all your code to have that convention.</p> <table border="0" cellpadding="0" cellspacing="3" width="100%"> <tr> <td valign="top" width="28"><img alt= "Note" border="0" hspace="0" vspace="0" height="29" width="28" src= "images/note.gif"></td> <td valign="top"><span class= "c10"><i><b>If you commit code that does not follow these conventions and you are caught, you are responsible for also fixing your own code.</b></i></span> </td> </tr> </table> <br> <br> <span class="c8"></span> <p class="c9">Below is a list of coding conventions that are specific to Mock Objects, everything else not specificially mentioned here should follow the official <a href= "http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html"> Sun Java Coding Conventions</a>.</p> </td> </tr> </table> </div> <br> <div class="c11"> <table cellpadding="2" cellspacing="0" border="0" width="100%"> <tr> <td bgcolor="#525D76" class="c7"><b>Mock Objects specific coding conventions</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <div class="c11"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c12"> <b>1. Brackets</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">For class and method declaration, brackets should begin on the <b>same</b> line. Example :</p> <div class="c13"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> public class SomeClass { public void someMethod() { } } </pre> </td> </tr> </table> </div> <p class="c9">Brackets for blocks of code inside methods should begin and end on the <b>same</b> line (this applies to <code class= "c14">if</code>, <code class= "c14">for</code>, <code class= "c14">while</code>, <code class= "c14">try/catch</code>, ...). Example :</p> <div class="c13"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> public void someMethod() { if (expression) { } else if (other_expression) { } try { } catch (Exception e) { } } </pre> </td> </tr> </table> </div> <p class="c9"><b>Brackets are mandatory even for single line statements !</b></p> <div class="c13"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> // Incorrect if (expression) // some code // Correct if (expression) { // some code } </pre> </td> </tr> </table> </div> </td> </tr> </table> </div> <span class="c8"><br> </span> <div class="c11"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c12"> <b>2. Blank Spaces</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">keywords followed by a parenthesis should be separated by a space. Example :</p> <div class="c13"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> while (true) { // some code } </pre> </td> </tr> </table> </div> <p class="c9">Blank space should appear after commas in argument lists. Binary operators should be separated from their operands by spaces :</p> <div class="c13"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> a += c + d; a = (a + b) / (c * d); while (d++ = s++) { n++; } printSize("size is " + foo + "\n"); </pre> </td> </tr> </table> </div> </td> </tr> </table> </div> <span class="c8"><br> </span> <div class="c11"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c12"> <b>3. Indentations</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9"><b>4 spaces. NO tabs</b>. Period. We understand that a lot of you like to use tabs, but the fact of the matter is that in a distributed development environment, when the cvs commit messages get sent to a mailing list, they are almost impossible to read if you use tabs.</p> </td> </tr> </table> </div> <span class="c8"><br> </span> <div class="c11"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c12"> <b>4. Comments</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">Javadoc SHOULD exist on all your class members (methods + class variables), including the private ones. Also, if you are working on existing code and there currently isn't a javadoc for that method/class/variable or whatever, then you should contribute and add it. This will improve the project as a whole.</p> <p class="c9">Also add code comments when you think it's necessary (like assumptions), especially when the code is not obvious.</p> </td> </tr> </table> </div> <span class="c8"><br> </span> <div class="c11"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c12"> <b>5. License</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">The Jakarta Apache/Cactus License MUST be placed at the top of each and every file.</p> </td> </tr> </table> </div> <span class="c8"><br> </span> <div class="c11"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c12"> <b>6. Author references</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">If you contribute to a file (code or documentation), add yourself to the top of the file (below the existing authors). For java files the preferred Javadoc format is:</p> <div class="c13"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> @author <a href="mailto:us...@do...">John Doe</a> </pre> </td> </tr> </table> </div> </td> </tr> </table> </div> <span class="c8"><br> </span> <div class="c11"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c12"> <b>7. Class variables</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">Class variables should be prefixed with <b>my</b>. Example :</p> <div class="c13"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> public class SomeClass { private String myString; [...] public void someMethod() { logger.debug("Value = " + myString); } } </pre> </td> </tr> </table> </div> </td> </tr> </table> </div> <span class="c8"><br> </span> <div class="c11"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c12"> <b>8. Parameter names</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">Method parameters should be prefixed by "<code class= "c14">a</code>" (for differentiating them from inner variables). For example :</p> <div class="c13"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> public void someMethod(String aClassName) { String className; // inner variable } </pre> </td> </tr> </table> </div> </td> </tr> </table> </div> <span class="c8"><br> </span> <div class="c11"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c12"> <b>9. Line length</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">Avoid lines longer than 78 characters for Code, comments, ...</p> </td> </tr> </table> </div> <span class="c8"><br> </span> <div class="c11"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c12"> <b>10. Versionning</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">All .java files should have a <code class= "c14">@version</code> tag like the one below.</p> <div class="c13"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> @version $Id: coding_conventions.html,v 1.1 2002/08/29 12:17:21 custommonkey Exp $ </pre> </td> </tr> </table> </div> <table border="0" cellpadding="0" cellspacing="3" width="100%"> <tr> <td valign="top" width="28"> <img alt="Note" border="0" hspace="0" vspace="0" height= "29" width="28" src= "images/note.gif"></td> <td valign="top"><span class= "c10"><i>You just need to write <code class="c14">@version $Id: coding_conventions.xml,v 1.4 2001/08/22 10:36:45 vmassol Exp $</code> and CVS will add the rest during commits</i></span> </td> </tr> </table> <br> <br> <span class="c8"></span> </td> </tr> </table> </div> <span class="c8"><br> </span> </td> </tr> </table> </div> <br> --- NEW FILE: downloads.html --- <h1>Packages</h1> <p> All files can be downloaded from the <a href="http://sourceforge.net/projects/mockobjects">SourceForge developer's page</a>. There are currently 4 packages from which you can download files. A package is simply a set of files (this is the SourceForge notion) :</font></p> <ul> <li> <b>mockobjects-java</b> : Contains the core framework and mock implementations for the Java platform (<code><font face="courier, monospaced">java.*</font></code> and <code><font face="courier, monospaced">javax.*</font></code> APIs). It is composed of the following files :</font> <ul> <li><font color="#000000" face= "arial,helvetica,sanserif"><b><code><font face= "courier, monospaced">mockobjects_<version>.zip</font></code></b> : contains source and documentation</font></li> </ul> </li> <li><font color="#000000" face= "arial,helvetica,sanserif"><b><code><font face= "courier, monospaced">mockobjects-visualage</font></code></b> : Contains a mock implementation for the VisualAge Tools API. It is composed of the following files :</font> <ul> <li><font color="#000000" face= "arial,helvetica,sanserif"><none> <i>[to be available soon]</i></font></li> </ul> </li> <li><font color="#000000" face= "arial,helvetica,sanserif"><b><code><font face= "courier, monospaced">mockobjects-atg-dynamo</font></code></b> : Contains a mock implementation for some proprietary ATG Dynamo classes. It is composed of the following files :</font> <ul> <li><font color="#000000" face= "arial,helvetica,sanserif"><b><code><font face= "courier, monospaced">mo_atg_dynamo_<version>.jar</font></code></b> : contains the source files</font></li> </ul> </li> <li><font color="#000000" face= "arial,helvetica,sanserif"><b><code><font face= "courier, monospaced">mockobjects-dev</font></code></b> : Contains some tools to help build the project from it's source. This is for developers only is not not needed to use the framework. These tools work against the CVS mockobjects-java module and not against the sources that can be found in the previously mentionned files. The next release of the project (0.01) will clearly separate the user files (runtime jars + documentation) from the developer files (source + build process). It is composed of the following files :</font> <ul> <li><font color="#000000" face= "arial,helvetica,sanserif"><b><code><font face= "courier, monospaced">mockobjects-java-ant-<version>.zip</font></code></b> : A prepackaged version of Ant containing the needed tasks (Stylebook, ...) to build the project from it's sources.</font></li> </ul> </li> </ul> <h1>Releases</h1> Click <a href= "http://sourceforge.net/projects/mockobjects">here</a> for Mock Objects releases. --- NEW FILE: endotesting.html --- <h1>Endo-Testing: Unit Testing with Mock Objects</h1> <p> <i>This paper was presented at the conference, "eXtreme Programming and Flexible Processes in Software Engineering - XP2000". (c) 2000 Tim Mackinnon, Steve Freeman, Philip Craig. To be published in</i> XP eXamined by Addison-Wesley. The original paper is available <a href="misc/mockobjects.pdf">here</a> (PDF format).</p> <p><i>Unit testing is a fundamental practice in Extreme Programming, but most nontrivial code is difficult to test in isolation. It is hard to avoid writing test suites that are complex, incomplete, and difficult to maintain and interpret. Using Mock Objects for unit testing improves both domain code and test suites. They allow unit tests to be written for everything, simplify test structure, and avoid polluting domain code with testing infrastructure.</i></p> [...1074 lines suppressed...] <hr size="1" noshade=""> <i>Copyright © 2001 Mock Objects. All Rights Reserved.</i> </body> </html> --- NEW FILE: index.html --- <h1>Project description and goals</h1> <p> The <a href= "http://www.mockobjects.com">Mock Objects</a> project is a generic unit testing framework whose goal is to facilitate developing unit tests in the mock object style. The goal of this project is to provide: </p> <ul> <li> A core mock objects framework. This is a library of code that supports the implementation of mock objects. It is based around a set of expectation classes for values and collections. There are also various other classes to make mock objects easier to write or to use. </li> <li> A methodology for developing and using mock objects. </li> <li> A default set of mock implementation for the standard Java platform APIs. We have made a start on packages such as servlets, sql, and io. </li> <li> Mock implementations for more specialised libraries, particularly third party products. So far, we have started on ATG Dynamo and IBM's VisualAge for Java tools API. </li> <li> A community for exchanging ideas on anything related to unit testing, with a bias towards Mock Objects. </li> </ul> <p> Our larger goal is to make <a href= "www.mockobjects.com">www.mockobjects.com</a> the point of reference for ideas and tools for unit testing particularly based on Mock Objects. Our first implementation is in Java, largely because that's what we've been working in, but also because it has a stable set of APIs that are suitable for writing Mock Objects. We have applied these techniques to other environments and intend to publish the results here. </p> <h1>Latest news and announcements</h1> <table cellpadding="2" cellspacing="2" border="0" width="100%"> <tr> <td align="left" valign="top" rowspan=" 1" colspan="1" bgcolor="#a0ddf0"> <span class=" c11">2002/08/28 </span> </td> <td align="left" valign="top" rowspan=" 1" colspan="1" bgcolor="#a0ddf0"> <span class="c11">0.4 <a href=" http://sourceforge.net/project/showfiles.php?group_id=18189&release_id=101526">release</a> available. Kinda like the interim release but better.</span> </td> </tr> <tr> <td align="left" valign="top" rowspan= "1" colspan="1" bgcolor="#a0ddf0"> <span class= "c11">2002/05/02 </span> </td> <td align="left" valign="top" rowspan= "1" colspan="1" bgcolor="#a0ddf0"> <span class="c11">Interim release <a href= "mockobjects-cvsroot.tar.gz">Tarball</a> available. Not an official release but this snap shot has a lot of new mocks in it and is a must for j2ee development.</span> </td> </tr> <tr> <td align="left" valign="top" rowspan= "1" colspan="1" bgcolor="#a0ddf0"> <span class= "c11">2001/09/08 </span> </td> <td align="left" valign="top" rowspan= "1" colspan="1" bgcolor="#a0ddf0"> <span class="c11">Added a new section for papers on Mock Objects </span> </td> </tr> <tr> <td align="left" valign="top" rowspan= "1" colspan="1" bgcolor="#a0ddf0"> <span class= "c11">2001/08/06 </span> </td> <td align="left" valign="top" rowspan= "1" colspan="1" bgcolor="#a0ddf0"> <span class="c11">The Mock Objects project now has a user web site. We are committed to building a thriving framework and community around Mock Objects. Of course we're looking for help ... </span> </td> </tr> </table> <p class="c9"> <a href="http://sourceforge.net"><img align="right" hspace="4" vspace="4" border="0" alt="SourceForge Logo" src= "http://sourceforge.net/sflogo.php?group_id=18189"></a> </p> --- NEW FILE: license.html --- <div class="c10"> <table cellpadding="2" cellspacing="0" border="0" width="100%"> <tr> <td bgcolor="#525D76" class="c7"><b>Mock Objects Public License</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <div class="c9"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2001 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 acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" 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 name, without prior written * permission of the Apache Software Foundation. * * 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/>. */ </pre> </td> </tr> </table> </div> </td> </tr> </table> </div> <br> --- NEW FILE: naming_conventions.html --- <div class="c13"> <table cellpadding="2" cellspacing="0" border="0" width="100%"> <tr> <td bgcolor="#525D76" class="c7"><b>Mock Object Naming Conventions</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">Over time we have developed some naming conventions for how we write mock objects which we believe make them easier to work with.</p> <div class="c13"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c10"> <b>Creating expectations</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">We have built up a library of expectation classes to help with the development of mock objects. Each expectation object will compare pre-loaded expected values with actual values as they arrive. Where possible, the comparison will be made as the actual object is set, which helps to locate errors when they occur. Each expectation class has a constructor that takes a name value. This name will be displayed when an assertion fails, so it should help to identify the source of any error. For example, the instance variables for the mock sql statement include:</p> <div class="c11"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> protected ExpectationCounter myCloseCalls = new ExpectationCounter("MockStatement.closeCalls"); protected ExpectationCounter myExecuteCalls = new ExpectationCounter("MockStatement.executeCalls"); protected ExpectationValue myQueryString = new ExpectationValue("MockStatement.queryString"); </pre> </td> </tr> </table> </div> <p class="c9">Note that the variables have the name of the thing they test, <code class= "c12">myQueryString</code> rather than <code class= "c12">myExpectedQueryString</code>. This is to avoid repetitions such as :</p> <div class="c11"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> myExpectedQueryString.setExpected(aString); </pre> </td> </tr> </table> </div> </td> </tr> </table> </div> <span class="c8"><br> </span> <div class="c13"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c10"> <b>Setting expectations</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">All expectations are set with a method beginning <code class= "c12">setExpected<condition>,</code> where <code class= "c12"><condition></code> is a state or behaviour that will be verified during or at the end of the test. For example,</p> <div class="c11"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> myMockHttpResponse.setExpectedContentType("text/plain"); </pre> </td> </tr> </table> </div> <p class="c9">says that the <code class="c12">HttpResponse</code> expects to have its content type set to <code class= "c12">"text/plain"</code> during the test.</p> <p class="c9">If an expectation that a mock object supports is not set, then it will not be verified, this makes it easier to use a mock object for multiple tests. To check that a value is not changed during a test, each Expectation type supports the method <code class= "c12">setExpectNothing</code>. For example, to test that no properties of a bean have been set its mock implementation might include the method :</p> <div class="c11"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> public void setExpectNoPropertiesSet() { myProperties.setExpectNothing(); } </pre> </td> </tr> </table> </div> <p class="c9">The expectation collections include methods for adding single objects and collections of objects. This is to allow clients to set an expectation that is itself a collection object, perhaps to check the identity of an array, rather than its contents. When using a collection expectation in a mock object please be clear in your expectations whether you are adding to or overriding the current expected values. For example, the method :</p> <div class="c11"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> public void addExpectedProperty(String property) { myProperties.addExpected(property); } </pre> </td> </tr> </table> </div> <p class="c9">adds an additional property that the mock object will expect to receive. The method :</p> <div class="c11"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> public void setExpectedProperty(String property) { myProperties.setExpectNothing(); myProperties.addExpected(property); } </pre> </td> </tr> </table> </div> <p class="c9">resets the property expectation.</p> </td> </tr> </table> </div> <span class="c8"><br> </span> <div class="c13"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c10"> <b>Setting actual values</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">The actual values for comparison against the expected values will be set in the mock implementations of real methods. For example, we count the number of times <code class= "c12">close</code> is called in a mock sql statement in the method :</p> <div class="c11"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> public void close() throws SQLException { myCloseCalls.inc(); } </pre> </td> </tr> </table> </div> <p class="c9">similarly, to set a positional parameter in a mock prepared statement :</p> <div class="c11"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> public void setObject(int param, Object obj) throws SQLException { mySetParameters.addActual(new MapEntry(new Integer(param), obj)); } </pre> </td> </tr> </table> </div> </td> </tr> </table> </div> <span class="c8"><br> </span> <div class="c13"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c10"> <b>Setting stub values</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">Many mock objects are used for both validation of expectations and as stub implementations to allow tests to run without external dependencies. For example, we often need to set parameters values in a mock servlet request for the target code to retrieve; these properties values are not verified because we are testing how they are used, not how they are set. The setter method is :</p> <div class="c11"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> public void setupAddParameter(String paramName, String value) { setupAddParameter(paramName, new String[] { value }); } </pre> </td> </tr> </table> </div> <p class="c9">Our convention is that stub methods start with <code class= "c12">setup<state></code> to distinguish them from Java setter methods which have the format <code class= "c12">set<state></code>. Stub values are used by mock implementations of real methods.</p> <p class="c9">One unusual stub setting we use quite often is to force exceptions to be thrown. For example, the mock sql statement includes the method :</p> <div class="c11"> <table cellpadding="2" cellspacing="2" border="1"> <tr> <td> <pre> public void setupThrowExceptionOnExecute(SQLException exception); </pre> </td> </tr> </table> </div> <p class="c9">The statement stores the given exception object and throws it when <code class= "c12">execute()</code> is called. This technique is sometimes the only way to test certain types of failure.</p> </td> </tr> </table> </div> <span class="c8"><br> </span> </td> </tr> </table> </div> <br> --- NEW FILE: papers.html --- <h1>Papers</h1> <p> This is a collection of papers on Mock Objects style and practice.</p> <ul> <li><a href= "papers/jdbc_testfirst.html">Developing JDBC applications test-first</a> <p> Many developers find unit testing software with third-party components, such as databases, hard to do. It also shows how an approach based on Mock Objects can lead to more rigourous unit testing and, I believe, better structured code than working with a real database. <i>Steve Freeman</i></p> </li> </ul> --- NEW FILE: release_process.html --- <div class="c10"> <table cellpadding="2" cellspacing="0" border="0" width= "100%"> <tr> <td bgcolor="#525D76" class="c7"><b>Introduction</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">This document highlights our release process. It defines all the steps that need to be performed <b>before</b> releasing a new version of the Mock Objects project.</p> </td> </tr> </table> </div> <br> <div class="c10"> <table cellpadding="2" cellspacing="0" border="0" width= "100%"> <tr> <td bgcolor="#525D76" class="c7"><b>General steps</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <div class="c10"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c11"><b>Decide on the content of a release</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">Long before any release, we need to define what will go into that release, i.e. the list of tasks that need to be performed <b>prior</b> to that release. These tasks will be listed on the <a href="todo.html">Todo page</a>. Tasks can be proposed on the <a href= "http://sourceforge.net/mail/?group_id=18189">mailing list</a>.</p> </td> </tr> </table> </div> <span class="c8"><br> </span> <div class="c10"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c11"><b>Deciding on doing a release</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">Releasing a version is a community action that we all need to decide together (the committers of the project). Before <b>any</b> release, we will need to agree on doing a release. This entails sending a message on the <a href= "http://sourceforge.net/mail/?group_id=18189">mailing list</a> asking for a vote on the release. We will use the <a href= "http://jakarta.apache.org/site/decisions.html"> Apache Jakarta system for voting</a>.</p> </td> </tr> </table> </div> <span class="c8"><br> </span> <div class="c10"> <table cellpadding="2" cellspacing="0" border="0" width="99%"> <tr> <td bgcolor="#525D76" class="c11"><b>Updating the Changes page</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">The <a href= "changes.html">Changes page</a> need to be up to date at any time. The goal of this page is not to described fine-grained changes in CVS like "I have corrected a typo" but rather to advertise changes that are useful to end users (for example: "Improved the Mailing-list example by ..."). As it is very hard to remember everything that everyone has done, it is mandatory to fill this page as we do the modifications and not to wait till the release to fill it.</p> </td> </tr> </table> </div> <span class="c8"><br> </span> </td> </tr> </table> </div> <br> <div class="c10"> <table cellpadding="2" cellspacing="0" border="0" width= "100%"> <tr> <td bgcolor="#525D76" class="c7"><b>Detailed administrative steps</b></td> </tr> <tr> <td> <span class="c8"><br> </span> <p class="c9">This is a detailed check list of all the steps involved to actually perform the release :</p> <blockquote> <ol> <li>Agree on a release (see above).</li> <li>Designate a release manager for the current release.</li> <li>Ensure that no one is working on any part of the files (code freeze). This is done by posting a mail on the list asking for a code freeze.</li> <li>Verify that the <a href= "todo.html">todo.xml</a> page is up to date.</li> <li>Verify that the <a href= "changes.html">changes.xml</a> page is up to date.</li> <li>Verify that the <a href= "features.html">features.xml</a> page is up to date and includes all features available in all releases + the new ones from this release.</li> <li>Verify that the news items on the <a href= "index.html">index.html</a> page are up to date (major announcement should be listed there, a release is a major announcement - A news item should be added that says which version has been released with a link pointing to the changes page).</li> <li>Perform a Ant build on the dist target (<code class="c12">ant dist</code>) on the release manager's machine to ensure everything build fine including the tests, web site generation, ...</li> <li>Tag CVS, with the name MO_<version number>_RELEASE (For example, the 0.01 release would be tagged MO_0_01_RELEASE).</li> <li>Publish the distributables files to <a href= "https://sourceforge.net/project/admin/editpackages.php?group_id=18189"> SourceForge</a>. In the release notes area of SF, put a link to the Changes page (http://mockobjects.sf.net/changes.html).</li> <li>Increase the version number indicated in the <code class="c12">build.xml</code> file by 1 (for example, after 0.01, put 0.02).</li> <li>Write a short release announcement in the news area of SourceForge (with a link to the Changes page).</li> <li>Send a message to the dev and user mailing-lists of Mock Objects to announce the availability of the release (and add a link to the Changes page).</li> <li>Send announcements to other mailing-lists (XP mailing lists on yahoogroups, JUnit mailing list) and web sites (junit.org, objectmentor, ...)</li> <li>... then relax ! ;-)</li> </ol> </blockquote> </td> </tr> </table> </div> --- NEW FILE: template.txt --- <html> <head> <meta name="generator" content="HTML Tidy, see www.w3.org"> <title>Mock Objects</title> <style type="text/css"> body '{' background-color: #ffffff; color: #000000; '}' :link '{' color: #525D76 '}' :visited '{' color: #023264 '}' :active '{' color: #023264 '}' span.c14 '{'color: #525D76; font-family: arial,helvetica,sanserif; font-size: 80%'}' div.c13 '{'text-align: right'}' code.c12 '{'font-family: courier, monospaced'}' div.c11 '{'text-align: center'}' td.c10 '{'color: #ffffff; font-family: arial,helvetica,sanserif; font-size: 100%'}' p.c9 '{'color: #000000; font-family: arial,helvetica,sanserif; text-align: justify'}' span.c8 '{'color: #000000; font-family: arial,helvetica,sanserif'}' td.c7 '{'color: #ffffff; font-family: arial,helvetica,sanserif; font-size: 119%'}' li.c6 '{'list-style: none'}' a.c5 '{'font-size: 80%'}' span.c4 '{'font-family: arial,helvetica,sanserif'}' span.c3 '{'font-size: 80%'}' span.c2 '{'color: #000000; font-size: 119%'}' span.c1 '{'font-size: 64%'}' </style> </head> <body marginheight="4" marginwidth="4" leftmargin="4" topmargin= "4"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top"><a href= "http://www... [truncated message content] |
From: Jeff M. <cus...@us...> - 2002-08-29 12:17:24
|
Update of /cvsroot/mockobjects/mockobjects-java/doc In directory usw-pr-cvs1:/tmp/cvs-serv10521 Added Files: SiteHack.java site.xml Log Message: Add simplified build sytem for web site --- NEW FILE: SiteHack.java --- import java.io.*; import java.text.MessageFormat; /** * $Revision: 1.1 $ */ public class SiteHack { public static void main(String[] args) throws IOException { new SiteHack(args); } public SiteHack(String htmlFiles[]) throws IOException { String templateFile = htmlFiles[0]; MessageFormat template = new MessageFormat( readFileContent(templateFile)); for (int i = 1; i < htmlFiles.length; i++) { writeToFile(htmlFiles[i], template.format(new Object[]{ readFileContent(htmlFiles[i])})); } } private final void writeToFile(String fileName, String content) throws IOException { File outputFile = new File("out", new File(fileName).getName()); if (!outputFile.getParentFile().exists()) { outputFile.getParentFile().mkdirs(); } System.out.println("Writing file :" + outputFile.getCanonicalPath()); FileWriter writer = new FileWriter(outputFile); writer.write(content); writer.flush(); writer.close(); } private final String readFileContent(String fileName) throws IOException { StringBuffer fileContents = new StringBuffer(); System.out.println("Reading file :" + fileName); BufferedReader reader = new BufferedReader(new FileReader(fileName)); String line=null; while ((line = reader.readLine()) != null) { fileContents.append(line); fileContents.append("\r\n"); } return fileContents.toString(); } } --- NEW FILE: site.xml --- <?xml version="1.0" encoding="UTF-8"?> <project name="site" default="site" basedir="."> <target name="site"> <javac srcdir="."> <include name="SiteHack.java"/> </javac> <java classname="SiteHack"> <classpath path="."/> <arg value="html/template.txt"/> <arg value="html/alt.html"/> <arg value="html/changes.html"/> <arg value="html/coding_conventions.html"/> <arg value="html/downloads.html"/> <arg value="html/endotesting.html"/> <arg value="html/index.html"/> <arg value="html/license.html"/> <arg value="html/naming_conventions.html"/> <arg value="html/papers.html"/> <arg value="html/release_process.html"/> <arg value="html/todo.html"/> <arg value="html/index.html"/> </java> </target> </project> |
From: Jeff M. <cus...@us...> - 2002-08-29 12:13:41
|
Update of /cvsroot/mockobjects/mockobjects-java/doc/html In directory usw-pr-cvs1:/tmp/cvs-serv9572/html Log Message: Directory /cvsroot/mockobjects/mockobjects-java/doc/html added to the repository |
From: Jeff M. <je...@mk...> - 2002-08-29 09:12:01
|
Your gonna start at the top and work down 'til you get bored. This page should have useful descriptions of each of the classes. They may seem obvious to you, but not to everyone. http://www.mockobjects.com/javadoc/com/mockobjects/package-summary.html Is an expectation segment for testing oranges? Does it work on other citrus fruit as well? More when I can be bothered. -- 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: Jeff M. <je...@mk...> - 2002-08-29 09:05:57
|
Okay you can stop panicking now, it's back. Well kinda, I was going to sort out the site anyway ;o) On Thu, 2002-08-29 at 09:49, Jeff Martin wrote: > Sorry, I've just clobbered the index page of mockobjects.com. Just > trying to get it back now. > > Doh > > > -- > jeff martin > information technologist > mkodo limited > > mobile: 44 (0) 78 5547 8331 > phone: 44 (0) 20 2226 4545 > email: je...@mk... > > www.mkodo.com > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- 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: Jeff M. <je...@mk...> - 2002-08-29 08:53:03
|
Sorry, I've just clobbered the index page of mockobjects.com. Just trying to get it back now. Doh -- 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: Jeff M. <cus...@us...> - 2002-08-29 08:34:41
|
Update of /cvsroot/mockobjects/mockobjects-java In directory usw-pr-cvs1:/tmp/cvs-serv31389 Modified Files: build.xml Log Message: Added Javadoc groupings Index: build.xml =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/build.xml,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- build.xml 30 Jul 2002 18:22:35 -0000 1.23 +++ build.xml 29 Aug 2002 08:34:36 -0000 1.24 @@ -354,6 +354,16 @@ <pathelement path="${src.dir}/j2ee/common"/> <pathelement path="${src.dir}/j2ee/1.3"/> </sourcepath> + <group title="Core" packages="com.mockobjects"/> + <group title="JDK" packages="com.mockobjects.*"/> + <group title="J2ee"> + <package name="com.mockobjects.mail*"/> + <package name="com.mockobjects.servlet"/> + <package name="com.mockobjects.jms"/> + </group> + <group title="Utils" packages="com.mockobjects.util"/> + <group title="Alternative" packages="alt.*"/> + <group title="Tests" packages="com.mockobjects.test"/> </javadoc> </target> |
From: Vincent M. <vm...@oc...> - 2002-08-28 19:55:34
|
Good idea. Thanks! -Vincent > -----Original Message----- > From: moc...@li... > [mailto:moc...@li...] On Behalf Of > Jeff Martin > Sent: 28 August 2002 16:26 > To: MockObjects > Subject: Re: [MO-java-dev] New (Old) Release > > I was thinking of maybe using the javadoc group feature so that core, > jdk, j2ee and alt are seperate sections in the javadoc. > > > On Wed, 2002-08-28 at 15:48, Steve Freeman wrote: > > Thanks > > > > Can you build versions both with and without j2ee? > > > > S. > > > > ----- Original Message ----- > > From: "Jeff Martin" <je...@mk...> > > To: "MockObjects" <moc...@li...> > > Sent: Wednesday, August 28, 2002 2:06 PM > > Subject: [MO-java-dev] New (Old) Release > > > > > > > The 0.4 release candidate has been hanging around for a bit. Since > > know > > > one has complained about it I've promoted it to a full release. > > > > > > I've also hacked the web site to add it to the news items and uploaded > > > the javadoc build against jdk 1.3 > > > > > > -- > > > jeff martin > > > information technologist > > > mkodo limited > > > > > > mobile: 44 (0) 78 5547 8331 > > > phone: 44 (0) 20 2226 4545 > > > email: je...@mk... > > > > > > www.mkodo.com > > > > > > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by: Jabber - The world's fastest > > growing > > > real-time communications platform! Don't just IM. Build it in! > > > http://www.jabber.com/osdn/xim > > > _______________________________________________ > > > Mockobjects-java-dev mailing list > > > Moc...@li... > > > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > > > > > > > > -- > jeff martin > information technologist > mkodo limited > > mobile: 44 (0) 78 5547 8331 > phone: 44 (0) 20 2226 4545 > email: je...@mk... > > www.mkodo.com > > > > ------------------------------------------------------- > This sf.net email is sponsored by: Jabber - The world's fastest growing > real-time communications platform! Don't just IM. Build it in! > http://www.jabber.com/osdn/xim > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |
From: Jeff M. <cus...@us...> - 2002-08-28 18:27:39
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/helpers In directory usw-pr-cvs1:/tmp/cvs-serv19272/src/j2ee/common/com/mockobjects/helpers Modified Files: TagTestHelper.java Log Message: Fixed checkReturnValues Index: TagTestHelper.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/helpers/TagTestHelper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TagTestHelper.java 28 Aug 2002 17:36:28 -0000 1.1 +++ TagTestHelper.java 28 Aug 2002 18:27:36 -0000 1.2 @@ -78,7 +78,7 @@ private final void checkReturnValue(final String methodName, final int expectedValue, final int returnValue) { Assert.assertEquals(methodName + " expected value " + getReturnValueName(expectedValue) + - " but was" + getReturnValueName(expectedValue), + " but was " + getReturnValueName(returnValue), expectedValue, returnValue); } |
From: Jeff M. <cus...@us...> - 2002-08-28 18:27:14
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet In directory usw-pr-cvs1:/tmp/cvs-serv19014/src/j2ee/1.3/com/mockobjects/servlet Modified Files: MockHttpSession.java Log Message: Added remove attribute support Index: MockHttpSession.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet/MockHttpSession.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MockHttpSession.java 27 Aug 2002 14:13:22 -0000 1.2 +++ MockHttpSession.java 28 Aug 2002 18:27:11 -0000 1.3 @@ -1,28 +1,26 @@ package com.mockobjects.servlet; -import java.util.Enumeration; -import java.util.HashMap; - -import javax.servlet.ServletContext; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpSessionContext; - -import org.omg.CORBA.PUBLIC_MEMBER; - import com.mockobjects.ExpectationSet; import com.mockobjects.MapEntry; import com.mockobjects.MockObject; import com.mockobjects.Verifiable; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpSession; +import javax.servlet.http.HttpSessionContext; +import java.util.Enumeration; +import java.util.HashMap; + public class MockHttpSession extends MockObject implements HttpSession, Verifiable { private ExpectationSet myAttributes = new ExpectationSet("session attributes"); - private HashMap attributes = new HashMap(); + private ExpectationSet myRemovedAttributes = new ExpectationSet("removed session attributes"); + private HashMap myAttributeValues = new HashMap(); private Enumeration attributeNames; private ServletContext servletContext; - public Object getAttribute(String arg1) { - return attributes.get(arg1); + public Object getAttribute(String anAttributeName) { + return myAttributeValues.get(anAttributeName); } public void setupGetAttributeNames(Enumeration attributeNames) { @@ -58,11 +56,11 @@ return null; } - public void setupServletContext(ServletContext servletContext){ + public void setupServletContext(ServletContext servletContext) { this.servletContext = servletContext; } - public ServletContext getServletContext(){ + public ServletContext getServletContext() { return servletContext; } @@ -89,8 +87,12 @@ notImplemented(); } - public void removeAttribute(String arg1) { - notImplemented(); + public void setExpectedRemoveAttribute(String anAttributeName){ + myRemovedAttributes.addExpected(anAttributeName); + } + + public void removeAttribute(String anAttributeName) { + myRemovedAttributes.addActual(anAttributeName); } public void removeValue(String arg1) { @@ -98,7 +100,7 @@ } public void setAttribute(String aKey, Object aValue) { - attributes.put(aKey, aValue); + myAttributeValues.put(aKey, aValue); myAttributes.addActual(new MapEntry(aKey, aValue)); } |
From: Jeff M. <cus...@us...> - 2002-08-28 17:36:31
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/helpers In directory usw-pr-cvs1:/tmp/cvs-serv22703/src/j2ee/common/com/mockobjects/helpers Added Files: ServletTestHelper.java TagTestHelper.java Log Message: Add first versions of test helpers for Servlets and Tags --- NEW FILE: ServletTestHelper.java --- package com.mockobjects.helpers; import com.mockobjects.servlet.*; import javax.servlet.http.HttpServlet; import javax.servlet.ServletException; import java.io.IOException; /** * Sets up mock servlet objects in a common configuration. * HttpSession is attached to request, RequestDispatcher is connected to HttpSession * @see com.mockobjects.servlet.MockHttpServletRequest#setSession * @see com.mockobjects.servlet.MockServletContext#setupGetRequestDispatcher */ public class ServletTestHelper { protected final MockHttpServletRequest request = new MockHttpServletRequest(); protected final MockHttpServletResponse response = new MockHttpServletResponse(); protected final MockHttpSession httpSession = new MockHttpSession(); protected final MockRequestDispatcher requestDispatcher = new MockRequestDispatcher(); protected final MockServletContext servletContext = new MockServletContext(); protected final MockServletConfig servletConfig = new MockServletConfig(); private final HttpServlet testSubject; public ServletTestHelper(HttpServlet testSubject) { this.testSubject = testSubject; request.setSession(httpSession); servletContext.setupGetRequestDispatcher(requestDispatcher); } protected ServletTestHelper(){ this.testSubject = null; request.setSession(httpSession); servletContext.setupGetRequestDispatcher(requestDispatcher); } public MockHttpServletRequest getRequest() { return request; } public MockHttpSession getHttpSession() { return httpSession; } public MockRequestDispatcher getRequestDispatcher() { return requestDispatcher; } public MockHttpServletResponse getResponse() { return response; } public MockServletContext getServletContext() { return servletContext; } public MockServletConfig getServletConfig() { return servletConfig; } /** * Calls HttpServlet.init passing it the MockServletConfig */ public void testServletInit() throws ServletException { testSubject.init(servletConfig); } /** * Calls HttpServlet.service passing it the MockHttpServletRequest & MockHttpServletResponse */ public void testServlet() throws ServletException, IOException { testSubject.service(request, response); } } --- NEW FILE: TagTestHelper.java --- package com.mockobjects.helpers; import com.mockobjects.servlet.MockBodyContent; import com.mockobjects.servlet.MockJspWriter; import com.mockobjects.servlet.MockPageContext; import junit.framework.Assert; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.BodyTag; import javax.servlet.jsp.tagext.IterationTag; import javax.servlet.jsp.tagext.Tag; /** * Sets up mock tag objects in a common configuration. * MockHttpServletRequest, MockServletContext and MockHttpSession are attached to MockPageContext * @see MockPageContext#setRequest(); * @see MockPageContext#setServletContext(); * @see MockPageContext#setSession(); */ public class TagTestHelper extends ServletTestHelper { private final MockPageContext pageContext = new MockPageContext(); private final MockBodyContent bodyContent = new MockBodyContent(); private final MockJspWriter outWriter = new MockJspWriter(); private final MockJspWriter enclosingWriter = new MockJspWriter(); private final Tag testSubject; private final String getReturnValueName(int returnValue) { switch (returnValue) { case BodyTag.EVAL_BODY_INCLUDE: return "EVAL_BODY_INCLUDE"; case BodyTag.EVAL_PAGE: return "EVAL_PAGE"; case BodyTag.SKIP_BODY: return "SKIP_BODY"; case BodyTag.SKIP_PAGE: return "SKIP_PAGE"; case BodyTag.EVAL_BODY_BUFFERED: return "EVAL_BODY_BUFFERED|EVAL_BODY_AGAIN"; default: return "Unknown return value (" + returnValue + ")"; } } /** * @param testSubject The Tag to be tested */ public TagTestHelper(Tag testSubject) { this.testSubject = testSubject; pageContext.setRequest(getRequest()); pageContext.setServletContext(getServletContext()); pageContext.setSession(getHttpSession()); pageContext.setJspWriter(outWriter); bodyContent.setupGetEnclosingWriter(enclosingWriter); } /** * @return The writer use when making calls to PageContext.getOut */ public MockJspWriter getOutWriter() { return outWriter; } public MockPageContext getPageContext() { return pageContext; } /** * Assert that the return value of doStartTag is equal to an expectedValue * @param expectedValue value to check against doStartTag */ public void assertDoStartTag(final int expectedValue) throws JspException { testSubject.setPageContext(pageContext); checkReturnValue("doStartTag", expectedValue, testSubject.doStartTag()); } private final void checkReturnValue(final String methodName, final int expectedValue, final int returnValue) { Assert.assertEquals(methodName + " expected value " + getReturnValueName(expectedValue) + " but was" + getReturnValueName(expectedValue), expectedValue, returnValue); } /** * Invoke doInitBody on the test subject */ public void testDoInitBody() throws JspException { Assert.assertTrue("Test subject not an instance of BodyTag", testSubject instanceof BodyTag); ((BodyTag) testSubject).setBodyContent(bodyContent); ((BodyTag) testSubject).doInitBody(); } /** * Assert that the return value of doAfterBody is equal to an expectedValue * @param expectedValue value to check against doAfterBody */ public void assertDoAfterBody(int expectedValue) throws JspException { Assert.assertTrue("Test subject not an instance of BodyTag", testSubject instanceof IterationTag); checkReturnValue("doAfterTag", expectedValue, ((IterationTag) testSubject).doAfterBody()); } /** * Assert that the return value of doEndTag is equal to an expectedValue * @param expectedValue value to check against doEndTag */ public void assertDoEndTag(int expectedValue) throws JspException { Assert.assertEquals("doEndTag returned unexpected value" + getReturnValueName(expectedValue), expectedValue, testSubject.doEndTag()); } } |
From: Jeff M. <cus...@us...> - 2002-08-28 17:34:34
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/helpers In directory usw-pr-cvs1:/tmp/cvs-serv22176/src/j2ee/common/com/mockobjects/helpers Log Message: Directory /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/helpers added to the repository |
From: Jeff M. <je...@mk...> - 2002-08-28 15:28:55
|
I was thinking of maybe using the javadoc group feature so that core, jdk, j2ee and alt are seperate sections in the javadoc. On Wed, 2002-08-28 at 15:48, Steve Freeman wrote: > Thanks > > Can you build versions both with and without j2ee? > > S. > > ----- Original Message ----- > From: "Jeff Martin" <je...@mk...> > To: "MockObjects" <moc...@li...> > Sent: Wednesday, August 28, 2002 2:06 PM > Subject: [MO-java-dev] New (Old) Release > > > > The 0.4 release candidate has been hanging around for a bit. Since > know > > one has complained about it I've promoted it to a full release. > > > > I've also hacked the web site to add it to the news items and uploaded > > the javadoc build against jdk 1.3 > > > > -- > > jeff martin > > information technologist > > mkodo limited > > > > mobile: 44 (0) 78 5547 8331 > > phone: 44 (0) 20 2226 4545 > > email: je...@mk... > > > > www.mkodo.com > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by: Jabber - The world's fastest > growing > > real-time communications platform! Don't just IM. Build it in! > > http://www.jabber.com/osdn/xim > > _______________________________________________ > > Mockobjects-java-dev mailing list > > Moc...@li... > > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > > > > -- 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: Jeff M. <je...@mk...> - 2002-08-28 13:09:47
|
The 0.4 release candidate has been hanging around for a bit. Since know one has complained about it I've promoted it to a full release. I've also hacked the web site to add it to the news items and uploaded the javadoc build against jdk 1.3 -- 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: Nat P. <np...@us...> - 2002-08-27 20:45:40
|
Update of /cvsroot/mockobjects/no-stone-unturned/rubysrc In directory usw-pr-cvs1:/tmp/cvs-serv337 Modified Files: addrservlet.rb Log Message: Refactoring: extract method AddressBookServlet::respond_address Index: addrservlet.rb =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/rubysrc/addrservlet.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- addrservlet.rb 27 Aug 2002 20:44:06 -0000 1.5 +++ addrservlet.rb 27 Aug 2002 20:45:37 -0000 1.6 @@ -22,10 +22,14 @@ def find_address( name, response ) if @address_book.has_key?(name) - response.body = @address_book[name] + respond_address( response, @address_book[name] ) else respond_no_match( response ) end + end + + def respond_address( response, address ) + response.body = address end def respond_no_match( response ) |
From: Nat P. <np...@us...> - 2002-08-27 20:44:10
|
Update of /cvsroot/mockobjects/no-stone-unturned/rubysrc In directory usw-pr-cvs1:/tmp/cvs-serv31838 Modified Files: addrservlet.rb Log Message: Refactoring: extract method AddressBookServlet::find_address Index: addrservlet.rb =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/rubysrc/addrservlet.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- addrservlet.rb 27 Aug 2002 20:42:44 -0000 1.4 +++ addrservlet.rb 27 Aug 2002 20:44:06 -0000 1.5 @@ -16,11 +16,15 @@ respond_no_match( response ) else name = WEBrick::HTTPUtils::unescape_form( query ) - if @address_book.has_key?(name) - response.body = @address_book[name] - else - respond_no_match( response ) - end + find_address( name, response ) + end + end + + def find_address( name, response ) + if @address_book.has_key?(name) + response.body = @address_book[name] + else + respond_no_match( response ) end end |
From: Nat P. <np...@us...> - 2002-08-27 20:42:48
|
Update of /cvsroot/mockobjects/no-stone-unturned/rubysrc In directory usw-pr-cvs1:/tmp/cvs-serv31339 Modified Files: addrservlet.rb tasks.txt Log Message: Refactoring: extract method AddressBookServlet::respond_no_match Index: addrservlet.rb =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/rubysrc/addrservlet.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- addrservlet.rb 27 Aug 2002 20:38:41 -0000 1.3 +++ addrservlet.rb 27 Aug 2002 20:42:44 -0000 1.4 @@ -13,15 +13,18 @@ query = request.query_string if query == nil - response.body = 'no address found' + respond_no_match( response ) else - name = WEBrick::HTTPUtils::unescape_form( request.query_string ) - + name = WEBrick::HTTPUtils::unescape_form( query ) if @address_book.has_key?(name) response.body = @address_book[name] else - response.body = 'no address found' + respond_no_match( response ) end end + end + + def respond_no_match( response ) + response.body = "no address found" end end Index: tasks.txt =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/rubysrc/tasks.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- tasks.txt 27 Aug 2002 20:38:41 -0000 1.2 +++ tasks.txt 27 Aug 2002 20:42:44 -0000 1.3 @@ -20,5 +20,8 @@ - using blocks to handle expectations +REFACTORING + + 1c) Retrieve the entries from a file, specified as a servlet property. Values are held in memory. |
From: Nat P. <np...@us...> - 2002-08-27 20:38:44
|
Update of /cvsroot/mockobjects/no-stone-unturned/rubysrc In directory usw-pr-cvs1:/tmp/cvs-serv29794 Modified Files: addrservlet.rb server.rb tasks.txt test_addrservlet.rb Log Message: Task 2 completed Index: addrservlet.rb =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/rubysrc/addrservlet.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- addrservlet.rb 27 Aug 2002 19:35:34 -0000 1.2 +++ addrservlet.rb 27 Aug 2002 20:38:41 -0000 1.3 @@ -3,8 +3,25 @@ class AddressBookServlet < WEBrick::HTTPServlet::AbstractServlet + def initialize( config, address_book ) + super + @address_book = address_book + end + def do_GET( request, response ) response['content-type'] = 'text/plain' - response.body = 'no address found' + + query = request.query_string + if query == nil + response.body = 'no address found' + else + name = WEBrick::HTTPUtils::unescape_form( request.query_string ) + + if @address_book.has_key?(name) + response.body = @address_book[name] + else + response.body = 'no address found' + end + end end end Index: server.rb =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/rubysrc/server.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- server.rb 27 Aug 2002 19:21:35 -0000 1.1 +++ server.rb 27 Aug 2002 20:38:41 -0000 1.2 @@ -4,7 +4,10 @@ require 'addrservlet' server = WEBrick::HTTPServer.new( :Port => 2000 ) -server.mount( "/address", AddressBookServlet ) +server.mount( "/address", AddressBookServlet, + "Nat Pryce" => "nat...@so...", + "Steve Freeman" => "st...@so...", + "Jeff Martin" => "cus...@so..." ) trap("INT") { server.shutdown } Index: tasks.txt =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/rubysrc/tasks.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- tasks.txt 27 Aug 2002 19:21:35 -0000 1.1 +++ tasks.txt 27 Aug 2002 20:38:41 -0000 1.2 @@ -8,7 +8,17 @@ 1a) accept a name and find no result DONE +Points of Interest: + - no need to implement any interfaces when defining mocks + + 1b) accept a name and return a result from a hard-coded collection. +1b.1) what about the servlet receiving no name? +DONE + +Points of Interest: + - using blocks to handle expectations + + 1c) Retrieve the entries from a file, specified as a servlet property. Values are held in memory. - Index: test_addrservlet.rb =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/rubysrc/test_addrservlet.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- test_addrservlet.rb 27 Aug 2002 19:39:42 -0000 1.3 +++ test_addrservlet.rb 27 Aug 2002 20:38:41 -0000 1.4 @@ -6,6 +6,10 @@ class MockRequest + def _setup_query_string( query ) + @query_string = WEBrick::HTTPUtils::escape_form(query) + end + attr_reader :query_string end class MockResponse @@ -14,6 +18,7 @@ def initialize @content_type_set = false @body_set = false + @body_expectation = nil end def []=( header, value ) @@ -22,26 +27,55 @@ @content_type_set = true end + def _expect_body( &proc ) + @body_expectation = proc + end + def body=( value ) - assert_match( /no address found/, value ) + @body_expectation.call(value) if @body_expectation @body_set = true end def _verify assert( "content-type", @content_type_set ) - assert( "body", @body_set ) + assert( "body", @body_expectation && @body_set ) end end class AddressBookServletTest < Test::Unit::TestCase + NAME1 = "First Last" + ADDR1 = "ADDRESS" + + def set_up + @request = MockRequest.new + @response = MockResponse.new + @servlet = AddressBookServlet.new( {}, NAME1 => ADDR1 ) + end + def test_no_address_found - request = MockRequest.new - response = MockResponse.new + @request._setup_query_string( "UNKNOWN NAME" ) + @response._expect_body { |text| assert_match( /no address found/, text ) } + + @servlet.do_GET( @request, @response ) + + @response._verify + end + + def test_no_address_found_when_no_name + @response._expect_body { |text| assert_match( /no address found/, text ) } + + @servlet.do_GET( @request, @response ) + + @response._verify + end + + def test_address_found + @request._setup_query_string( NAME1 ) + @response._expect_body { |text| assert_match( /#{ADDR1}/, text ) } - servlet = AddressBookServlet.new( {} ) - servlet.do_GET( request, response ) + @servlet.do_GET( @request, @response ) - response._verify + @response._verify end end |
From: Nat P. <np...@us...> - 2002-08-27 19:39:45
|
Update of /cvsroot/mockobjects/no-stone-unturned/rubysrc In directory usw-pr-cvs1:/tmp/cvs-serv4874 Modified Files: test_addrservlet.rb Log Message: More cleanups Index: test_addrservlet.rb =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/rubysrc/test_addrservlet.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- test_addrservlet.rb 27 Aug 2002 19:35:34 -0000 1.2 +++ test_addrservlet.rb 27 Aug 2002 19:39:42 -0000 1.3 @@ -44,11 +44,4 @@ response._verify end - - def test_name_found - request = MockRequest.new - response = MockResponse.new - - servlet = AddressBookServlet.new( {} ) - end end |