Skip to content

Commit d6b903e

Browse files
committed
test: clean tests
1 parent 7909e77 commit d6b903e

File tree

28 files changed

+104
-534
lines changed

28 files changed

+104
-534
lines changed

src/test/java/com/adventofcode/flashk/common/test/utils/PuzzleTest.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,7 @@
11
package com.adventofcode.flashk.common.test.utils;
22

3-
import org.junit.jupiter.api.AfterEach;
4-
import org.junit.jupiter.api.BeforeEach;
5-
63
public abstract class PuzzleTest {
74

8-
private Timer timer = new Timer();
9-
10-
@BeforeEach
11-
public void before() {
12-
timer.start();
13-
}
14-
15-
@AfterEach
16-
public void after() {
17-
timer.stop();
18-
}
19-
20-
215
public abstract void testSolvePart1Sample();
226
public abstract void testSolvePart1Input();
237
public abstract void testSolvePart2Sample();

src/test/java/com/adventofcode/flashk/common/test/utils/TableFormat.java

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/test/java/com/adventofcode/flashk/common/test/utils/Timer.java

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/test/java/com/adventofcode/flashk/day01/Day01Test.java

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import java.util.List;
44

5-
import org.junit.jupiter.api.BeforeAll;
6-
import org.junit.jupiter.api.Disabled;
75
import org.junit.jupiter.api.DisplayName;
86
import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
97
import org.junit.jupiter.api.Order;
@@ -16,7 +14,6 @@
1614
import com.adventofcode.flashk.common.test.constants.TestFolder;
1715
import com.adventofcode.flashk.common.test.constants.TestTag;
1816
import com.adventofcode.flashk.common.test.utils.PuzzleTest;
19-
import com.adventofcode.flashk.common.test.utils.Timer;
2017
import com.adventofcode.flashk.common.test.utils.Input;
2118

2219
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -25,23 +22,15 @@
2522
@TestMethodOrder(OrderAnnotation.class)
2623
public class Day01Test extends PuzzleTest {
2724

28-
private final static String INPUT_FOLDER = TestFolder.DAY_01;
29-
30-
@BeforeAll
31-
public static void beforeAll() {
32-
Timer.printHeader(TestDisplayName.DAY_01);
33-
}
34-
25+
private static final String INPUT_FOLDER = TestFolder.DAY_01;
3526

3627
@Test
3728
@Order(1)
3829
@Tag(TestTag.PART_ONE)
3930
@Tag(TestTag.SAMPLE)
4031
@DisplayName(TestDisplayName.PART_ONE_SAMPLE)
4132
public void testSolvePart1Sample() {
42-
43-
System.out.print("1 | sample | ");
44-
33+
4534
// Read input file
4635
List<String> inputs = Input.readStringLines(INPUT_FOLDER, TestFilename.INPUT_FILE_SAMPLE);
4736

@@ -57,8 +46,6 @@ public void testSolvePart1Sample() {
5746
@DisplayName(TestDisplayName.PART_ONE_INPUT)
5847
public void testSolvePart1Input() {
5948

60-
System.out.print("1 | input | ");
61-
6249
// Read input file
6350
List<String> inputs = Input.readStringLines(INPUT_FOLDER, TestFilename.INPUT_FILE);
6451
HistorianHysteria historianHysteria = new HistorianHysteria(inputs);
@@ -74,8 +61,6 @@ public void testSolvePart1Input() {
7461
@DisplayName(TestDisplayName.PART_TWO_SAMPLE)
7562
public void testSolvePart2Sample() {
7663

77-
System.out.print("2 | sample | ");
78-
7964
// Read input file
8065
List<String> inputs = Input.readStringLines(INPUT_FOLDER, TestFilename.INPUT_FILE_SAMPLE);
8166

@@ -91,8 +76,6 @@ public void testSolvePart2Sample() {
9176
@DisplayName(TestDisplayName.PART_TWO_INPUT)
9277
public void testSolvePart2Input() {
9378

94-
System.out.print("2 | input | ");
95-
9679
// Read input file
9780
List<String> inputs = Input.readStringLines(INPUT_FOLDER, TestFilename.INPUT_FILE);
9881

src/test/java/com/adventofcode/flashk/day02/Day02Test.java

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import java.util.List;
44

5-
import org.junit.jupiter.api.BeforeAll;
6-
import org.junit.jupiter.api.Disabled;
75
import org.junit.jupiter.api.DisplayName;
86
import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
97
import org.junit.jupiter.api.Order;
@@ -16,7 +14,7 @@
1614
import com.adventofcode.flashk.common.test.constants.TestFolder;
1715
import com.adventofcode.flashk.common.test.constants.TestTag;
1816
import com.adventofcode.flashk.common.test.utils.PuzzleTest;
19-
import com.adventofcode.flashk.common.test.utils.Timer;
17+
2018
import com.adventofcode.flashk.common.test.utils.Input;
2119

2220
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -25,12 +23,7 @@
2523
@TestMethodOrder(OrderAnnotation.class)
2624
public class Day02Test extends PuzzleTest {
2725

28-
private final static String INPUT_FOLDER = TestFolder.DAY_02;
29-
30-
@BeforeAll
31-
public static void beforeAll() {
32-
Timer.printHeader(TestDisplayName.DAY_02);
33-
}
26+
private static final String INPUT_FOLDER = TestFolder.DAY_02;
3427

3528

3629
@Test
@@ -39,9 +32,7 @@ public static void beforeAll() {
3932
@Tag(TestTag.SAMPLE)
4033
@DisplayName(TestDisplayName.PART_ONE_SAMPLE)
4134
public void testSolvePart1Sample() {
42-
43-
System.out.print("1 | sample | ");
44-
35+
4536
// Read input file
4637
List<String> inputs = Input.readStringLines(INPUT_FOLDER, TestFilename.INPUT_FILE_SAMPLE);
4738

@@ -55,9 +46,7 @@ public void testSolvePart1Sample() {
5546
@Tag(TestTag.INPUT)
5647
@DisplayName(TestDisplayName.PART_ONE_INPUT)
5748
public void testSolvePart1Input() {
58-
59-
System.out.print("1 | input | ");
60-
49+
6150
// Read input file
6251
List<String> inputs = Input.readStringLines(INPUT_FOLDER, TestFilename.INPUT_FILE);
6352
RedNosedReports reports = new RedNosedReports(inputs);
@@ -72,9 +61,7 @@ public void testSolvePart1Input() {
7261
@Tag(TestTag.SAMPLE)
7362
@DisplayName(TestDisplayName.PART_TWO_SAMPLE)
7463
public void testSolvePart2Sample() {
75-
76-
System.out.print("2 | sample | ");
77-
64+
7865
// Read input file
7966
List<String> inputs = Input.readStringLines(INPUT_FOLDER, TestFilename.INPUT_FILE_SAMPLE);
8067
RedNosedReports reports = new RedNosedReports(inputs);
@@ -88,9 +75,7 @@ public void testSolvePart2Sample() {
8875
@Tag(TestTag.INPUT)
8976
@DisplayName(TestDisplayName.PART_TWO_INPUT)
9077
public void testSolvePart2Input() {
91-
92-
System.out.print("2 | input | ");
93-
78+
9479
// Read input file
9580
List<String> inputs = Input.readStringLines(INPUT_FOLDER, TestFilename.INPUT_FILE);
9681
RedNosedReports reports = new RedNosedReports(inputs);

src/test/java/com/adventofcode/flashk/day03/Day03Test.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ class Day03Test extends PuzzleTest {
3131
@Tag(TestTag.SAMPLE)
3232
@DisplayName(TestDisplayName.PART_ONE_SAMPLE)
3333
public void testSolvePart1Sample() {
34-
35-
System.out.print("1 | sample | ");
36-
34+
3735
// Read input file
3836
List<String> inputs = Input.readStringLines(INPUT_FOLDER, TestFilename.INPUT_FILE_SAMPLE);
3937

@@ -48,9 +46,7 @@ public void testSolvePart1Sample() {
4846
@Tag(TestTag.INPUT)
4947
@DisplayName(TestDisplayName.PART_ONE_INPUT)
5048
public void testSolvePart1Input() {
51-
52-
System.out.print("1 | input | ");
53-
49+
5450
// Read input file
5551
List<String> inputs = Input.readStringLines(INPUT_FOLDER, TestFilename.INPUT_FILE);
5652
MullItOver mullItOver = new MullItOver(inputs);
@@ -67,8 +63,6 @@ public void testSolvePart1Input() {
6763
@DisplayName(TestDisplayName.PART_TWO_DEBUG)
6864
void testSolvePart2InputByLines() {
6965

70-
System.out.print("1 | input | ");
71-
7266
// Read input file
7367
List<String> inputs = Input.readStringLines(INPUT_FOLDER, TestFilename.INPUT_FILE);
7468

@@ -85,9 +79,7 @@ void testSolvePart2InputByLines() {
8579
@Tag(TestTag.SAMPLE)
8680
@DisplayName(TestDisplayName.PART_TWO_SAMPLE)
8781
public void testSolvePart2Sample() {
88-
89-
System.out.print("2 | sample | ");
90-
82+
9183
// Read input file
9284
List<String> inputs = Input.readStringLines(INPUT_FOLDER, INPUT_FILE_SAMPLE_PART_2);
9385
MullItOver mullItOver = new MullItOver(inputs);
@@ -101,9 +93,7 @@ public void testSolvePart2Sample() {
10193
@Tag(TestTag.INPUT)
10294
@DisplayName(TestDisplayName.PART_TWO_INPUT)
10395
public void testSolvePart2Input() {
104-
105-
System.out.print("2 | input | ");
106-
96+
10797
// Read input file
10898
List<String> inputs = Input.readStringLines(INPUT_FOLDER, TestFilename.INPUT_FILE);
10999
MullItOver mullItOver = new MullItOver(inputs);

src/test/java/com/adventofcode/flashk/day04/Day04Test.java

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package com.adventofcode.flashk.day04;
22

3-
import java.util.List;
4-
5-
import org.junit.jupiter.api.BeforeAll;
6-
import org.junit.jupiter.api.Disabled;
73
import org.junit.jupiter.api.DisplayName;
84
import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
95
import org.junit.jupiter.api.Order;
@@ -16,7 +12,6 @@
1612
import com.adventofcode.flashk.common.test.constants.TestFolder;
1713
import com.adventofcode.flashk.common.test.constants.TestTag;
1814
import com.adventofcode.flashk.common.test.utils.PuzzleTest;
19-
import com.adventofcode.flashk.common.test.utils.Timer;
2015
import com.adventofcode.flashk.common.test.utils.Input;
2116

2217
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -25,23 +20,15 @@
2520
@TestMethodOrder(OrderAnnotation.class)
2621
public class Day04Test extends PuzzleTest {
2722

28-
private final static String INPUT_FOLDER = TestFolder.DAY_04;
29-
30-
@BeforeAll
31-
public static void beforeAll() {
32-
Timer.printHeader(TestDisplayName.DAY_04);
33-
}
23+
private static final String INPUT_FOLDER = TestFolder.DAY_04;
3424

35-
3625
@Test
3726
@Order(1)
3827
@Tag(TestTag.PART_ONE)
3928
@Tag(TestTag.SAMPLE)
4029
@DisplayName(TestDisplayName.PART_ONE_SAMPLE)
4130
public void testSolvePart1Sample() {
42-
43-
System.out.print("1 | sample | ");
44-
31+
4532
// Read input file
4633
char[][] inputs = Input.read2DCharArray(INPUT_FOLDER, TestFilename.INPUT_FILE_SAMPLE);
4734
CeresSearch ceresSearch = new CeresSearch(inputs);
@@ -55,9 +42,7 @@ public void testSolvePart1Sample() {
5542
@Tag(TestTag.INPUT)
5643
@DisplayName(TestDisplayName.PART_ONE_INPUT)
5744
public void testSolvePart1Input() {
58-
59-
System.out.print("1 | input | ");
60-
45+
6146
// Read input file
6247
char[][] inputs = Input.read2DCharArray(INPUT_FOLDER, TestFilename.INPUT_FILE);
6348
CeresSearch ceresSearch = new CeresSearch(inputs);
@@ -72,9 +57,7 @@ public void testSolvePart1Input() {
7257
@Tag(TestTag.SAMPLE)
7358
@DisplayName(TestDisplayName.PART_TWO_SAMPLE)
7459
public void testSolvePart2Sample() {
75-
76-
System.out.print("2 | sample | ");
77-
60+
7861
// Read input file
7962
char[][] inputs = Input.read2DCharArray(INPUT_FOLDER, TestFilename.INPUT_FILE_SAMPLE);
8063
CeresSearch ceresSearch = new CeresSearch(inputs);
@@ -88,9 +71,7 @@ public void testSolvePart2Sample() {
8871
@Tag(TestTag.INPUT)
8972
@DisplayName(TestDisplayName.PART_TWO_INPUT)
9073
public void testSolvePart2Input() {
91-
92-
System.out.print("2 | input | ");
93-
74+
9475
// Read input file
9576
char[][] inputs = Input.read2DCharArray(INPUT_FOLDER, TestFilename.INPUT_FILE);
9677
CeresSearch ceresSearch = new CeresSearch(inputs);

0 commit comments

Comments
 (0)