Note that there are some explanatory texts on larger screens.

plurals
  1. POAnt PDE Tests Run with JUnit4
    primarykey
    data
    text
    <p>I am trying to automate pde tests, using pde-maven-plugin, maven calls, or ant tasks. I followed instructions from the article <a href="http://www.eclipse.org/articles/article.php?file=Article-PDEJUnitAntAutomation/index.html" rel="nofollow noreferrer">Automating Eclipse PDE Unit Tests using Ant</a> to create the test.xml </p> <p>Tests failed, first because No Tests Found</p> <pre><code>junit.framework.AssertionFailedError: junit.framework.AssertionFailedError: No tests found in com.example.TestSuite at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) </code></pre> <p>I searched and found that I should use <code>JUnit4Adapter</code>, but doing that I got <code>ClassCastException</code>, here's the stack trace</p> <pre><code>java.lang.ClassCastException: junit.framework.JUnit4TestAdapter cannot be cast to junit.framework.Test at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:108) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452) 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.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23) 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.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:574) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311) at org.eclipse.equinox.launcher.Main.main(Main.java:1287) </code></pre> <p>Here's my plugin dependencies:</p> <pre><code>Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.jdt.core;bundle-version="3.4.2", org.eclipse.jdt.launching;bundle-version="3.4.1", org.eclipse.core.resources;bundle-version="3.4.1", org.apache.xerces;bundle-version="2.9.0", org.junit4;bundle-version="4.3.1" </code></pre> <p>and the test class</p> <pre><code>package com.example; import junit.framework.JUnit4TestAdapter; import junit.framework.Test; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; @RunWith(Suite.class) @SuiteClasses( { SimpleTests.class}) public class TestSuite { public static Test suite() { return new JUnit4TestAdapter(TestSuite.class); } } </code></pre> <p>any idea how to fix?</p>
    singulars
    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.
    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