Working with JUnit

Junit home

JUnit 5 seem too complicated

Search for: JUnit 5 seem too complicated

So I go with junit4 for now

Download: The 2 jar files for Juni4


package com.ai.aspire.config;

import org.junit.Test;
import com.ai.application.utils.AppObjects;

public class ModuleTest 
{
   @Test
   public void mainTest()
   throws Exception
   {
      //setup
      AppObjects.initApplicationFromEnvPropertiesFile();
      
      //actual tests
      ObjectDefinition.test();
   }
   private void test1()
   {
      p("Hello");
   }
   
   private void p(String s)
   {
      System.out.println(s);
   }
}

1. One of these for each package

2. Each class will have static methods

3. Module test will call them once for each class

4. A class may call inside many number of other tests

This will allow me to run the class using the run icon of eclipse as a Junit

There is likely a better way to do this. will do for now

When I now I will post