@@ -213,21 +213,51 @@ void run_withJUnit_withFourSplits() throws Exception {
213
213
}
214
214
215
215
@ Test
216
- void run_noTests () throws Exception {
217
- final var projectFolder = tmp .resolve ("no-tests-project" ).resolve ("src" ).resolve ("main" ).resolve ("java" );
216
+ void run_whitespaceClassDefinition () throws Exception {
217
+ final var projectFolder =
218
+ tmp .resolve ("multiline-class-definition-project" ).resolve ("src" ).resolve ("main" ).resolve ("java" );
219
+ copyResourceToTarget (projectFolder ,
220
+ "tests/WhitespaceClassDefinitionTest.java" ,
221
+ "WhitespaceClassDefinitionTest.java" ,
222
+ PERMISSIONS );
218
223
219
224
final var testSplit = new TestSplit (0 ,
220
225
1 ,
221
- "**/no-tests -project/**/*Test.java" ,
226
+ "**/multiline-class-definition -project/**/*Test.java" ,
222
227
null ,
223
228
null ,
224
229
projectFolder ,
225
230
true ,
226
231
exitCode ::set );
227
232
testSplit .run ();
228
233
229
- assertThat (systemOut .getLinesNormalized ()).isEmpty ();
230
- assertThat (exitCode ).hasValue (1 );
234
+ assertThat (systemOut .getLines ()).singleElement ()
235
+ .isEqualTo ("de.donnerbart.example.WhitespaceClassDefinitionTest" );
236
+ assertThat (exitCode ).hasNullValue ();
237
+ }
238
+
239
+ @ Test
240
+ void run_thirdPartyLibrary () throws Exception {
241
+ final var projectFolder =
242
+ tmp .resolve ("third-party-library-project" ).resolve ("src" ).resolve ("main" ).resolve ("java" );
243
+ copyResourceToTarget (projectFolder ,
244
+ "tests/ThirdPartyLibraryTest.java" ,
245
+ "ThirdPartyLibraryTest.java" ,
246
+ PERMISSIONS );
247
+
248
+ final var testSplit = new TestSplit (0 ,
249
+ 1 ,
250
+ "**/third-party-library-project/**/*Test.java" ,
251
+ null ,
252
+ null ,
253
+ projectFolder ,
254
+ true ,
255
+ exitCode ::set );
256
+ testSplit .run ();
257
+
258
+ assertThat (systemOut .getLines ()).singleElement ()
259
+ .isEqualTo ("de.donnerbart.example.ThirdPartyLibraryTest" );
260
+ assertThat (exitCode ).hasNullValue ();
231
261
}
232
262
233
263
@ Test
@@ -245,18 +275,17 @@ void run_noPackage() throws Exception {
245
275
exitCode ::set );
246
276
testSplit .run ();
247
277
248
- assertThat (systemOut .getLinesNormalized ()).isEmpty ( );
249
- assertThat (exitCode ).hasValue ( 1 );
278
+ assertThat (systemOut .getLines ()).singleElement (). isEqualTo ( "NoPackageTest" );
279
+ assertThat (exitCode ).hasNullValue ( );
250
280
}
251
281
252
282
@ Test
253
- void run_noClassName () throws Exception {
254
- final var projectFolder = tmp .resolve ("no-classname-project" ).resolve ("src" ).resolve ("main" ).resolve ("java" );
255
- copyResourceToTarget (projectFolder , "tests/NoClassNameTest.java" , "NoClassNameTest.java" , PERMISSIONS );
283
+ void run_noTests () throws Exception {
284
+ final var projectFolder = tmp .resolve ("no-tests-project" ).resolve ("src" ).resolve ("main" ).resolve ("java" );
256
285
257
286
final var testSplit = new TestSplit (0 ,
258
287
1 ,
259
- "**/no-classname -project/**/*Test.java" ,
288
+ "**/no-tests -project/**/*Test.java" ,
260
289
null ,
261
290
null ,
262
291
projectFolder ,
@@ -269,25 +298,21 @@ void run_noClassName() throws Exception {
269
298
}
270
299
271
300
@ Test
272
- void run_whitespaceClassDefinition () throws Exception {
273
- final var projectFolder =
274
- tmp .resolve ("multiline-class-definition-project" ).resolve ("src" ).resolve ("main" ).resolve ("java" );
275
- copyResourceToTarget (projectFolder , "tests/WhitespaceClassDefinitionTest.java" ,
276
- "WhitespaceClassDefinitionTest.java" ,
277
- PERMISSIONS );
301
+ void run_noClassName () throws Exception {
302
+ final var projectFolder = tmp .resolve ("no-classname-project" ).resolve ("src" ).resolve ("main" ).resolve ("java" );
303
+ copyResourceToTarget (projectFolder , "tests/NoClassNameTest.java" , "NoClassNameTest.java" , PERMISSIONS );
278
304
279
305
final var testSplit = new TestSplit (0 ,
280
306
1 ,
281
- "**/multiline-class-definition -project/**/*Test.java" ,
307
+ "**/no-classname -project/**/*Test.java" ,
282
308
null ,
283
309
null ,
284
310
projectFolder ,
285
311
true ,
286
312
exitCode ::set );
287
313
testSplit .run ();
288
314
289
- assertThat (systemOut .getLines ()).singleElement ()
290
- .isEqualTo ("de.donnerbart.example.WhitespaceClassDefinitionTest" );
291
- assertThat (exitCode ).hasNullValue ();
315
+ assertThat (systemOut .getLinesNormalized ()).isEmpty ();
316
+ assertThat (exitCode ).hasValue (1 );
292
317
}
293
318
}
0 commit comments