ここでJUnit 4.10を使用するのは私のテストです。
package geometry;
import org.junit.Assert.*;
import org.junit.Test;
public class SegmentTest extends junit.framework.TestCase {
@Test
public void SegmentParallelTest() {
Segment a = new Segment(10, 5, 20, 11);
Segment b = new Segment(20, 6, 30, 11);
assertFalse(a.isParallel(b));
}
public static junit.framework.Test suite() {
return new junit.framework.JUnit4TestAdapter(SegmentTest.class);
}
public static void main(String args[]) {
org.junit.runner.JUnitCore.main("geometry.SegmentTest");
}
}
次のエラーメッセージが生成されます...
junit.framework.AssertionFailedError: No tests found in geometry.SegmentTest
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
このアプローチの何が問題なのですか?