1. Select File > New > Project.
2. Select Java Project from the wizard and click Next.
3. Enter the following details and click Next.
4. Under Java Settings go to the Library tab and click on Add External JARs...
5. Add <JDT_HOME>SAPeclipsepluginsorg.junit.X.X.Xjunit.jar to the classpath.
6. Click Finish to create the project.
7. Click OK if a dialog requesting to switch to Java Perspective appears.
8. Now go to context menu of the project and Select New > Class to create a new Java class.
9. Add the following details for the class.
11. Now select New > JUnit Test Case from context menu of the Project.
12. Enter the following details and Click Next.
13. Now select formMessage() method under Available Methods and click Finish.
14. Write the following code for the HelloWorldTest class.
15. Select form context menu of the project Run > JUnit Test.
16. Congrats, the green bar indicates that the test is succesful. (If the test case fails red bar and error messages are displayed)
17. Select form context menu of the project Run > Java Application to Run the Hello World Program.
18. The string “Hello World” is printed to the console.
This finishes the JUnit based Hello World program in SAP NetWeaver Developer Studio.
Other related SDN Weblogs.
1. Creating testing environment while coding for java programs
2. Using Junit in Web Application Server