Skip to content

Commit ff1b1fc

Browse files
josephine-barbozaCalamarBicefalo
authored andcommitted
BAEL-1857 Running Parallel JUnit Tests with Maven
1 parent be6d6cf commit ff1b1fc

3 files changed

Lines changed: 58 additions & 11 deletions

File tree

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package com.baeldung;
2-
3-
import org.junit.runner.RunWith;
4-
import org.junit.runners.Suite;
5-
import org.junit.runners.Suite.SuiteClasses;
6-
7-
@RunWith(Suite.class)
8-
@SuiteClasses({StringFunctionTest.class, MathFunctionTest.class})
9-
public class FunctionTestSuite {
10-
11-
}
1+
package com.baeldung;
2+
3+
import org.junit.runner.RunWith;
4+
import org.junit.runners.Suite;
5+
import org.junit.runners.Suite.SuiteClasses;
6+
7+
@RunWith(Suite.class)
8+
@SuiteClasses({StringFunctionTest.class, MathFunctionTest.class})
9+
public class FunctionTestSuite {
10+
11+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.baeldung;
2+
3+
import static org.junit.Assert.assertEquals;
4+
5+
import org.junit.Test;
6+
7+
public class MathFunctionTest {
8+
9+
@Test
10+
public void test_addingIntegers_returnsSum() throws InterruptedException {
11+
assertEquals(22, Math.addExact(10, 12));
12+
13+
}
14+
15+
@Test
16+
public void test_multiplyingIntegers_returnsProduct() {
17+
assertEquals(120, Math.multiplyExact(10, 12));
18+
}
19+
20+
@Test
21+
public void test_subtractingIntegers_returnsDifference() {
22+
assertEquals(2, Math.subtractExact(12, 10));
23+
}
24+
25+
@Test
26+
public void test_minimumInteger() {
27+
assertEquals(10, Math.min(10, 12));
28+
}
29+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.baeldung;
2+
3+
import static org.junit.Assert.assertEquals;
4+
5+
import org.junit.Test;
6+
7+
public class StringFunctionTest {
8+
9+
@Test
10+
public void test_upperCase() {
11+
assertEquals("TESTCASE", "testCase".toUpperCase());
12+
}
13+
14+
@Test
15+
public void test_indexOf() {
16+
assertEquals(1, "testCase".indexOf("e"));
17+
}
18+
}

0 commit comments

Comments
 (0)