Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using JUnit-Tools 1.1.0 to generate automatic test cases gives me "select a test-project"

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.

like image 961
Preethi Rajaraman Avatar asked Jan 08 '19 06:01

Preethi Rajaraman


People also ask

How do I use JUnit tools?

JUnit has been important in the development of test-driven development, and is one of a family of unit testing frameworks collectively known as xUnit, that originated with JUnit. This tutorial explains the use of JUnit in your project unit testing, while working with Java.

Can JUnit run automatically?

The JUnit framework automatically invokes any @Before methods before each test is run. The following example shows a test fixture with a common Collection object.

What is the use of JUnit test cases?

JUnit is the most famous framework for writing unit tests in Java. You write test methods that call the actual methods to be tested. The test case verifies the behavior of the code by asserting the return value against the expected value, given the parameters passed.


1 Answers

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

like image 94
Kronen Avatar answered Sep 21 '22 08:09

Kronen