Skip to content

Commit 869781b

Browse files
committed
Mark all but first test @ignore in hello-world
- in base build script, filter out @ignores so that maintainers can run the full test suites. - increase the verbosity of test logging to aide in seeing progress as tests are un@Ignored and solved. - revamped GETTING_STARTED.md to reflect new output. It is now a complete guide from start to finish with calls-to-action at the end of the instructions.
1 parent 2b217ad commit 869781b

8 files changed

Lines changed: 517 additions & 95 deletions

File tree

‎exercises/build.gradle‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,24 @@ subprojects { project ->
1818
project["compileStarterSourceJava"].doFirst { compileTask ->
1919
println " (source = " + compileTask.source.asPath + ")"
2020
}
21+
22+
// In lieu of being able to disable @Ignore in JUnit tests, we filter
23+
// those annotations, placing the edited tests in the path named here.
24+
test {
25+
java.srcDirs = ["build/gen/test/java"]
26+
}
27+
project["compileTestJava"].doFirst { compileTask ->
28+
println " (source = " + compileTask.source.asPath + ")"
29+
}
2130
}
2231

23-
task fullTest(type: Test) {
24-
group = LifecycleBasePlugin.VERIFICATION_GROUP
25-
description = "Runs tests without exclusions."
32+
task copyTestsFilteringIgnores(type: Copy) {
33+
from "src/test/java"
34+
into "build/gen/test/java"
35+
filter { line ->
36+
line.contains("@Ignore") ? null : line
37+
}
2638
}
2739

28-
check.dependsOn(fullTest)
40+
test.dependsOn(copyTestsFilteringIgnores)
2941
}

‎exercises/grade-school/build.gradle‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,3 @@ dependencies {
1010
testCompile "junit:junit:4.10"
1111
testCompile "org.assertj:assertj-core:3.2.0"
1212
}
13-
14-
test {
15-
useJUnit {
16-
excludeCategories 'io.exercism.xjava.NotReady'
17-
}
18-
}

‎exercises/grade-school/src/example/java/io/exercism/xjava/NotReady.java‎

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

‎exercises/grade-school/src/test/java/SchoolTest.java‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import static org.assertj.core.api.Assertions.assertThat;
22

3-
import io.exercism.xjava.NotReady;
4-
import org.junit.experimental.categories.Category;
53
import org.junit.Test;
64

75
import java.util.Arrays;
@@ -18,14 +16,12 @@ public void startsWithNoStudents() {
1816
}
1917

2018
@Test
21-
@Category(NotReady.class)
2219
public void addsStudents() {
2320
school.add("Aimee", 2);
2421
assertThat(school.db().get(2)).contains("Aimee");
2522
}
2623

2724
@Test
28-
@Category(NotReady.class)
2925
public void addsMoreStudentsInSameGrade() {
3026
final int grade = 2;
3127
school.add("James", grade);
@@ -36,7 +32,6 @@ public void addsMoreStudentsInSameGrade() {
3632
}
3733

3834
@Test
39-
@Category(NotReady.class)
4035
public void addsStudentsInMultipleGrades() {
4136
school.add("Chelsea", 3);
4237
school.add("Logan", 7);
@@ -47,7 +42,6 @@ public void addsStudentsInMultipleGrades() {
4742
}
4843

4944
@Test
50-
@Category(NotReady.class)
5145
public void getsStudentsInAGrade() {
5246
school.add("Franklin", 5);
5347
school.add("Bradley", 5);
@@ -56,13 +50,11 @@ public void getsStudentsInAGrade() {
5650
}
5751

5852
@Test
59-
@Category(NotReady.class)
6053
public void getsStudentsInEmptyGrade() {
6154
assertThat(school.grade(1)).isEmpty();
6255
}
6356

6457
@Test
65-
@Category(NotReady.class)
6658
public void sortsSchool() {
6759
school.add("Jennifer", 4);
6860
school.add("Kareem", 6);

0 commit comments

Comments
 (0)