我在 eclipse juno 中运行 get 1.7.5 试图设置 junit 测试。我从juno插件文件夹添加了junit jar。我已经为junit 4设置了选项。
我创建了一个新的获取项目“MyJunitProject”,并在客户端“MyFirstGWTTestCase”下创建了一个类。这是代码。
package com.client;
import org.junit.Test;
import com.google.gwt.junit.client.GWTTestCase;
public class MyFirstGWTTestCase extends GWTTestCase {
@Override
public String getModuleName() {
return "com.MyJunitProject";
}
@Test
public void myFirstTest() {
assertTrue(true);
}
}
我收到以下错误:
junit.framework.AssertionFailedError: No tests found in com.client.MyFirstGWTTestCase
at junit.framework.Assert.fail(Assert.java:50)
at junit.framework.TestSuite$1.runTest(TestSuite.java:97)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)