Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8070779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:30:28+00:00 2026-06-05T13:30:28+00:00

I have many Test Suites with each one contains many Test Classes. Here is

  • 0

I have many Test Suites with each one contains many Test Classes. Here is how they look like:

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses( {ATest.class, BTest.class})
public class MyFirstTestSuite {

    @BeforeClass
    public static void beforeClass() throws Exception {
                // load resources
    }

    @AfterClass
    public static void afterClass() throws Exception {
        // release resources

    }
}

Sometimes I want to disable a whole Test Suite completely. I don’t want to set each test class as @Ignore, since every test suite loads and releases resources using @BeforeClass and @AfterClass and I want to skip this loading/releasing when the test suite is ignored.

So the question is: is there anything similar to @Ignore that I can use on a whole Test Suite?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:30:29+00:00Added an answer on June 5, 2026 at 1:30 pm

    You can annotate the TestSuite with @Ignore.

    @RunWith(Suite.class)
    @SuiteClasses({Test1.class})
    @Ignore
    public class MySuite {
        public MySuite() {
            System.out.println("Hello world");
        }
    
        @BeforeClass
        public static void hello() {
            System.out.println("beforeClass");
        }
    }
    

    doesn’t produce any output.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a test file that has many lines, each line looks something like:
I have many classes in GWT that represents graphical widgets . They are packaged
I have many Spring Test classes (defined using @RunWith(SpringJUnit4ClassRunner) ) that I want to
I have a collection testcase like this, Test Builds have many Test Case Logs
I have MANY small Test Projects where I put together just enough code to
I have many tables: <table id=342> <tr> <td>342</td> <td>test</td> </tr> </table> <table id=533> <tr>
I have recently been using telnet a lot recently to test out many different
I have a Groovy unit test class that has many unit tests. In the
I have the code below in my test code in many places: // //
I have a really long integration test that simulates a sequential process involving many

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.