6

I installed JUnit-Tools 1.1.0 in eclipse market. As per the documentation, they want the test-projects and the mock-projects to be created manually.

My class structure is like below : enter image description here

I tried creating a test package like com.unifiedportal.core.unifiedportal.service.test and tried generating the test classes from the JUnit-Tools..

Got an warning like below : enter image description here

Let me know how i should proceed with creating the test-project for this.

Preethi Rajaraman
  • 363
  • 1
  • 8
  • 18

2 Answers2

7

If you want to generate the tests under the same project you are in then remove Test-project-postfix in the junit tools preferences, otherwise let the postfix as it is and create a project (not a package) with the same name than your project plus that postfix.

Look an example of my config for generating the tests in the same project under src/test/java, because I don't want my tests to be in a separated project:

enter image description here

Kronen
  • 369
  • 9
  • 23
  • I am using eclipse mars and windos7. I didn't get any option to create a test case. I got an option as create test suit but it didn't generate test cases. – Amol Patil Jun 14 '19 at 15:59
  • I also would like the test cases be generated inside my project. But where should I put the jar files? junit-tools.jar jmockit.jar – artsylar Aug 23 '19 at 03:56
  • @AmolPatil you have to generate it class by class(right click on the class) sadly you can't generate the test classes without a test-suite for an entire package/module – Kronen Oct 23 '19 at 07:23
0

you can add the jars as maven or gradle dependencies.Change the test-source-folder-name to src/test/java and generate the test cases using the plugin.This will generate the test cases in your test folder

milan sonkar
  • 1
  • 2
  • 2