Update of /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/test/mock2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27081/input/javasrc/biz/xsoftware/test/mock2
Modified Files:
Tag: branchForOffice
TestMockCreator.java
Log Message:
make testThrowException and make it passed
Index: TestMockCreator.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/test/mock2/TestMockCreator.java,v
retrieving revision 1.1.2.12
retrieving revision 1.1.2.13
diff -C2 -d -r1.1.2.12 -r1.1.2.13
*** TestMockCreator.java 18 Feb 2006 08:09:16 -0000 1.1.2.12
--- TestMockCreator.java 22 Feb 2006 14:14:45 -0000 1.1.2.13
***************
*** 1,4 ****
--- 1,5 ----
package biz.xsoftware.test.mock2;
+ import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
***************
*** 166,169 ****
--- 167,192 ----
}
+
+ public void testExceptionThrows() throws Exception{
+ MockObject m=MockObjectFactory.createMock(ListenerOne.class);
+ ListenerOne l=(ListenerOne)m;
+
+ String methodName="callMeSecond";
+ String message="Make sure systemUnderTest handles exception";
+ CalledMethod calledMethod=m.expect(methodName,new IOException(message));
+
+
+ String param="params";
+ try{
+ l.callMeSecond(param);
+ m.verify();
+ fail("Exception should be thrown earlier, try to find why it did not!!!");
+ } catch (IOException e) {
+ assertEquals(message,e.getMessage());
+
+ }
+
+
+ }
}
|