Merge branch 'master' of https://github.com/eugenp/tutorials into task/BAEL-8143
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?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>
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parallel-tests-junit</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>math-test-functions</artifactId>
|
||||
<name>math-test-functions</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</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>
|
||||
</project>
|
||||
@@ -1,29 +1,28 @@
|
||||
package com.baeldung;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class MathFunctionTest {
|
||||
|
||||
@Test
|
||||
public void test_addingIntegers_returnsSum() throws InterruptedException {
|
||||
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));
|
||||
}
|
||||
}
|
||||
package com.baeldung;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class ArithmeticFunctionTest {
|
||||
|
||||
@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));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.baeldung;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class ComparisonFunctionTest {
|
||||
|
||||
@Test
|
||||
public void test_findMax() {
|
||||
assertEquals(20, Math.max(10, 20));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_findMin() {
|
||||
assertEquals(10, Math.min(10, 20));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +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({StringFunctionTest.class, MathFunctionTest.class})
|
||||
public class FunctionTestSuite {
|
||||
|
||||
}
|
||||
package com.baeldung;
|
||||
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Suite;
|
||||
import org.junit.runners.Suite.SuiteClasses;
|
||||
|
||||
@RunWith(Suite.class)
|
||||
@SuiteClasses({ ComparisonFunctionTest.class, ArithmeticFunctionTest.class })
|
||||
public class FunctionTestSuite {
|
||||
|
||||
}
|
||||
@@ -1,50 +1,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parallel-tests-junit</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>parallel-tests-junit</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</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>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parallel-tests-junit</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>math-test-functions</module>
|
||||
<module>string-test-functions</module>
|
||||
</modules>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?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>
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parallel-tests-junit</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>string-test-functions</artifactId>
|
||||
<name>string-test-functions</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</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>
|
||||
<useUnlimitedThreads>true</useUnlimitedThreads>
|
||||
<threadCountMethods>2</threadCountMethods>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,18 +1,18 @@
|
||||
package com.baeldung;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class StringFunctionTest {
|
||||
|
||||
@Test
|
||||
public void test_upperCase() {
|
||||
assertEquals("TESTCASE", "testCase".toUpperCase());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_indexOf() {
|
||||
assertEquals(1, "testCase".indexOf("e"));
|
||||
}
|
||||
}
|
||||
package com.baeldung;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class StringFunctionTest {
|
||||
|
||||
@Test
|
||||
public void test_upperCase() {
|
||||
assertEquals("TESTCASE", "testCase".toUpperCase());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_indexOf() {
|
||||
assertEquals(1, "testCase".indexOf("e"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user