@@ -4,10 +4,12 @@ buildscript {
4
4
jcenter()
5
5
mavenCentral()
6
6
}
7
+ dependencies {
8
+ classpath ' org.junit.platform:junit-platform-gradle-plugin:1.0.0-M2'
9
+ }
7
10
}
8
11
9
12
plugins {
10
- // id 'com.gradle.build-scan' version '1.0' // Should be first in list
11
13
id ' com.github.johnrengelman.shadow' version ' 1.2.3'
12
14
id ' me.champeau.gradle.jmh' version ' 0.3.1'
13
15
}
@@ -123,10 +125,16 @@ class Tags {
123
125
}
124
126
}
125
127
128
+ ext. junit4Version = ' 4.12'
129
+ ext. junitVintageVersion = ' 4.12.0-M2'
130
+ ext. junitPlatformVersion = ' 1.0.0-M2'
131
+ ext. junitJupiterVersion = ' 5.0.0-M2'
132
+
126
133
subprojects {
127
134
apply plugin : ' com.github.johnrengelman.shadow'
128
135
apply plugin : ' me.champeau.gradle.jmh'
129
136
apply plugin : ' java'
137
+ apply plugin : ' org.junit.platform.gradle.plugin'
130
138
131
139
sourceCompatibility = ' 1.8'
132
140
targetCompatibility = ' 1.8'
@@ -138,26 +146,72 @@ subprojects {
138
146
}
139
147
140
148
dependencies {
141
- compile ' junit:junit:4.12'
149
+ // compile 'junit:junit:4.12'
142
150
compile group : ' org.slf4j' , name : ' slf4j-api' , version : ' 1.7.+'
143
151
compile group : ' ch.qos.logback' , name : ' logback-classic' , version : ' 1.+'
144
152
// You can also use the JDK's built-in logging as the back end:
145
153
// compile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.5'
154
+
155
+ // JUnit Jupiter API and TestEngine implementation
156
+ /* testCompile("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
157
+ testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
158
+
159
+ // If you also want to support JUnit 3 and JUnit 4 tests
160
+ testCompile("junit:junit:${junit4Version}")
161
+ testRuntime("org.junit.vintage:junit-vintage-engine:${junitVintageVersion}")*/
162
+ testCompile " org.junit.jupiter:junit-jupiter-api:5.0.0-M2"
163
+ testRuntime " org.junit.jupiter:junit-jupiter-engine:5.0.0-M2"
164
+ testCompile " junit:junit:4.12"
165
+ testRuntime " org.junit.vintage:junit-vintage-engine:4.12.0-M2"
166
+ }
167
+
168
+ junitPlatform {
169
+ // platformVersion '1.0.0-SNAPSHOT'
170
+ // engines {
171
+ // include 'junit-jupiter', 'junit-vintage'
172
+ // exclude 'custom-engine'
173
+ // }
174
+ /* tags {
175
+ // include 'fast'
176
+ exclude 'slow'
177
+ }*/
178
+ // includeClassNamePattern '.*Test'
179
+ includeClassNamePattern ' .*'
180
+ // enableStandardTestTask true
181
+ // reportsDir "build/test-results/junit-platform" // this is the default
182
+ // logManager 'org.apache.logging.log4j.jul.LogManager'
146
183
}
147
184
148
185
sourceSets {
149
186
main {
150
187
java {
151
188
srcDir projectDir
189
+ exclude " *Test.java"
190
+ exclude " *Tests.java"
191
+ exclude " *JUnit.java"
192
+ exclude " StringInverter*.java"
193
+ exclude " Queue.java"
152
194
}
195
+ /* filter {
196
+ }*/
153
197
}
154
198
jmh {
155
199
java {
156
200
srcDir projectDir
157
201
}
158
202
}
203
+ test {
204
+ java {
205
+ srcDir projectDir
206
+ }
207
+ }
159
208
}
160
209
210
+ /* test {
211
+ testClassesDir = sourceSets.main.output.classesDir
212
+ classpath = sourceSets.main.runtimeClasspath
213
+ }*/
214
+
161
215
jmh {
162
216
jmhVersion = ' 1.13'
163
217
duplicateClassesStrategy = ' warn'
@@ -299,6 +353,8 @@ configure(subprojects - project(':onjava')) {
299
353
compile project(' :onjava' )
300
354
compile group : ' com.google.guava' , name : ' guava' , version : ' 19.0'
301
355
compile " org.openjdk.jmh:jmh-core:${ jmh.jmhVersion} "
356
+ compile ' org.junit.platform:junit-platform-gradle-plugin:1.0.0-M2'
357
+
302
358
// compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.6.2'
303
359
// compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.6.2'
304
360
}
@@ -311,8 +367,3 @@ task verify(type:Exec) {
311
367
println (" execute 'gradlew run' first" )
312
368
}
313
369
}
314
-
315
- /* buildScan {
316
- licenseAgreementUrl = 'https://gradle.com/terms-of-service'
317
- licenseAgree = 'yes'
318
- }*/
0 commit comments