This simple maven repository is used for the purpose of demonstrating the testNG capabilities.
To run this Java application, you need to have installed below two applications and they need to be configured as environment variables
- Java 8 ( refer this[1] document for setting java into path)
- Maven 3.x.x ( refer this[2] doc for more information)
After installing the above two, please follow the below instructions
- Go to the home folder of the project and execute
mvn clean install
in a terminal ( or command prompt) - After successful completion of above, go to the
org.dimuth.testng.demo
class and execute the main method - You should be able to see an output like below
A + B = 6070.0
A - B = -1770.0
A * B = 8428000.0
A / B = 0.548469387755102
Process finished with exit code 0
[1] - https://www.java.com/en/download/help/path.xml
[2] - https://www.baeldung.com/install-maven-on-windows-linux-mac
- To clone the project
git clone https://github.com/dimuthnc/testng-demo.git
- TestNG Dependency
<dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>7.3.0</version> <scope>test</scope> </dependency>
- Mockito Dependency
<dependency> <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> <version>1.10.19</version> <scope>test</scope> </dependency>
- Maven Surefire Plugin
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.0.0-M1</version> <configuration> <suiteXmlFiles> <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile> </suiteXmlFiles> </configuration> </plugin>