Followups below.
I have a strange problem: I am trying to run a JUnit test as a JUnit plug-in test.
My test can be as simple as this:
public class FooTest {
@Test
public void testSomething() {
assertThat("6 * 7 is 42", 6 * 7, equalTo(42));
}
}
when I right-click it and select Run As / JUnit Plug-In Test the test runs (and also succeeds and the success is shown in the JUnit view), but after exiting, it is started again, and again, and again...
What is going wrong here?
Followup 1
I investigated this some more and made some progress.
What I discovered:
- When I change the test bundles to be plugins instead of fragments, this behavior disappears for some of my test bundles
- As soon as a dependency to
org.eclipse.swt
ororg.eclipse.jface
creeps in, the behavior starts to appear. The tests are run over and over again.
Followup 2
I started with a clean Eclipse Neon RCP/RAP installation and a basic plugin containing only the the basic test shown here. When running this test, everything worked, test ran only once.
Then, I added a dependency to org.eclipse.swt
and org.eclipse.jface
. Cleared the run configuration and ran the test again. Again, everything fine.
Now, I added Scala-IDE from the update site, cleared the run configuration and ran the test again. Boom, infinite test run loop!