我在这里关注这个例子:jMock - getting started
我收到此错误:无法解析junit.framework.TestCase类型。它是从所需的.class文件间接引用的
我已经导入了这4个罐子:
Ant错误意味着什么?
package com.test;
import org.jmock.integration.junit3.MockObjectTestCase;
import org.jmock.Expectations;
class PublisherTest extends MockObjectTestCase {
public void testOneSubscriberReceivesAMessage() {
// set up
final Subscriber subscriber = mock(Subscriber.class);
Publisher publisher = new Publisher();
publisher.add(subscriber);
final String message = "message";
// expectations
checking(new Expectations() {
{
oneOf(subscriber).receive(message);
}
});
// execute
publisher.publish(message);
}
}
答案 0 :(得分:6)
将JUnit 3添加到类路径中。