renamed back to testing-modules, pulled together testing-modules-2 modules into single module

This commit is contained in:
Sjmillington
2019-09-04 18:03:26 +01:00
parent ff871516ee
commit ce9ea390ba
558 changed files with 16 additions and 75 deletions

View File

@@ -0,0 +1,52 @@
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>math-test-functions</artifactId>
<name>math-test-functions</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parallel-tests-junit</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<parallel>all</parallel>
<threadCount>10</threadCount>
<threadCountSuites>2</threadCountSuites>
<threadCountClasses>2</threadCountClasses>
<threadCountMethods>6</threadCountMethods>
<parallelTestTimeoutInSeconds>3.5</parallelTestTimeoutInSeconds>
<parallelTestTimeoutForcedInSeconds>5</parallelTestTimeoutForcedInSeconds>
<perCoreThreadCount>true</perCoreThreadCount>
<includes>
<include>FunctionTestSuite.class</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@@ -0,0 +1,28 @@
package com.baeldung;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class ArithmeticFunctionUnitTest {
@Test
public void test_addingIntegers_returnsSum() {
assertEquals(22, Math.addExact(10, 12));
}
@Test
public void test_multiplyingIntegers_returnsProduct() {
assertEquals(120, Math.multiplyExact(10, 12));
}
@Test
public void test_subtractingIntegers_returnsDifference() {
assertEquals(2, Math.subtractExact(12, 10));
}
@Test
public void test_minimumInteger() {
assertEquals(10, Math.min(10, 12));
}
}

View File

@@ -0,0 +1,19 @@
package com.baeldung;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class ComparisonFunctionUnitTest {
@Test
public void test_findMax() {
assertEquals(20, Math.max(10, 20));
}
@Test
public void test_findMin() {
assertEquals(10, Math.min(10, 20));
}
}

View File

@@ -0,0 +1,11 @@
package com.baeldung;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({ ComparisonFunctionUnitTest.class, ArithmeticFunctionUnitTest.class })
public class FunctionTestSuite {
}