Skip to content

Commit 543409a

Browse files
author
Bruce Eckel
committed
Put tests in the "tests" subdirectory
1 parent 04c0810 commit 543409a

File tree

6 files changed

+9
-31
lines changed

6 files changed

+9
-31
lines changed

build.gradle

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -159,20 +159,7 @@ subprojects {
159159
}
160160

161161
junitPlatform {
162-
// platformVersion '1.0.0-SNAPSHOT'
163-
//engines {
164-
// include 'junit-jupiter', 'junit-vintage'
165-
// exclude 'custom-engine'
166-
//}
167-
/* tags {
168-
// include 'fast'
169-
exclude 'slow'
170-
}*/
171-
//includeClassNamePattern '.*Test'
172162
includeClassNamePattern '.*'
173-
// enableStandardTestTask true
174-
// reportsDir "build/test-results/junit-platform" // this is the default
175-
//logManager 'org.apache.logging.log4j.jul.LogManager'
176163
}
177164

178165
// See: http://blog.jessitron.com/2012/07/using-checkstyle-in-gradle.html
@@ -187,8 +174,7 @@ subprojects {
187174
main {
188175
java {
189176
srcDir projectDir
190-
// Remove this when it's working:
191-
// exclude "DynamicStringInverterTests.java"
177+
exclude "tests/**"
192178
}
193179
resources {
194180
srcDir projectDir
@@ -200,18 +186,13 @@ subprojects {
200186
srcDir projectDir
201187
}
202188
}
203-
/* test {
189+
test {
204190
java {
205-
srcDir projectDir
191+
srcDir new File(projectDir, "tests")
206192
}
207-
}*/
193+
}
208194
}
209195

210-
/*test {
211-
testClassesDir = sourceSets.main.output.classesDir
212-
classpath = sourceSets.main.runtimeClasspath
213-
}*/
214-
215196
jmh {
216197
jmhVersion = '1.13'
217198
duplicateClassesStrategy = 'warn'
@@ -227,13 +208,11 @@ subprojects {
227208

228209
// Exclude java sources that will not compile
229210
if (tags.compileTimeError) {
230-
// println ">>> Excluding " + file.name
231211
sourceSets.main.java.excludes.add(file.name)
232212
} else {
233213
JavaExec javaTask = null
234214
// Add tasks for java sources with main methods
235215
if (tags.hasMainMethod || tags.javaCmd) {
236-
237216
javaTask = tasks.create(name: tags.fileRoot, type: JavaExec, dependsOn: tags.runFirst) {
238217
main = tags.mainClass
239218
classpath = sourceSets.main.runtimeClasspath

references/DeepCopyTest.java renamed to references/tests/DeepCopyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// references/DeepCopyTest.java
1+
// references/tests/DeepCopyTest.java
22
// (c)2016 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.

validating/CountedListTest.java renamed to validating/tests/CountedListTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// validating/CountedListTest.java
1+
// validating/tests/CountedListTest.java
22
// (c)2016 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.

validating/DynamicStringInverterTests.java renamed to validating/tests/DynamicStringInverterTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// validating/DynamicStringInverterTests.java
1+
// validating/tests/DynamicStringInverterTests.java
22
// (c)2016 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.

validating/QueueTest.java renamed to validating/tests/QueueTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
// validating/QueueTest.java
1+
// validating/tests/QueueTest.java
22
// (c)2016 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
55
package validating;
6-
//import validating.Queue;
76
import org.junit.jupiter.api.*;
87
import static org.junit.jupiter.api.Assertions.*;
98

validating/StringInverterTests.java renamed to validating/tests/StringInverterTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// validating/StringInverterTests.java
1+
// validating/tests/StringInverterTests.java
22
// (c)2016 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.

0 commit comments

Comments
 (0)