How To Group Multiple Test Classes into a Suite using @runwith(suite.class) junit?

The “Suite Test” means bundle a few unit test cases and run it together.

Lets consider following 2 classes we want to execute in a Group

Make following new class

and Write following stuff into it and check out the results.

package myWorkjUnit;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@Suite.SuiteClasses({ firstjunitprogram.class,LearnAfterBefore.class })
public class JUnitSuiteTest {




package myWorkjUnit;

import org.junit.Test;

public class firstjunitprogram {
 public void Divide() {
 System.out.println("Result - " + divide(10, 5));


 public void substraction(){
 System.out.println("Result - " + substraction(10, 5));

 public void Addition(){
 System.out.println("Result - " + addition(10, 5));

 public int divide(int x, int y) {
 return x / y;


 public int addition(int x, int y) {
 return (x+y);


 public int substraction(int x, int y) {
 return (x-y);



package myWorkjUnit;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

public class LearnAfterBefore {
 public static void testLoadConfiguration(){
 System.out.println("Load configuration files");
 System.out.println("initilize Excel files object");

 public void testsetUp() {
 System.out.println("Open browser");
 System.out.println("Navigate URL");


 public void testAdvancedSearch() {
 System.out.println("Search on website");

 public void testVerifySearchResult(){
 System.out.println("Verify search result");

 public void testtearDown() {
 System.out.println("Close Browser");

 public static void testReportResult(){
 System.out.println("Report result");

Reference Link 1


For a better web


News and reviews from the world of gadgets, gear, apps and the web


News About Tech, Money and Innovation

Digital Inspiration

Tips and tutorials around all things tech.

Thinkwareglobal's Blog

Just another weblog

Kenazari's Blog

Just another weblog

Richfowler1's Blog

Just another weblog

Romaicus's Blog

Just another weblog


Just another site


Just another site


Just another site


digital media expert blog

Thinking in Silverlight

Silverlight/WPF/Windows 8 Store App

Different Journeys

Let's make life easier!




Promoting Indian language Books

Actively Lazy

Software, crafted with passion


An ongoing discussion about SAP infrastructure

SAP Career

Your Career Mentor


Just another site

The secret product manager

Thoughts about product management, SUSE, Linux, ARM processors, Cloud, AIX, Power Systems, and other things that interest me

Sap Certification Material . Com

Quality store for sap software and courses

Simon Les Flex's Blog

SAP Process Integration Specialist - NOW WE CAN DO BETTER!

Oracle Technologies Primer

An Oracle Fusion Middleware and iPaaS blog!

Gilberto Holms

Java, Middleware, SOA Architecture Blog

The Skeleton

Java code skeletons, tips and pointers

J@n van Zoggel

integration, innovation & random technology stuff

The Pragmatic Integrator

Hints and tips from a pragmatic integration specialist


The pace of life..

Optimalbg's Blog

Just another site

IT Jobs in USA

Keep the track of this Blog if you are looking out for some good Opportunities to work in USA....

Referral Jobs | Right Place to Get a Job

Hurry you are one Click away to get a job - Fresher Jobs for 2012, 2013 fresher’s and also high paid jobs for well Experienced IT professionals on Referal jobs.

ISO Consulting | ISO 27001 | ISO 20000 | CMMI | BCM | GRI Sustainability Reporting & Assurance | eLearning | Trainings | Philippines

Michael Korn's Blog

Musings on Life, Career, Faith and Technology


Just another weblog


.Net Core, AspNetCore, Entity Framework, Entity Framework Core, AspNetIdentity, AspNetIdentityCore, Unit Test, WCF, Workflows

SQA and Testers Blog

Just another weblog

Expertqtp's Weblog

Just another weblog

Sai Chamarthi

Experienced Testing Professional


A great site

Suresh4qtp's Blog

Just another site


This site is the cat’s pajamas

It's always something...

Just another weblog

Faculty of Information Technology - Lê Ngọc Tiến

Be Yourself! Simplify Our Goals! Nothing is Impossible!

Anti-Malware Testing

Thoughts on security product testing past and present

Methods & Tools

Practical knowledge for the software developer, tester and project manager