0

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:

  1. When I change the test bundles to be plugins instead of fragments, this behavior disappears for some of my test bundles
  2. As soon as a dependency to org.eclipse.swt or org.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!

Followup 3

Reported it as a bug on Scala IDE's bug tracker

rabejens
  • 7,594
  • 11
  • 56
  • 104
  • [check this](http://stackoverflow.com/a/13894408/1038268). Another instances might be executing in background. – Raghu Molabanti Mar 07 '17 at 09:33
  • No, there is definitely no other instance running. However, I installed the Scala IDE plugins into my application and when starting up, it asks me if I want to enable JDT Weaving. This is intended behavior because my application is to build on Scala IDE. Maybe this is the cause... – rabejens Mar 07 '17 at 19:42

0 Answers0