Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » using @Category annotation with SWTBot(is it possible to use @Category annotation in SWTBot tests)
using @Category annotation with SWTBot [message #1728712] Wed, 06 April 2016 15:29 Go to next message
Ess Kay is currently offline Ess KayFriend
Messages: 2
Registered: April 2016
Junior Member
The question may appear to be quite a naive one, but I just can't get my head round it.

Is it possible to use junit Categories in SWTBot tests? I have an example test suite (code below) while running it as 'SWTBot test', I get the following error:

java.lang.Exception: Category annotations on Parameterized classes are not supported on individual methods.
at org.junit.runners.model.InitializationError.<init>(
at org.junit.experimental.categories.Categories.assertNoDescendantsHaveCategoryAnnotations(
at org.junit.experimental.categories.Categories.assertNoDescendantsHaveCategoryAnnotations(
at org.junit.experimental.categories.Categories.assertNoCategorizedDescendentsOfUncategorizeableParents(
at org.junit.experimental.categories.Categories.<init>(
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(
at org.junit.internal.requests.ClassRequest.getRunner(
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main(
at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(
at org.eclipse.e4.ui.internal.workbench.swt.E4Testable$

The test suite I'm using:
interface SlowTests {

public class SlowTestSuite {
public class A {
    private static SWTWorkbenchBot bot;
    public static void firstBefore() {
        System.out.println("Executing A.firstBefore()");
        bot = new SWTWorkbenchBot();
    public void a() {
        System.out.println("Executing A.a()");

    public void b() {
        System.out.println("Executing A.b()");

    public void c() {
        System.out.println("Executing A.c()");
    public static void after() {
        System.out.println("Executing A.after()");

I tried using @Category annotation on the class level instead of individual method, but no luck. Any help will be much appreciated.
Re: using @Category annotation with SWTBot [message #1728991 is a reply to message #1728712] Sat, 09 April 2016 02:51 Go to previous messageGo to next message
Patrick Tasse is currently offline Patrick TasseFriend
Messages: 82
Registered: July 2009
After googling a bit I got referred to this JUnit issue fixed in JUnit 4.13. What version are you using?

This was the duplicate issue that linked to it:

Let us know if that helps.
Re: using @Category annotation with SWTBot [message #1729129 is a reply to message #1728991] Mon, 11 April 2016 11:35 Go to previous message
Ess Kay is currently offline Ess KayFriend
Messages: 2
Registered: April 2016
Junior Member
Ahh, Thanks for your reply Patrick. I had googled quite a lot about it but it appears I somehow missed this link.

I'm using 4.12 that I suppose is the latest stable build. I'll however try and update to 4.13 to see if that works.

Previous Topic:How to Set or type text in TextField of Table..?
Next Topic:Nebula NatTable is now supported
Goto Forum:

Current Time: Thu Jun 08 04:55:05 GMT 2023

Powered by FUDForum. Page generated in 0.02113 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top