Prerequisite: if want to work with Maven & eclipse

Here are the basic steps as to how I set up “passing” project using maven & eclipse for the coding exercises. If you are using other IDEs or command line approach then you can ignore this prerequisite. Just create the relevant packages and copy the classes in the passing the test exercises. Using Maven or not, you need the 2 jar files as dependencies to use JUnit.

passing-unit-tests-prerequisite

Step 1: Set up Java, Maven, and Eclipse on your machine following the steps in Setting up Java, Maven, and eclipse

Step 2: Generate a simple project using Maven

Step 3: This should create a basic Maven structure with a pom.xml shown below. We need JUnit framework to write unit tests.

passing-unit-tests-prerequisite-1

Step 4: You can import this into eclipse with File –> Import. and then “Existing Maven Projects”, and then select

passing-unit-tests-prerequisite-2

Press next, and tick the check box shown below

passing-unit-tests-prerequisite-3

Step 5: You can now start working within eclipse. You can create new classes, etc.

passing-unit-tests-prereq-4

Just create the relevant packages and copy the classes in the passing the test exercises.


300+ Java & Big Data Interview FAQs

16+ Java Key Areas Interview Q&As

800+ Java Interview Q&As

300+ Java & Big Data Tutorials

Top