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: Steve F. <sm...@us...> - 2002-08-18 01:41:58
|
Update of /cvsroot/mockobjects/no-stone-unturned In directory usw-pr-cvs1:/tmp/cvs-serv2368 Modified Files: readme.txt Log Message: fixes Index: readme.txt =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/readme.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- readme.txt 3 Aug 2002 22:22:41 -0000 1.2 +++ readme.txt 18 Aug 2002 01:41:54 -0000 1.3 @@ -1,7 +1,7 @@ -This is a build environment for a book on test-driven development that is due for publication -as soon as we can finish the thing. +This is a build environment for a book on test-driven development that is +due for publication as soon as we can finish the d**n thing. -Ant needs the jars in the lib directory for the doc-book conversions. +Ant uses the jars in the lib directory for the doc-book conversions. Requires Java 1.4, ANT 1.5, JUnit 3.7 |
From: Steve F. <sm...@us...> - 2002-08-17 20:43:39
|
Update of /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner In directory usw-pr-cvs1:/tmp/cvs-serv6267/src/nostone/junitrunner Modified Files: SwingRunner.java SwingRunnerTest.java CounterPanel.java Log Message: One failing test Index: SwingRunner.java =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner/SwingRunner.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SwingRunner.java 17 Aug 2002 20:35:51 -0000 1.4 +++ SwingRunner.java 17 Aug 2002 20:43:37 -0000 1.5 @@ -1,7 +1,6 @@ package nostone.junitrunner; -import junit.framework.Test; -import junit.framework.TestResult; +import junit.framework.*; import javax.swing.*; import java.awt.*; @@ -11,8 +10,6 @@ public SwingRunner( Test test ) { super("Swing Runner"); - TestResult result = new TestResult(); - JButton quitButton = new JButton("Quit"); quitButton.setName("quit"); quitButton.addActionListener(new ActionListener() { @@ -21,20 +18,50 @@ } }); - JProgressBar progressBar = new JProgressBar(); - progressBar.setName("progress bar"); - progressBar.setForeground(Color.GREEN); - progressBar.setValue( test.countTestCases() ); - progressBar.setMaximum( test.countTestCases() ); + final JProgressBar progressBar = createProgressBar(test); + final CounterPanel counters = new CounterPanel(test); getContentPane().setLayout(new FlowLayout()); getContentPane().add(progressBar); - CounterPanel counters = new CounterPanel(test); getContentPane().add(counters); getContentPane().add(quitButton); pack(); + TestResult result = new TestResult(); + result.addListener( new TestListener() { + private boolean hasNotGoneWrong; + + public void addError(Test test, Throwable t) { + } + + public void addFailure(Test test, AssertionFailedError t) { + progressBar.setForeground( Color.RED ); + counters.addFailure(); + hasNotGoneWrong = false; + } + + public void endTest(Test test) { + if (hasNotGoneWrong) { + counters.addPass(); + } + } + + public void startTest(Test test) { + hasNotGoneWrong = true; + } + + } ); + test.run(result); + } + + private JProgressBar createProgressBar(Test test) { + JProgressBar progressBar = new JProgressBar(); + progressBar.setName("progress bar"); + progressBar.setForeground(Color.GREEN); + progressBar.setValue( test.countTestCases() ); + progressBar.setMaximum( test.countTestCases() ); + return progressBar; } static public void main(String[] args) { Index: SwingRunnerTest.java =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner/SwingRunnerTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- SwingRunnerTest.java 17 Aug 2002 20:35:51 -0000 1.5 +++ SwingRunnerTest.java 17 Aug 2002 20:43:37 -0000 1.6 @@ -47,6 +47,7 @@ return 1; } public void run(TestResult result) { + result.startTest( this ); result.endTest( this ); } } ); @@ -69,6 +70,9 @@ return 2; } public void run(TestResult result) { + result.startTest( this ); + result.endTest( this ); + result.startTest( this ); result.endTest( this ); } } ); @@ -85,7 +89,7 @@ checkLabelText("error count", "0"); } - public void xtestOneFailingTest() { + public void testOneFailingTest() { runner = new SwingRunner( new Test() { public int countTestCases() { return 1; Index: CounterPanel.java =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner/CounterPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- CounterPanel.java 17 Aug 2002 20:35:51 -0000 1.1 +++ CounterPanel.java 17 Aug 2002 20:43:37 -0000 1.2 @@ -5,19 +5,37 @@ import javax.swing.*; import java.awt.*; -class CounterPanel extends JPanel { +public class CounterPanel extends JPanel { + private int passes = 0; + private JLabel passesLabel; + private int failures = 0; + private JLabel failureLabel; + public CounterPanel(Test test) { super(new FlowLayout()); - addLabel(Integer.toString(test.countTestCases()), "total count"); - addLabel(Integer.toString(test.countTestCases()), "success count"); - addLabel("0", "failure count"); - addLabel("0", "error count"); + addPromptLabel("Total:", Integer.toString(test.countTestCases()), "total count"); + passesLabel = addPromptLabel(" Passes:", "0", "success count"); + failureLabel = addPromptLabel(" Failures:", "0", "failure count"); + addPromptLabel(" Errors:", "0", "error count"); } - private void addLabel(String initialValue, String name) { + private JLabel addPromptLabel(String prompt, String initialValue, String name) { JLabel label = new JLabel(initialValue); label.setName(name); + add(new JLabel(prompt)); add(label); + + return label; + } + + public void addFailure() { + failures++; + failureLabel.setText( Integer.toString(failures) ); + } + + public void addPass() { + passes++; + passesLabel.setText( Integer.toString(passes) ); } } |
From: Steve F. <sm...@us...> - 2002-08-17 20:35:53
|
Update of /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner In directory usw-pr-cvs1:/tmp/cvs-serv4513/src/nostone/junitrunner Modified Files: Tasks.java SwingRunner.java SwingRunnerTest.java Added Files: CounterPanel.java Log Message: Extracted CounterPanel --- NEW FILE: CounterPanel.java --- package nostone.junitrunner; import junit.framework.Test; import javax.swing.*; import java.awt.*; class CounterPanel extends JPanel { public CounterPanel(Test test) { super(new FlowLayout()); addLabel(Integer.toString(test.countTestCases()), "total count"); addLabel(Integer.toString(test.countTestCases()), "success count"); addLabel("0", "failure count"); addLabel("0", "error count"); } private void addLabel(String initialValue, String name) { JLabel label = new JLabel(initialValue); label.setName(name); add(label); } } Index: Tasks.java =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner/Tasks.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Tasks.java 17 Aug 2002 20:29:18 -0000 1.3 +++ Tasks.java 17 Aug 2002 20:35:50 -0000 1.4 @@ -3,7 +3,7 @@ public class Tasks { // Open GUI, close // Hardcoded testcase, one passing test, show green bar, show test counts - // TODO Hardcoded testcases, two passing test, show green bar, show test counts + // Hardcoded testcases, two passing test, show green bar, show test counts // TODO Hardcoded testcase, one failing test, show red bar, show test counts, failure message // TODO Hardcoded testcase, one error test, show red bar, show test counts, error message // TODO Hardcoded testcases, passing + failing, show red bar, show test counts, failure message Index: SwingRunner.java =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner/SwingRunner.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- SwingRunner.java 17 Aug 2002 20:31:42 -0000 1.3 +++ SwingRunner.java 17 Aug 2002 20:35:51 -0000 1.4 @@ -11,6 +11,8 @@ public SwingRunner( Test test ) { super("Swing Runner"); + TestResult result = new TestResult(); + JButton quitButton = new JButton("Quit"); quitButton.setName("quit"); quitButton.addActionListener(new ActionListener() { @@ -27,18 +29,12 @@ getContentPane().setLayout(new FlowLayout()); getContentPane().add(progressBar); - addLabel(Integer.toString(test.countTestCases()), "total count"); - addLabel(Integer.toString(test.countTestCases()), "success count"); - addLabel("0", "failure count"); - addLabel("0", "error count"); + CounterPanel counters = new CounterPanel(test); + getContentPane().add(counters); getContentPane().add(quitButton); pack(); - } - private void addLabel(String initialValue, String name) { - JLabel label = new JLabel(initialValue); - label.setName(name); - getContentPane().add(label); + test.run(result); } static public void main(String[] args) { Index: SwingRunnerTest.java =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner/SwingRunnerTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SwingRunnerTest.java 17 Aug 2002 20:31:42 -0000 1.4 +++ SwingRunnerTest.java 17 Aug 2002 20:35:51 -0000 1.5 @@ -85,6 +85,29 @@ checkLabelText("error count", "0"); } + public void xtestOneFailingTest() { + runner = new SwingRunner( new Test() { + public int countTestCases() { + return 1; + } + public void run(TestResult result) { + result.addFailure( this, new AssertionFailedError("test failure")); + result.endTest( this ); + } + } ); + + JProgressBar progressBar = (JProgressBar)find("progress bar"); + assertNotNull("should have progress bar", progressBar); + assertEquals("progress bar colour", Color.RED, progressBar.getForeground()); + assertEquals("progress bar value", 1, progressBar.getValue()); + assertEquals("progress bar max", 1, progressBar.getMaximum()); + + checkLabelText("total count", "1"); + checkLabelText("success count", "0"); + checkLabelText("failure count", "1"); + checkLabelText("error count", "0"); + } + private void checkLabelText(String name, String expectedText) { JLabel label = (JLabel) find(name); assertNotNull("Should have " + name, label); |
From: Steve F. <sm...@us...> - 2002-08-17 20:31:49
|
Update of /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner In directory usw-pr-cvs1:/tmp/cvs-serv2888/src/nostone/junitrunner Modified Files: SwingRunner.java SwingRunnerTest.java Log Message: test two passing tests Index: SwingRunner.java =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner/SwingRunner.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SwingRunner.java 17 Aug 2002 20:29:18 -0000 1.2 +++ SwingRunner.java 17 Aug 2002 20:31:42 -0000 1.3 @@ -22,13 +22,13 @@ JProgressBar progressBar = new JProgressBar(); progressBar.setName("progress bar"); progressBar.setForeground(Color.GREEN); - progressBar.setValue(1); - progressBar.setMaximum(1); + progressBar.setValue( test.countTestCases() ); + progressBar.setMaximum( test.countTestCases() ); getContentPane().setLayout(new FlowLayout()); getContentPane().add(progressBar); - addLabel("1", "total count"); - addLabel("1", "success count"); + addLabel(Integer.toString(test.countTestCases()), "total count"); + addLabel(Integer.toString(test.countTestCases()), "success count"); addLabel("0", "failure count"); addLabel("0", "error count"); getContentPane().add(quitButton); Index: SwingRunnerTest.java =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner/SwingRunnerTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- SwingRunnerTest.java 17 Aug 2002 20:29:18 -0000 1.3 +++ SwingRunnerTest.java 17 Aug 2002 20:31:42 -0000 1.4 @@ -63,6 +63,27 @@ checkLabelText("error count", "0"); } + public void testTwoPassingTests() { + runner = new SwingRunner( new Test() { + public int countTestCases() { + return 2; + } + public void run(TestResult result) { + result.endTest( this ); + } + } ); + + JProgressBar progressBar = (JProgressBar)find("progress bar"); + assertNotNull("should have progress bar", progressBar); + assertEquals("progress bar colour", Color.GREEN, progressBar.getForeground()); + assertEquals("progress bar value", 2, progressBar.getValue()); + assertEquals("progress bar max", 2, progressBar.getMaximum()); + + checkLabelText("total count", "2"); + checkLabelText("success count", "2"); + checkLabelText("failure count", "0"); + checkLabelText("error count", "0"); + } private void checkLabelText(String name, String expectedText) { JLabel label = (JLabel) find(name); |
From: Steve F. <sm...@us...> - 2002-08-17 20:29:21
|
Update of /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner In directory usw-pr-cvs1:/tmp/cvs-serv2364/src/nostone/junitrunner Modified Files: Tasks.java SwingRunner.java SwingRunnerTest.java Log Message: test one passing test Index: Tasks.java =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner/Tasks.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Tasks.java 17 Aug 2002 20:27:21 -0000 1.2 +++ Tasks.java 17 Aug 2002 20:29:18 -0000 1.3 @@ -2,7 +2,7 @@ public class Tasks { // Open GUI, close - // TODO Hardcoded testcase, one passing test, show green bar, show test counts + // Hardcoded testcase, one passing test, show green bar, show test counts // TODO Hardcoded testcases, two passing test, show green bar, show test counts // TODO Hardcoded testcase, one failing test, show red bar, show test counts, failure message // TODO Hardcoded testcase, one error test, show red bar, show test counts, error message Index: SwingRunner.java =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner/SwingRunner.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SwingRunner.java 17 Aug 2002 20:26:06 -0000 1.1 +++ SwingRunner.java 17 Aug 2002 20:29:18 -0000 1.2 @@ -1,11 +1,14 @@ package nostone.junitrunner; +import junit.framework.Test; +import junit.framework.TestResult; + import javax.swing.*; import java.awt.*; import java.awt.event.*; public class SwingRunner extends JFrame { - public SwingRunner() { + public SwingRunner( Test test ) { super("Swing Runner"); JButton quitButton = new JButton("Quit"); @@ -16,12 +19,37 @@ } }); + JProgressBar progressBar = new JProgressBar(); + progressBar.setName("progress bar"); + progressBar.setForeground(Color.GREEN); + progressBar.setValue(1); + progressBar.setMaximum(1); + + getContentPane().setLayout(new FlowLayout()); + getContentPane().add(progressBar); + addLabel("1", "total count"); + addLabel("1", "success count"); + addLabel("0", "failure count"); + addLabel("0", "error count"); getContentPane().add(quitButton); pack(); } + private void addLabel(String initialValue, String name) { + JLabel label = new JLabel(initialValue); + label.setName(name); + getContentPane().add(label); + } + static public void main(String[] args) { - SwingRunner runner = new SwingRunner(); + SwingRunner runner = new SwingRunner( new Test() { + public int countTestCases() { + return 0; + } + public void run(TestResult result) { + } + } ); + runner.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { Window w = e.getWindow(); Index: SwingRunnerTest.java =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner/SwingRunnerTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SwingRunnerTest.java 17 Aug 2002 20:27:21 -0000 1.2 +++ SwingRunnerTest.java 17 Aug 2002 20:29:18 -0000 1.3 @@ -6,19 +6,27 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; -import junit.framework.TestCase; +import junit.framework.*; import com.mockobjects.ExpectationCounter; import javax.swing.*; public class SwingRunnerTest extends TestCase { - private SwingRunner runner = new SwingRunner(); + private SwingRunner runner; public SwingRunnerTest(String name) { super(name); } public void testCreateGui() { + runner = new SwingRunner( new Test() { + public int countTestCases() { + return 0; + } + public void run(TestResult result) { + } + } ); + final ExpectationCounter closingCalls = new ExpectationCounter("window closing"); runner.addWindowListener(new WindowAdapter() { @@ -34,9 +42,32 @@ public void testOnePassingTest() { + runner = new SwingRunner( new Test() { + public int countTestCases() { + return 1; + } + public void run(TestResult result) { + result.endTest( this ); + } + } ); + JProgressBar progressBar = (JProgressBar)find("progress bar"); + assertNotNull("should have progress bar", progressBar); + assertEquals("progress bar colour", Color.GREEN, progressBar.getForeground()); + assertEquals("progress bar value", 1, progressBar.getValue()); + assertEquals("progress bar max", 1, progressBar.getMaximum()); + + checkLabelText("total count", "1"); + checkLabelText("success count", "1"); + checkLabelText("failure count", "0"); + checkLabelText("error count", "0"); + } + private void checkLabelText(String name, String expectedText) { + JLabel label = (JLabel) find(name); + assertNotNull("Should have " + name, label); + assertEquals(name, expectedText, label.getText()); } private Component find(String name) { |
From: Steve F. <sm...@us...> - 2002-08-17 20:27:23
|
Update of /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner In directory usw-pr-cvs1:/tmp/cvs-serv1949/src/nostone/junitrunner Modified Files: Tasks.java SwingRunnerTest.java Log Message: testCreateGui Index: Tasks.java =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner/Tasks.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Tasks.java 17 Aug 2002 20:26:06 -0000 1.1 +++ Tasks.java 17 Aug 2002 20:27:21 -0000 1.2 @@ -1,7 +1,7 @@ package nostone.junitrunner; public class Tasks { - // TODO Open GUI, close + // Open GUI, close // TODO Hardcoded testcase, one passing test, show green bar, show test counts // TODO Hardcoded testcases, two passing test, show green bar, show test counts // TODO Hardcoded testcase, one failing test, show red bar, show test counts, failure message Index: SwingRunnerTest.java =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner/SwingRunnerTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SwingRunnerTest.java 17 Aug 2002 20:26:06 -0000 1.1 +++ SwingRunnerTest.java 17 Aug 2002 20:27:21 -0000 1.2 @@ -12,13 +12,14 @@ import javax.swing.*; public class SwingRunnerTest extends TestCase { + private SwingRunner runner = new SwingRunner(); + public SwingRunnerTest(String name) { super(name); } public void testCreateGui() { final ExpectationCounter closingCalls = new ExpectationCounter("window closing"); - SwingRunner runner = new SwingRunner(); runner.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { @@ -26,9 +27,20 @@ } }); - ((JButton) findNamedComponent(runner, "quit")).doClick(); + ((JButton) find("quit")).doClick(); closingCalls.verify(); + } + + + public void testOnePassingTest() { + + + + } + + private Component find(String name) { + return findNamedComponent(runner, name); } private Component findNamedComponent(final Container container, final String name) { |
From: Steve F. <sm...@us...> - 2002-08-17 20:26:09
|
Update of /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner In directory usw-pr-cvs1:/tmp/cvs-serv1698/src/nostone/junitrunner Added Files: Tasks.java SwingRunner.java SwingRunnerTest.java TestHelper.java Log Message: First test running --- NEW FILE: Tasks.java --- package nostone.junitrunner; public class Tasks { // TODO Open GUI, close // TODO Hardcoded testcase, one passing test, show green bar, show test counts // TODO Hardcoded testcases, two passing test, show green bar, show test counts // TODO Hardcoded testcase, one failing test, show red bar, show test counts, failure message // TODO Hardcoded testcase, one error test, show red bar, show test counts, error message // TODO Hardcoded testcases, passing + failing, show red bar, show test counts, failure message // TODO Hardcoded testcases, passing + error, show red bar, show test counts, message // TODO Hardcoded testcases, passing + failure + error, show red bar, show test counts, messages // TODO dynamic test loading // TODO rerun tests // TODO rerun a test // TODO type in test class // TODO tree view } --- NEW FILE: SwingRunner.java --- package nostone.junitrunner; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class SwingRunner extends JFrame { public SwingRunner() { super("Swing Runner"); JButton quitButton = new JButton("Quit"); quitButton.setName("quit"); quitButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { processWindowEvent(new WindowEvent(SwingRunner.this, WindowEvent.WINDOW_CLOSING)); } }); getContentPane().add(quitButton); pack(); } static public void main(String[] args) { SwingRunner runner = new SwingRunner(); runner.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { Window w = e.getWindow(); w.setVisible(false); w.dispose(); System.exit(0); } }); runner.setVisible(true); } } --- NEW FILE: SwingRunnerTest.java --- package nostone.junitrunner; import nostone.tests.TestHelper; import java.awt.*; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import junit.framework.TestCase; import com.mockobjects.ExpectationCounter; import javax.swing.*; public class SwingRunnerTest extends TestCase { public SwingRunnerTest(String name) { super(name); } public void testCreateGui() { final ExpectationCounter closingCalls = new ExpectationCounter("window closing"); SwingRunner runner = new SwingRunner(); runner.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { closingCalls.inc(); } }); ((JButton) findNamedComponent(runner, "quit")).doClick(); closingCalls.verify(); } private Component findNamedComponent(final Container container, final String name) { return new TestHelper().depthFirst(container, new TestHelper.ComponentVisitor() { public Component apply(Component aComponent) { return name.equals(aComponent.getName()) ? aComponent : null; } }); } } --- NEW FILE: TestHelper.java --- package nostone.junitrunner; import java.awt.*; public class TestHelper { public Component depthFirst(Container container, ComponentVisitor visitor) { Component[] components = container.getComponents(); for (int i = 0; i < components.length; i++) { Component component = components[i]; Component applied = visitor.apply(component); if (null != applied) { return applied; } if (component instanceof Container) { applied = depthFirst((Container) component, visitor); if (null != applied) { return applied; } } } return null; } public interface ComponentVisitor { public Component apply(Component aComponent); } } |
From: Steve F. <sm...@us...> - 2002-08-17 20:25:50
|
Update of /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner In directory usw-pr-cvs1:/tmp/cvs-serv1598/src/nostone/junitrunner Log Message: Directory /cvsroot/mockobjects/no-stone-unturned/src/nostone/junitrunner added to the repository |
From: Steve F. <sm...@us...> - 2002-08-17 13:20:11
|
Update of /cvsroot/mockobjects/no-stone-unturned In directory usw-pr-cvs1:/tmp/cvs-serv1540 Modified Files: build.xml Log Message: added images for admonitions Index: build.xml =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/build.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- build.xml 9 Aug 2002 23:45:47 -0000 1.5 +++ build.xml 17 Aug 2002 13:20:07 -0000 1.6 @@ -96,8 +96,8 @@ <fileset dir="${xdoc.dir}/images"/> </copy> - <copy todir="${out.doc.dir}/images/callouts"> - <fileset dir="${xsl.dir}/images/callouts"/> + <copy todir="${out.doc.dir}/images/style"> + <fileset dir="${xsl.dir}/images"/> </copy> <!-- Copy other files (non XML) --> |
From: Steve F. <sm...@us...> - 2002-08-17 13:20:10
|
Update of /cvsroot/mockobjects/no-stone-unturned/doc/xdocs In directory usw-pr-cvs1:/tmp/cvs-serv1540/doc/xdocs Modified Files: htmlbook.xsl Log Message: added images for admonitions Index: htmlbook.xsl =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/doc/xdocs/htmlbook.xsl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- htmlbook.xsl 10 Aug 2002 23:43:41 -0000 1.8 +++ htmlbook.xsl 17 Aug 2002 13:20:07 -0000 1.9 @@ -7,10 +7,13 @@ <xsl:param name="use.extensions" select="'1'"/> <xsl:param name="html.stylesheet" select="'htmlbook.css'"/> <xsl:param name="html.cleanup" select="1"/> - <xsl:param name="callouts.extension" select="'1'"/> - <xsl:param name="callout.defaultcolumn" select="'80'"/> <xsl:param name="section.autolabel" select="0"/> <xsl:param name="section.label.includes.component.label" select="0"/> + <xsl:param name="admon.graphics" select="1"/> + <xsl:param name="admon.graphics.path">images/style/</xsl:param> + <xsl:param name="callouts.extension" select="'1'"/> + <xsl:param name="callout.defaultcolumn" select="'80'"/> + <xsl:param name="callout.graphics.path" select="'images/style/callouts/'"/> <xsl:param name="toc.section.depth">1</xsl:param> <xsl:template name="inline.gui"> |
From: Steve F. <sm...@us...> - 2002-08-17 12:59:13
|
Update of /cvsroot/mockobjects/no-stone-unturned/doc/xdocs In directory usw-pr-cvs1:/tmp/cvs-serv30252/doc/xdocs Modified Files: how_mocks_happened.xml patterns.xml htmlbook.css Log Message: More rework on how mocks happened. Index: how_mocks_happened.xml =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/doc/xdocs/how_mocks_happened.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- how_mocks_happened.xml 12 Aug 2002 23:10:20 -0000 1.6 +++ how_mocks_happened.xml 17 Aug 2002 12:59:10 -0000 1.7 @@ -42,7 +42,7 @@ robot.setCurrentPosition(POSITION); robot.goTo(POSITION); - assertEquals("Should be same", POSITION, robot.getPosition()); + assertEquals("Should be same", POSITION, robot.getCurrentPosition()); } }</programlisting> @@ -51,7 +51,7 @@ That's an essential requirement, but it's not enough. We can't be sure that the robot hasn't trundled all the way around the warehouse before returning; we need to know that the robot hasn't moved. How about if the robot were to store the route it takes each time we call - <methodname>goto()</methodname>? We could retrieve the route and make sure it's valid. For example: + <methodname>goTo()</methodname>? We could retrieve the route and make sure it's valid. For example: </para> <programlisting> @@ -60,10 +60,10 @@ Robot robot = new Robot(); robot.setCurrentPosition(POSITION); - robot.goto(POSITION); + robot.goTo(POSITION); <emphasis>assertEquals("Should be empty", 0, robot.getRecentMoveRequests().size());</emphasis> - assertEquals("Should be same", POSITION, robot.getPosition()); + assertEquals("Should be same", POSITION, robot.getCurrentPosition()); }</programlisting> <para> @@ -78,9 +78,9 @@ Robot robot = new Robot(); robot.setCurrentPosition(new Position(0, 0)); - robot.goto(DESTINATION); + robot.goTo(DESTINATION); - assertEquals("Should be destination", DESTINATION, robot.getPosition()); + assertEquals("Should be destination", DESTINATION, robot.getCurrentPosition()); List moves = robot.getRecentMoveRequests(); assertEquals("Should be one move", 1, moves.size()); assertEquals("Should be same move", @@ -106,9 +106,9 @@ Robot robot = new Robot(); robot.setCurrentPosition(new Position(0, 0)); - robot.goto(DESTINATION); + robot.goTo(DESTINATION); - assertEquals("Should be destination", DESTINATION, robot.getPosition()); + assertEquals("Should be destination", DESTINATION, robot.getCurrentPosition()); assertEquals("Should be same moves", makeExpectedLongWayMoves(), robot.getRecentMoves()); }</programlisting> @@ -139,20 +139,20 @@ FAILURES!!!</screen> <para> - We will have to step through the code to find the problem because the assertions have + We will have to re-run the code to find the problem because the assertions have been made <emphasis>after</emphasis> the call has finished. It could be worse, the robot is a relatively - simple example. Some of us tried to do this with financial mathematics and it's very painful when a - calculation fails. A test failure usually meant stepping carefully through the code with an open spreadsheet - nearby to check the values. + simple example. Some of us tried to do this with financial mathematics and it was very painful when a + calculation failed. A test failure usually meant carefully stepping through the code with an open spreadsheet + nearby to check the intermediate values. </para> <para> Second, to test this behaviour at all, we had to add some functionality to the real code, - to hold all the <classname>MoveRequest</classname>s since the last <methodname>goto()</methodname>. + to hold all the <classname>MoveRequest</classname>s since the last <methodname>goTo()</methodname>. We don't have any other immediate need for <methodname>getRecentMovesRequests()</methodname> and, what's worse, we've made an implicit promise to other people who work with the Robot code that we will store routes, thus shrinking (ever so slightly) our room to manouver. We can mark the method as - test infrastructure, but that's messy and does tend to get ignored when in the heat of development. + test infrastructure, but that sort of notation is clumsy and tends to be ignored in the heat of development. </para> <para> @@ -166,7 +166,12 @@ Is there a better way? Can we find a technique that's less intrusive, that doesn't require the robot to hang on to unnecessary values? Can we have more helpful test failures that will fail faster, like we know we're supposed to? What would happen if we really believed in the object maxim - <quote>Tell, don't ask</quote>? + <glossterm linkend="telldontask"><quote>Tell, don't ask</quote></glossterm>? That is, what if we make a point + of avoiding getters? + <footnote><para> + John Nolan is credited with asking this question at the right time at a software architecture + meeting in London + </para></footnote> </para> </section> <!-- what's wrong with this --> @@ -177,18 +182,21 @@ Let's stop and think for a moment. Our robot is actually doing two things when we ask it to move through the warehouse; it has to choose a route from its current position to its destination, <emphasis>and</emphasis> it has to move along the route it has chosen. Those activities are - separate, even if they might happen at the same time. If we break out these responsibilities into two - objects, we can also separate the testing that goes with them. We can test that the route planning - object creates a suitable route and that the Robot moving object follows that route correctly. + distinct, even if they might happen at the same time. If we break out these responsibilities into two + objects, we can also separate the testing that goes with them; we can test that the route planning + object creates a suitable route <emphasis>and</emphasis> that the Robot moving object follows + that route correctly. + </para> + <para> + We'll start with the <quote>Robot Moving Object</quote>, what would be a good name for such a component? + How about <emphasis>Motor</emphasis>? If we intercept the requests that the routing object makes to + the <classname>Motor</classname>, we can track where the Robot thinks its going and not have to retain the + route description for our unit tests. For now, we'll assume that the Routing object is embedded somewhere + in the Robot and we'll extract it later. </para> <para> - We'll start with the "Robot Moving Object", what would be a good name for such a component? How about - <emphasis>Motor</emphasis>? If we leave the route planning in the <classname>Robot</classname> object, - we can intercept the requests that the <classname>Robot</classname> makes to its - <classname>Motor</classname>, which means that we would be able to see inside the Robot without holding - on to the route data. First we define an interface for <classname>Motor</classname>. We know that there must be some kind of - request, which we'll call <methodname>move()</methodname>, that takes some kind of move request as a parameter. + action, which we'll call <methodname>move()</methodname>, that takes some kind of move request as a parameter. We don't yet know what's in that request, so we'll define an empty <classname>MoveRequest</classname> interface as a placeholder to get us through the compiler. (Of course, in dynamic languages, such as Smalltalk and Python, we don't even need to do that.) @@ -202,17 +210,17 @@ <para> Now that we've separated out the motor from the robot, where does the <classname>Robot</classname> object get its instance of the <classname>Motor</classname> class? We don't yet know what a real <classname>Motor</classname> - looks like, so we can't just create a default instance. We could, however, pass in an temporary implementation - during the test, so we'll add a <classname>Motor</classname> to the <classname>Robot</classname>'s constructor. + looks like, but we can't create a <classname>Robot</classname> without one. To get around this, we could + put together a temporary implementation for the test and pass it through to the <classname>Robot</classname>'s + constructor. Later on, when we have a real implementation of <classname>Motor</classname>, we can pass one of + those through instead. </para> <para> Now we have to decide what the test implementation will do. In this test, we want to be sure that the <classname>Robot</classname> stays in place, so the test <classname>Motor</classname> should simply fail if it receives any requests to move. We can write this test now, before we know anything else about - the system, which means that we have locked down a little piece of the specification. We can be sure that, - however complex our routing code gets, the <classname>Robot</classname> will not move if asked to go to - its current position. The new version of the test is: + the system. The new version of the test is: </para> <programlisting> @@ -229,11 +237,13 @@ robot.setCurrentPosition(POSITION); robot.goTo(POSITION); - assertEquals("Should be same", POSITION, robot.getPosition()); + assertEquals("Should be same", POSITION, robot.getCurrentPosition()); }</programlisting> <para> - Now if there's a bug in the robot routing code that asks the motor to move, the test will fail at the + We have just locked down a little piece of the specification. We can be sure that, however complex our + routing code gets, the <classname>Robot</classname> will not move if asked to go to its current position. + From now on, if there's a bug in the robot routing code that asks the motor to move, the test will fail at the point that the request is made. The error report might look like: </para> @@ -253,13 +263,13 @@ which gives a much clearer view of where the error became visible. If finding the problem turns out to be harder, we can trap the &junit; <classname>AssertionFailedError</classname> in the development tool to bring up the debugger. Then we can explore the program state at the time of the failure, without - having to step through from the beginning of the test. Of course, this doesn't work in every case, but most of - the time it takes you to straight the heart of the problem. + having to step through from the beginning of the test. Of course, this doesn't work in every case but, more + often than not, it takes you to straight to the source of the problem. </para> </section> <!-- Breaking apart the Robot --> <section> - <title>More complex tests</title> + <title>Testing a single step route</title> <para> Now let's revisit the second test, moving to an adjacent space. We want to ensure that exactly one move request has been made and that it contains the right values. Testing that the request is made at most @@ -282,27 +292,54 @@ Robot robot = new Robot(mockMotor); robot.setCurrentPosition(new Position(0, 0)); - robot.goto(DESTINATION); + robot.goTo(DESTINATION); - assertEquals("Should be destination", DESTINATION, robot.getPosition()); + assertEquals("Should be destination", DESTINATION, robot.getCurrentPosition()); }</programlisting> <para> - The first assertion will fail if the <classname>Robot</classname> passes an incorrect - <classname>MoveRequest</classname> or <constant>null</constant>. The second assertion will fail if the - <classname>Robot</classname> calls <function>move()</function> more than once. This test won't + The first assertion will fail if the <classname>Robot</classname> sends the wrong + <classname>MoveRequest</classname>. The second assertion will fail if the + <classname>Robot</classname> calls <function>move()</function> more than once. Unfortunately, this test won't fail if the <classname>Robot</classname> doesn't call <function>move()</function> at all, as it won't - have tried either assertion. We can only tell whether this failure has happened <emphasis>after</emphasis> - we've finished <function>goto()</function>, so we need to record how many times <function>move()</function> - was called. We can't just push <varname>moveCount</varname> up from the anonymous <classname>Motor</classname> - class to the test method because, unfortunately, Java requires such variables to be declared - <token>final</token> and we can't change the value of a <type>final int</type>. There are two alternatives. + try either assertion. We can only check for this kind of failure <emphasis>after</emphasis> + <function>goTo()</function> has finished, so we need to know how many times <function>move()</function> + was called. Unfortunately, we can't just push <varname>moveCount</varname> up from the anonymous + <classname>Motor</classname> class to the test method because a quirk of Java requires such variables to + be declared <token>final</token> and we can't change the value of a <type>final int</type>. I can think of + two alternatives that would solve our immediate problem. </para> + <para> + First, we could write a named implementation of <classname>Motor</classname> so that the test can see + the <varname>moveCount</varname> field. + </para> + <programlisting> +static class AbstractMotorStub implements Motor { + int moveCount = 0; +} + +public void testMoveOnePoint() { + final Position DESTINATION = new Position(1, 0); + + AbstractMotorStub mockMotor = new AbstractMotorStub() { + public void move(MoveRequest request) { + assertEquals("Should be move", new MoveRequest(1, MoveRequest.SOUTH), request); + moveCount++; + assertEquals("Should be first move", 1, moveCount); + } + }; + + Robot robot = new Robot(mockMotor); + robot.setCurrentPosition(new Position(0, 0)); + robot.goTo(DESTINATION); + + assertEquals("Should be destination", DESTINATION, robot.getCurrentPosition()); + assertEquals("Should be one move", 1, mockMotor.moveCount); +}</programlisting> <para> - First we could use a <glossterm linkend="selfshunt">Self Shunt</glossterm> instead of an anonymous class. This - means that the test class itself implements <classname>Motor</classname> so the test has direct access - to its instance fields. For example: + Second, we could use a <glossterm linkend="selfshunt">Self Shunt</glossterm> instead of an anonymous class. + This means that the test class itself implements <classname>Motor</classname>. </para> <programlisting> @@ -321,15 +358,57 @@ Robot robot = new Robot(this); robot.setCurrentPosition(new Position(0, 0)); - robot.goto(DESTINATION); + robot.goTo(DESTINATION); - assertEquals("Should be destination", DESTINATION, robot.getPosition()); + assertEquals("Should be destination", DESTINATION, robot.getCurrentPosition()); assertEquals("Should be one move", 1, moveCount); } }</programlisting> <para> - Alternatively, we could change the outer level data type, as follows: + Personally, I prefer the first of these two options because I find it easier to see the boundaries + between the stub and the test classes. As you'll see shortly, I think that makes handling sequences of + events easier. That said, there's not a huge difference, there are plenty of people making effective use + of Self Shunt, and it's more important that your team is consistent about its approach. + <tip> + <para> + The most important thing is for the team to have a consistent approach to writing unit tests. + </para> + </tip> + </para> + + </section> <!-- Testing a single step route --> + + <section> + <title>Testing more than one step</title> + <!-- TODO --> <comment>Under development</comment> + + <para> + Now we want to test a route that requires two steps. + </para> + <programlisting> +public void testMoveOnePoint() { + final Position DESTINATION = new Position(1, 0); + + AbstractMotorStub mockMotor = new AbstractMotorStub() { + public void move(MoveRequest request) { + assertEquals("Should be move", new MoveRequest(1, MoveRequest.SOUTH), request); + moveCount++; + assertEquals("Should be first move", 1, moveCount); + } + }; + + Robot robot = new Robot(mockMotor); + robot.setCurrentPosition(new Position(0, 0)); + robot.goTo(DESTINATION); + + assertEquals("Should be destination", DESTINATION, robot.getCurrentPosition()); + assertEquals("Should be one move", 1, mockMotor.moveCount); +}</programlisting> + + + <para> + Third, we could change the way we hold our move requests, we can let the </para> <programlisting> @@ -350,15 +429,14 @@ expectedMoveRequests.add(new MoveRequest(1, MoveRequest.SOUTH)); robot.setCurrentPosition(new Position(0, 0)); - robot.goto(DESTINATION); + robot.goTo(DESTINATION); - assertEquals("Should be destination", DESTINATION, robot.getPosition()); + assertEquals("Should be destination", DESTINATION, robot.getCurrentPosition()); assertEquals("Should be no more moves", 0, expectedMoveRequests.size()); }</programlisting> <para> In this version, I'm holding the details of the expected route in <varname>expectedMoveRequests</varname>. - <!-- TODO --> <comment>Under development</comment> </para> <para> @@ -405,7 +483,7 @@ public void testGotoSamePlace() { robot.goTo(ORIGIN); - assertEquals("Should be same", ORIGIN, robot.getPosition()); + assertEquals("Should be same", ORIGIN, robot.getCurrentPosition()); mockMotor.verify(); } public void testMoveOnePoint() { @@ -413,9 +491,9 @@ mockRobot.addExpectedRequest(new MoveRequest(1, MoveRequest.SOUTH)); - robot.goto(DESTINATION); + robot.goTo(DESTINATION); - assertEquals("Should be destination", DESTINATION, robot.getPosition()); + assertEquals("Should be destination", DESTINATION, robot.getCurrentPosition()); mockMotor.verify(); } public void testMoveALongWay() { @@ -423,9 +501,9 @@ mockMotor.addExpectedRequests(makeExpectedLongWayMoveRequests()); - robot.goto(DESTINATION); + robot.goTo(DESTINATION); - assertEquals("Should be destination", DESTINATION, robot.getPosition()); + assertEquals("Should be destination", DESTINATION, robot.getCurrentPosition()); mockMotor.verify(); } } Index: patterns.xml =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/doc/xdocs/patterns.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- patterns.xml 12 Aug 2002 23:07:58 -0000 1.1 +++ patterns.xml 17 Aug 2002 12:59:10 -0000 1.2 @@ -9,4 +9,13 @@ </glossentry> </glossdiv> <!-- S --> + <glossdiv> + <title>T</title> + + <glossentry id="telldontask"> + <glossterm>Tell, Don't ask</glossterm> + &TODO; + </glossentry> + </glossdiv> <!-- T --> + </glossary> Index: htmlbook.css =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/doc/xdocs/htmlbook.css,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- htmlbook.css 10 Aug 2002 23:43:41 -0000 1.7 +++ htmlbook.css 17 Aug 2002 12:59:10 -0000 1.8 @@ -6,10 +6,13 @@ DIV.section H2 { font-style: italic; font-weight: normal; } DIV.section H3 { font-style: normal; font-size: small; } +DIV.tip H3 { font-style: italic; font-weight: normal; font-size: small; } +PRE SPAN.emphasis { font-weight: bold; } .programlisting { margin-left: 5%; } .screen { margin-left: 5%; } .sidebar { border: double black 1px; font-size: 80%; padding: 4px; text-align: center; margin-left: 80%; } +.tip { border: double black 1px; font-size: 80%; padding: 2px; } .screenshot { margin-left: 20%; } .caption { font-size: 80%; font-style: italic; } .guibutton { font-weight: bold; } |
From: Steve F. <sm...@us...> - 2002-08-17 12:58:54
|
Update of /cvsroot/mockobjects/no-stone-unturned/src/nostone/robot In directory usw-pr-cvs1:/tmp/cvs-serv30192/src/nostone/robot Added Files: Motor.java Position.java Robot.java RobotTest.java MoveRequest.java Log Message: Added code for Robot example --- NEW FILE: Motor.java --- package nostone.robot; public interface Motor { } --- NEW FILE: Position.java --- package nostone.robot; public class Position { private int northSouth; private int eastWest; public Position(int aNorthSouth, int anEastWest) { northSouth = aNorthSouth; eastWest = anEastWest; } } --- NEW FILE: Robot.java --- package nostone.robot; public class Robot { private Motor motor; private Position currentPosition; public Robot(Motor aMotor) { motor = aMotor; } public void setCurrentPosition(Position position) { currentPosition = position; } public void goTo(Position position) { currentPosition = position; } public Position getCurrentPosition() { return currentPosition; } } --- NEW FILE: RobotTest.java --- package nostone.robot; import junit.framework.TestCase; public class RobotTest extends TestCase { public RobotTest(String name) { super(name); } public void testGotoSamePlace() { final Position POSITION = new Position(1, 1); Motor mockMotor = new Motor() { public void move(MoveRequest request) { fail("Should be no moves"); } }; Robot robot = new Robot(mockMotor); robot.setCurrentPosition(POSITION); robot.goTo(POSITION); assertEquals("Should be same", POSITION, robot.getCurrentPosition()); } static class AbstractMotorStub implements Motor { int moveCount = 0; } public void testMoveOnePoint() { final Position DESTINATION = new Position(1, 0); AbstractMotorStub mockMotor = new AbstractMotorStub() { public void move(MoveRequest request) { assertEquals("Should be move", new MoveRequest(1, MoveRequest.SOUTH), request); moveCount++; assertEquals("Should be first move", 1, moveCount); } }; Robot robot = new Robot(mockMotor); robot.setCurrentPosition(new Position(0, 0)); robot.goTo(DESTINATION); assertEquals("Should be destination", DESTINATION, robot.getCurrentPosition()); assertEquals("Should be one move", 1, mockMotor.moveCount); } } --- NEW FILE: MoveRequest.java --- package nostone.robot; public class MoveRequest { public static final int SOUTH = 1; private int distance; private int direction; public MoveRequest(int aDistance, int aDirection) { distance = aDistance; direction = aDirection; } } |
From: Steve F. <sm...@us...> - 2002-08-17 12:58:45
|
Update of /cvsroot/mockobjects/no-stone-unturned/src/nostone/robot In directory usw-pr-cvs1:/tmp/cvs-serv30167/src/nostone/robot Log Message: Directory /cvsroot/mockobjects/no-stone-unturned/src/nostone/robot added to the repository |
From: Steve F. <st...@m3...> - 2002-08-16 23:21:33
|
All sorted now, and there was a typo in the cname (turns red with embarrasment). Let's see if it comes back over the next coupla days. Steve - - - - - - - - - - - - - - - Steve Freeman st...@m3... "Nonsense is just nonsense, but the study of nonsense is science." ----- Original Message ----- From: "Scott Lamb" <sl...@sl...> To: <moc...@li...> Sent: Thursday, August 15, 2002 11:03 PM Subject: Re: [MO-java-dev] Project Status/Questions > Darren Hobbs wrote: > > Oddly enough, http://mockobjects.com works, its just www.mockobjects.com that > > doesn't. > > > > -Darren > > > > On Thursday 15 August 2002 22:02, Steve Freeman wrote: > > > >>- we're stuck between domain name registrars at the moment, hence the loss > >>of the website. Joker.com and easyDNS seem to be unable to complete the > >>handshake. I can't tell which one is to blame. > > Can't help much with the registrar transfer, but if it should help I > could provide DNS and/or HTTP service for mockobjects.com. Looks like > you're using easydns's now, dunno if it's any good or not. > > ns[12].easydns.com are now doing: > > mockobjects.com. in a 216.136.171.204 ; usw-pr-vhost.sourceforge.net. > www.mockobjects.com. in cname vhosts.sourceforge.net. > > As Darren said, the former works for me, the latter does not. > > -- > Scott Lamb > > > > ------------------------------------------------------- > 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 > |
From: Steve F. <st...@m3...> - 2002-08-16 21:38:30
|
There were sound historical reasons for setting things up this way which have now gone away. We should do something simple. I prefer the idea of a generated static site, rather than dynamic, so that people can have local copies. S. - - - - - - - - - - - - - - - Steve Freeman st...@m3... "Nonsense is just nonsense, but the study of nonsense is science." ----- Original Message ----- From: "Jeff Martin" <je...@mk...> To: "MockObjects" <moc...@li...> Sent: Friday, August 16, 2002 2:52 PM Subject: Re: [MO-java-dev] Project Status/Questions > Is there a reason behind all this mucking about or is it just for > devilment? > > I was thinking of trying to sort out the web site a bit to make it > easier to change. Are people already thinking about this? > > My plan was to use the same system we use for http://www.mkodo.com/ > where a single php page is used as a wrapper around html bodies > containing simple h1/p level tags. Should be easier to understand and > sourceforge already supports php. |
From: Jeff M. <cus...@us...> - 2002-08-16 17:50:25
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet In directory usw-pr-cvs1:/tmp/cvs-serv596/src/j2ee/1.3/com/mockobjects/servlet Modified Files: MockHttpServletRequest.java Log Message: Allow verification of getAttribute names Index: MockHttpServletRequest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/servlet/MockHttpServletRequest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- MockHttpServletRequest.java 14 Aug 2002 14:16:46 -0000 1.6 +++ MockHttpServletRequest.java 16 Aug 2002 17:50:21 -0000 1.7 @@ -26,7 +26,7 @@ private String myRequestURI; private String myMethod; private ServletInputStream myInputStream; - private java.security.Principal myUserPrincipal; + private Principal myUserPrincipal; private final ExpectationSet mySetAttributes = new ExpectationSet(MockHttpServletRequest.class.getName() + ".setAttribute"); @@ -35,12 +35,18 @@ private final ReturnObjectList myAttributesToReturn = new ReturnObjectList("attributes"); private final ExpectationValue myContentType = new ExpectationValue("content type"); + private final ExpectationList myGetAttributeNames = new ExpectationList("get attribute names"); public void setupGetAttribute(Object anAttributeToReturn) { myAttributesToReturn.addObjectToReturn(anAttributeToReturn); } + public void addExpectedGetAttributeName(String anAttributeName) { + myGetAttributeNames.addExpected(anAttributeName); + } + public Object getAttribute(String anAttributeName) { + myGetAttributeNames.addActual(anAttributeName); return myAttributesToReturn.nextReturnObject(); } |
From: Jeff M. <je...@mk...> - 2002-08-16 13:56:05
|
Is there a reason behind all this mucking about or is it just for devilment? I was thinking of trying to sort out the web site a bit to make it easier to change. Are people already thinking about this? My plan was to use the same system we use for http://www.mkodo.com/ where a single php page is used as a wrapper around html bodies containing simple h1/p level tags. Should be easier to understand and sourceforge already supports php. On Thu, 2002-08-15 at 22:35, Steve Freeman wrote: > Sigh. I despair of this whole business. > > S. > > - - - - - - - - - - - - - - - > Steve Freeman > st...@m3... > > "Nonsense is just nonsense, but the study of nonsense is science." > > ----- Original Message ----- > From: "Darren Hobbs" <da...@fa...> > To: <Moc...@li...> > Sent: Thursday, August 15, 2002 10:31 PM > Subject: Re: [MO-java-dev] Project Status/Questions > > > > Oddly enough, http://mockobjects.com works, its just www.mockobjects.com > that > > doesn't. > > > > -Darren > > > > On Thursday 15 August 2002 22:02, Steve Freeman wrote: > > > - we're stuck between domain name registrars at the moment, hence the > loss > > > of the website. Joker.com and easyDNS seem to be unable to complete the > > > handshake. I can't tell which one is to blame. > > > > > ------------------------------------------------------- > 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: Scott L. <sl...@sl...> - 2002-08-15 22:03:36
|
Darren Hobbs wrote: > Oddly enough, http://mockobjects.com works, its just www.mockobjects.com that > doesn't. > > -Darren > > On Thursday 15 August 2002 22:02, Steve Freeman wrote: > >>- we're stuck between domain name registrars at the moment, hence the loss >>of the website. Joker.com and easyDNS seem to be unable to complete the >>handshake. I can't tell which one is to blame. Can't help much with the registrar transfer, but if it should help I could provide DNS and/or HTTP service for mockobjects.com. Looks like you're using easydns's now, dunno if it's any good or not. ns[12].easydns.com are now doing: mockobjects.com. in a 216.136.171.204 ; usw-pr-vhost.sourceforge.net. www.mockobjects.com. in cname vhosts.sourceforge.net. As Darren said, the former works for me, the latter does not. -- Scott Lamb |
From: Steve F. <st...@m3...> - 2002-08-15 21:34:54
|
Sigh. I despair of this whole business. S. - - - - - - - - - - - - - - - Steve Freeman st...@m3... "Nonsense is just nonsense, but the study of nonsense is science." ----- Original Message ----- From: "Darren Hobbs" <da...@fa...> To: <Moc...@li...> Sent: Thursday, August 15, 2002 10:31 PM Subject: Re: [MO-java-dev] Project Status/Questions > Oddly enough, http://mockobjects.com works, its just www.mockobjects.com that > doesn't. > > -Darren > > On Thursday 15 August 2002 22:02, Steve Freeman wrote: > > - we're stuck between domain name registrars at the moment, hence the loss > > of the website. Joker.com and easyDNS seem to be unable to complete the > > handshake. I can't tell which one is to blame. |
From: Darren H. <da...@fa...> - 2002-08-15 21:31:37
|
Oddly enough, http://mockobjects.com works, its just www.mockobjects.com that doesn't. -Darren On Thursday 15 August 2002 22:02, Steve Freeman wrote: > - we're stuck between domain name registrars at the moment, hence the loss > of the website. Joker.com and easyDNS seem to be unable to complete the > handshake. I can't tell which one is to blame. |
From: Steve F. <st...@m3...> - 2002-08-15 21:24:29
|
Agreed. That's why we called the first module 'mockobjects-java'. There was a start at a mock library for C# but I never heard anything more, does anyone know if it's still live? What I'm hearing is that some mock implementations may be harder in .Net because they use fewer interfaces in their frameworks than in Java. I may be wrong, I usually am (TM). That said, I believe that the most useful thing to port would be the expectation library which is the real heart of the project. I'd be curious to see how it differed in another language. Let's talk at the XTC. Steve - - - - - - - - - - - - - - - Steve Freeman st...@m3... "Nonsense is just nonsense, but the study of nonsense is science." ----- Original Message ----- From: Vincent Massol To: tes...@ya... Cc: 'MockObjects' Sent: Thursday, August 15, 2002 8:28 PM Subject: RE: Mockobjects (Was: Re: [TDD] ANN: The Humble Dialog Box) Hi Darren, I think that is a great idea! I am participating (a little) to the mockobjects project and I know that the intent was not only Java. Actually we have planned for that since the beginning since we have put our java implementation in a mockobjects-java CVS module (http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mockobjects/) , hopping for some other language implementation in the future . :-) The idea of the MockObjects project is twofold: 1/ Evangelize the concept of Mock Objects (language independent) and be a place where to find all information relevant to this subject (ok, there's still a lot of work to do .) 2/ Provide mock implementations for common APIs (in different languages) All this to say that if you are interested you would be very welcomed to join us and we would be very happy to start a mockobjects-cs CVS module (I'm speaking for myself but I am sure the others would be delighted as I am). I am ccing the mockobjects dev list. What do you think? Would you be interested in joining us? If you want to discuss this, please feel free to subscribe and send emails to the MockObjects development mailing list (http://sourceforge.net/mail/?group_id=18189). If you want to do it on your own, that's very fine too and we would certainly cross-link your site. Thanks -Vincent -----Original Message----- From: Darren Hobbs [mailto:dwh...@sp...] Sent: 15 August 2002 20:04 To: tes...@ya... Subject: Mockobjects (Was: Re: [TDD] ANN: The Humble Dialog Box) I'm not promising anything (this will be my first foray into C#) but... I think I might have a go at porting Mockobjects and Mockmaker to .NET. Can't give any ETA as yet as it depends on the arrival of a new PC. Does anyone:- (a) Know if any other similar projects are underway so duplication is avoided. (b) Think it would be useful. Regards, -Darren On Wednesday 14 August 2002 09:16, Shaun Smith wrote: > > I am also using .Net. Have you found any way to more easily generate > > a mock object? Right now, I am hand typing in each method for a given > > interface that a mock object is implementing. Is there some way to at > > least generate blank methods/properties for each interface? > > This is something else that drives me mad about VS.Net. Plus the lack > of even the most basic refactoring support (rename method would be a > good start).... I find it crazy that you can't select a class and have > it create selected signatures for overriding methods. I honestly searched > for this facility for a couple of hours, but knowing that others can't > find it too makes me beleive it's not there. Oh well. Has anyone tried > any other IDE's for .Net development yet and make any recommendations? > > > > To unsubscribe from this group, send an email to: > tes...@ya... > > > > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ To unsubscribe from this group, send an email to: tes...@ya... Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Sponsor ADVERTISEMENT To unsubscribe from this group, send an email to: tes...@ya... Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. |
From: Steve F. <st...@m3...> - 2002-08-15 21:11:28
|
We're still keen to keep going and people have been submitting patches. We've run into a couple of technical problems with the site, which do not reflect the status of the code. - we're stuck between domain name registrars at the moment, hence the loss of the website. Joker.com and easyDNS seem to be unable to complete the handshake. I can't tell which one is to blame. - we've been trying to find the time to rework the website. The current implementation was originally set up for a potential merge with Cactus, which didn't happen. Unfortunately, it's now in the way and we just haven't had the time to roll back and fix it. - I've been spending a lot of my time working on a book which I intend to post on the site once we can get it back up. at a more philosophical level, you don't need us that much (how do you like the hard sell ;-). The most important part is the expectation library which really does help to structure tests. Much of the rest is to do with sharing effort. I'll contact you directly. Steve - - - - - - - - - - - - - - - Steve Freeman st...@m3... "Nonsense is just nonsense, but the study of nonsense is science." ----- Original Message ----- From: "Simon Levitt" <sim...@uk...> To: <Moc...@li...> Sent: Thursday, August 15, 2002 5:57 PM Subject: [MO-java-dev] Project Status/Questions > Hello All, > > At WorldPay we are starting to define a rigid testing structure for our > Java code base. We've been investigating/using various methods in an > adhoc (mainly personal preference) manner for sometime, and now want to > standardise on one method and apply it across all our Java development. > > One of the options used, and one into which we're investigating is (of > course) the MockObjects project; Hence this Email. > > The missing contents of www.mockobjects.com and seemlingly (at least > partically) stagnent codebase has rung some alarm bells, but before > dismissing a potentially useful avenue (as it does alot of what we want) > I've been tasked with working out the status of the project. > > I apologise for not looking too deeply into mockobjects.sf.net, browsing > CVS to greatly, or reading the maillist archive very far back (I know why > mockobjects.com gives a 404 now BTW), all of which may to some degree > answer the following questions: > > Can someone give me an indication of the status of the project (ie. alive > and kicking, slightly dormant, dead, etc.)? CVS and/or the web-site > appear to have not been updated very much since May 2002. > > We're particularly interested in the use mock objects in the testing of > JDBC access - Are these classes being worked on by anybody? We have a > particular requirement for CallableStatement support for example. > > When we choose a testing strategy/technology, I do have a remit to be able > to work on said project and give the work I've done back to the project, > providing it benefits us to some degree (ie. in this case - enabling us > to test our code properly). Meaning both parties benefit. > > Thanks for your time, > > Simon., > -- > -------------------------------------------------------------------------- > Simon Levitt, Senior Development Engineer @ WorldPay plc, > WorldPay Centre, The Science Park, Milton Rd., Cambridge, CB4 0WE, ENGLAND > Sim...@uk... Ph:+44(0)1223 715151 F:+44(0)1223 715157 > ------------------------- http://www.worldpay.com/ ----------------------- > > > > ------------------------------------------------------- > 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____________________________________________ ___ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > |
From: Vincent M. <vm...@oc...> - 2002-08-15 19:33:05
|
Hi Darren, I think that is a great idea! I am participating (a little) to the mockobjects project and I know that the intent was not only Java. Actually we have planned for that since the beginning since we have put our java implementation in a mockobjects-java CVS module (http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mockobjects/) , hopping for some other language implementation in the future . :-) The idea of the MockObjects project is twofold: 1/ Evangelize the concept of Mock Objects (language independent) and be a place where to find all information relevant to this subject (ok, there's still a lot of work to do .) 2/ Provide mock implementations for common APIs (in different languages) All this to say that if you are interested you would be very welcomed to join us and we would be very happy to start a mockobjects-cs CVS module (I'm speaking for myself but I am sure the others would be delighted as I am). I am ccing the mockobjects dev list. What do you think? Would you be interested in joining us? If you want to discuss this, please feel free to subscribe and send emails to the MockObjects development mailing list (http://sourceforge.net/mail/?group_id=18189). If you want to do it on your own, that's very fine too and we would certainly cross-link your site. Thanks -Vincent -----Original Message----- From: Darren Hobbs [mailto:dwh...@sp...] Sent: 15 August 2002 20:04 To: tes...@ya... Subject: Mockobjects (Was: Re: [TDD] ANN: The Humble Dialog Box) I'm not promising anything (this will be my first foray into C#) but... I think I might have a go at porting Mockobjects and Mockmaker to .NET. Can't give any ETA as yet as it depends on the arrival of a new PC. Does anyone:- (a) Know if any other similar projects are underway so duplication is avoided. (b) Think it would be useful. Regards, -Darren On Wednesday 14 August 2002 09:16, Shaun Smith wrote: > > I am also using .Net. Have you found any way to more easily generate > > a mock object? Right now, I am hand typing in each method for a given > > interface that a mock object is implementing. Is there some way to at > > least generate blank methods/properties for each interface? > > This is something else that drives me mad about VS.Net. Plus the lack > of even the most basic refactoring support (rename method would be a > good start).... I find it crazy that you can't select a class and have > it create selected signatures for overriding methods. I honestly searched > for this facility for a couple of hours, but knowing that others can't > find it too makes me beleive it's not there. Oh well. Has anyone tried > any other IDE's for .Net development yet and make any recommendations? > > > > To unsubscribe from this group, send an email to: > tes...@ya... > > > > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ Yahoo! Groups Sponsor ADVERTISEMENT <http://rd.yahoo.com/M=209084.2258962.3692857.1943904/D=egroupweb/S=1705 007181:HM/A=1198186/R=0/*http:/shop.store.yahoo.com/cgi-bin/clink?logite ch2+shopping:dmad/M=209084.2258962.3692857.1943904/D=egroupweb/S=1705007 181:HM/A=1198186/R=1/1029438231+http://us.rmi.yahoo.com/rmi/http://www.l ogitech.com/rmi-framed-url/http://yahoo.buylogitech.com/referrer.asp%3Fr =cam-y107> To unsubscribe from this group, send an email to: tes...@ya... Your use of Yahoo! Groups is subject to the Yahoo! <http://docs.yahoo.com/info/terms/> Terms of Service. |
From: Jeff M. <je...@mk...> - 2002-08-15 17:37:32
|
The Mock Objects project is still active, but has slowed. The reason for this is that it now seems to fill the requirements that most people have for it. New classes/methods are being added to it, but this is done as and when they are needed. Since we now have mocks for most of the commonly used classes there are few new methods being added. A release candidate for the next release was put up on sourceforge recently, but it's not been officially released (I've not had time). As far as I know no one has raised any issues with the code so it can be considered to be the next release. If you have any specific requirements for things to be added (e.g. CallableStatement) just let us know and we'll see what we can do. Although it's nice when people send in patches for things they need added. The web site is just one of those things that's been needing doing for a while but no one got around to it, and it's just now got broken. On Thu, 2002-08-15 at 17:57, Simon Levitt wrote: > Hello All, > > At WorldPay we are starting to define a rigid testing structure for our > Java code base. We've been investigating/using various methods in an > adhoc (mainly personal preference) manner for sometime, and now want to > standardise on one method and apply it across all our Java development. > > One of the options used, and one into which we're investigating is (of > course) the MockObjects project; Hence this Email. > > The missing contents of www.mockobjects.com and seemlingly (at least > partically) stagnent codebase has rung some alarm bells, but before > dismissing a potentially useful avenue (as it does alot of what we want) > I've been tasked with working out the status of the project. > > I apologise for not looking too deeply into mockobjects.sf.net, browsing > CVS to greatly, or reading the maillist archive very far back (I know why > mockobjects.com gives a 404 now BTW), all of which may to some degree > answer the following questions: > > Can someone give me an indication of the status of the project (ie. alive > and kicking, slightly dormant, dead, etc.)? CVS and/or the web-site > appear to have not been updated very much since May 2002. > > We're particularly interested in the use mock objects in the testing of > JDBC access - Are these classes being worked on by anybody? We have a > particular requirement for CallableStatement support for example. > > When we choose a testing strategy/technology, I do have a remit to be able > to work on said project and give the work I've done back to the project, > providing it benefits us to some degree (ie. in this case - enabling us > to test our code properly). Meaning both parties benefit. > > Thanks for your time, > > Simon., > -- > -------------------------------------------------------------------------- > Simon Levitt, Senior Development Engineer @ WorldPay plc, > WorldPay Centre, The Science Park, Milton Rd., Cambridge, CB4 0WE, ENGLAND > Sim...@uk... Ph:+44(0)1223 715151 F:+44(0)1223 715157 > ------------------------- http://www.worldpay.com/ ----------------------- > > > > ------------------------------------------------------- > 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_______________________________________________ > 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: Simon L. <sim...@uk...> - 2002-08-15 16:57:24
|
Hello All, At WorldPay we are starting to define a rigid testing structure for our=20 Java code base. We've been investigating/using various methods in an=20 adhoc (mainly personal preference) manner for sometime, and now want to=20 standardise on one method and apply it across all our Java development. One of the options used, and one into which we're investigating is (of=20 course) the MockObjects project; Hence this Email. The missing contents of www.mockobjects.com and seemlingly (at least=20 partically) stagnent codebase has rung some alarm bells, but before=20 dismissing a potentially useful avenue (as it does alot of what we want)=20 I've been tasked with working out the status of the project. I apologise for not looking too deeply into mockobjects.sf.net, browsing=20 CVS to greatly, or reading the maillist archive very far back (I know why=20 mockobjects.com gives a 404 now BTW), all of which may to some degree=20 answer the following questions: Can someone give me an indication of the status of the project (ie. alive=20 and kicking, slightly dormant, dead, etc.)? CVS and/or the web-site=20 appear to have not been updated very much since May 2002. We're particularly interested in the use mock objects in the testing of=20 JDBC access - Are these classes being worked on by anybody? We have a=20 particular requirement for CallableStatement support for example. When we choose a testing strategy/technology, I do have a remit to be able= =20 to work on said project and give the work I've done back to the project,=20 providing it benefits us to some degree (ie. in this case - enabling us=20 to test our code properly). Meaning both parties benefit. Thanks for your time, Simon., =2D-=20 =2D------------------------------------------------------------------------- Simon Levitt, Senior Development Engineer @ WorldPay plc, WorldPay Centre, The Science Park, Milton Rd., Cambridge, CB4 0WE, ENGLAND = =20 Sim...@uk... Ph:+44(0)1223 715151 F:+44(0)1223 715157 =2D------------------------ http://www.worldpay.com/ ----------------------- |