Note that there are some explanatory texts on larger screens.

plurals
  1. PORunning JUnit 4 Tests Parallel With FailSafe & SureFire plugins
    primarykey
    data
    text
    <p>We have a profile created in maven to run our <strong>Selenium junit4 type tests</strong> and below is the snippet of it without the executions tag.</p> <pre><code>&lt;profile&gt; &lt;id&gt;selenium-tests&lt;/id&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt; &lt;version&gt;2.11&lt;/version&gt; &lt;dependencies&gt; &lt;!-- Force using the latest JUnit 47 provider --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.maven.surefire&lt;/groupId&gt; &lt;artifactId&gt;surefire-junit47&lt;/artifactId&gt; &lt;version&gt;2.11&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;configuration&gt; &lt;parallel&gt;classes&lt;/parallel&gt; &lt;threadCount&gt;5&lt;/threadCount&gt; &lt;forkMode&gt;pertest&lt;/forkMode&gt; &lt;useManifestOnlyJar&gt;false&lt;/useManifestOnlyJar&gt; &lt;redirectTestOutputToFile&gt;true&lt;/redirectTestOutputToFile&gt; &lt;skip&gt;false&lt;/skip&gt; &lt;includes&gt; &lt;include&gt;**/regtests/*.java&lt;/include&gt; &lt;/includes&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;/profile&gt; </code></pre> <p>And my TestClass looks like this.</p> <pre><code>@RunWith(HTMLSourceDumperJUnit4Runner.class) //Our own Runner public class MyTestClass extends Assert { private int x = 1; private int y = 1; @Test public void testAddition() { int z = x + y; assertEquals(2, z); } } </code></pre> <p>When I run this testclass through the failsafe plugin 2.11 with parallel configuration it fails with the following error.</p> <pre> java.lang.Exception: No runnable methods at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:171) at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:115) at org.junit.runners.ParentRunner.validate(ParentRunner.java:269) at org.junit.runners.ParentRunner.(ParentRunner.java:66) at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:59) at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:13) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29) at org.junit.runner.Computer.getRunner(Computer.java:38) at org.apache.maven.surefire.junitcore.ConfigurableParallelComputer.getRunner(ConfigurableParallelComputer.java:142) at org.junit.runner.Computer$1.runnerForClass(Computer.java:29) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57) at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:93) at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:84) at org.junit.runners.Suite.(Suite.java:79) at org.junit.runner.Computer.getSuite(Computer.java:26) at org.apache.maven.surefire.junitcore.ConfigurableParallelComputer.getSuite(ConfigurableParallelComputer.java:134) at org.junit.runner.Request.classes(Request.java:69) at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:53) at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:188) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:166) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:101) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) </pre> <p>Is there anything I'm missing here. If I'm lagging any information for this post, please post back.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload