You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2008/01/23 01:38:05 UTC
T5: TapestryTestCase and EasyMock
Hi,
I have a disturbing problem, following is a test using TapestryTestCase,
Easymock will give me an error:
ava.lang.IllegalStateException: missing behavior definition for the
preceeding method call DBServices.findUsrByCode("M123")
if I change the method test5 to test6, or i comment out the 'test5', it will
pass, in Tapestry 5.0.7 or 5.0.8-snapshot, all the same, I specify the easy
mock dependency in pom as:
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>2.3</version>
<scope>test</scope>
any hints on what is missing here? thanks.
Angelo
public class ImportImplTest extends TapestryTestCase {
private DBServices services;
@BeforeClass
public void setup() {
services = newMock(DBServices.class);
}
@Test
public void testCodeExists2() {
ImportImpl impl = new ImportImpl(services);
expect(services.findUsrByCode("M123")).andReturn(new Usr());
replay();
try {
impl.get("M123");
} catch (InvalidCodeException e) {
assertTrue(false, "invalid code not expected");
} catch (CodeExistsException e) {
System.out.println("CodeExists passed");
}
verify();
}
@Test
public void test5() {
System.out.println("test2");
}
}
--
View this message in context: http://www.nabble.com/T5%3A-TapestryTestCase-and-EasyMock-tp15032394p15032394.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org