Update of /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/test/mock
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15882/input/javasrc/biz/xsoftware/test/mock
Modified Files:
TestOrderedCalls.java TestMockCreator.java
Log Message:
fixed a bug in ignore... ported the examples
Index: TestMockCreator.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/test/mock/TestMockCreator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TestMockCreator.java 10 Jun 2006 12:54:36 -0000 1.3
--- TestMockCreator.java 7 Aug 2006 15:52:45 -0000 1.4
***************
*** 19,25 ****
/**
* @author Dean Hiller
- *
- * To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Generation - Code and Comments
*/
public class TestMockCreator extends TestCase {
--- 19,22 ----
***************
*** 41,45 ****
String methodName = "callMeSecond";
! CalledMethod method = m.expectCall(methodName);
assertEquals("method name should be the same", methodName, method.getMethodName());
--- 38,42 ----
String methodName = "callMeSecond";
! CalledMethod method = m.expect(methodName);
assertEquals("method name should be the same", methodName, method.getMethodName());
***************
*** 65,69 ****
try {
! m.expectCall(MockObject.NONE);
fail("Should have failed with ExpectFailedException");
} catch(ExpectFailedException e) {
--- 62,66 ----
try {
! m.expect(MockObject.NONE);
fail("Should have failed with ExpectFailedException");
} catch(ExpectFailedException e) {
***************
*** 79,83 ****
l.multipleParams(param1, param2);
! CalledMethod method = m.expectCall("multipleParams");
assertEquals("param1 is not correct", param1, method.getParameter(0));
assertEquals("param2 is not correct", param2, method.getParameter(1));
--- 76,80 ----
l.multipleParams(param1, param2);
! CalledMethod method = m.expect("multipleParams");
assertEquals("param1 is not correct", param1, method.getParameter(0));
assertEquals("param2 is not correct", param2, method.getParameter(1));
***************
*** 89,93 ****
l.callMeSecond("dummy");
try {
! m.expectCall("callMeFirst");
fail("should have thrown exception");
} catch(ExpectFailedException e) {}
--- 86,90 ----
l.callMeSecond("dummy");
try {
! m.expect("callMeFirst");
fail("should have thrown exception");
} catch(ExpectFailedException e) {}
***************
*** 103,110 ****
//would call createcar but we are only unit testing MockCreator
Car c = ((FactoryInterface)factory).createCar("someid");
! factory.expectCall("createCar");
c.openDoor();
! car.expectCall("openDoor");
}
--- 100,107 ----
//would call createcar but we are only unit testing MockCreator
Car c = ((FactoryInterface)factory).createCar("someid");
! factory.expect("createCar");
c.openDoor();
! car.expect("openDoor");
}
***************
*** 127,131 ****
l.callMeFirst(expected);
! CalledMethod m = mockList.expectCall(MockObject.ANY);
Integer i = (Integer)m.getAllParams()[0];
assertEquals("param should be 1", new Integer(expected), i);
--- 124,128 ----
l.callMeFirst(expected);
! CalledMethod m = mockList.expect(MockObject.ANY);
Integer i = (Integer)m.getAllParams()[0];
assertEquals("param should be 1", new Integer(expected), i);
***************
*** 140,144 ****
String[] methods = new String[] { MockObject.ANY, "callMeSecond" };
! mockList.expectOrderedCalls(methods);
}
--- 137,141 ----
String[] methods = new String[] { MockObject.ANY, "callMeSecond" };
! mockList.expect(methods);
}
***************
*** 147,151 ****
try {
! mock.expectCall("noSuchMethod");
fail("This should throw an exception");
} catch(IllegalArgumentException e) {
--- 144,148 ----
try {
! mock.expect("noSuchMethod");
fail("This should throw an exception");
} catch(IllegalArgumentException e) {
***************
*** 161,165 ****
byte[] retVal = ident.doThat(null);
! mock.expectCall("doThat");
assertEquals(1, retVal.length);
--- 158,162 ----
byte[] retVal = ident.doThat(null);
! mock.expect("doThat");
assertEquals(1, retVal.length);
***************
*** 179,183 ****
byte[] newBytes = ident.doThat(bytes);
! CalledMethod m = mock.expectCall("doThat");
byte[] passedIn = (byte[])m.getAllParams()[0];
--- 176,180 ----
byte[] newBytes = ident.doThat(bytes);
! CalledMethod m = mock.expect("doThat");
byte[] passedIn = (byte[])m.getAllParams()[0];
***************
*** 212,219 ****
}
- /**
- * @param bs
- * @return
- */
private Object cloneBytes(byte[] bytes)
{
--- 209,212 ----
Index: TestOrderedCalls.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/test/mock/TestOrderedCalls.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TestOrderedCalls.java 1 Jan 2006 00:35:56 -0000 1.1
--- TestOrderedCalls.java 7 Aug 2006 15:52:45 -0000 1.2
***************
*** 38,42 ****
final MockOne one = new MockOne(3000);
Thread r = new Thread() {
! public void run() {
delay(1000);
one.callMeFirst(4);
--- 38,43 ----
final MockOne one = new MockOne(3000);
Thread r = new Thread() {
! @Override
! public void run() {
delay(1000);
one.callMeFirst(4);
***************
*** 59,63 ****
final MockOne one = new MockOne(3000);
Thread r = new Thread() {
! public void run() {
delay(1000);
one.callMeFirst(4);
--- 60,65 ----
final MockOne one = new MockOne(3000);
Thread r = new Thread() {
! @Override
! public void run() {
delay(1000);
one.callMeFirst(4);
***************
*** 86,90 ****
final MockOne one = new MockOne(3000);
Thread r = new Thread() {
! public void run() {
delay(1000);
one.callMeFirst(14);
--- 88,93 ----
final MockOne one = new MockOne(3000);
Thread r = new Thread() {
! @Override
! public void run() {
delay(1000);
one.callMeFirst(14);
|