@@ -213,21 +213,51 @@ void run_withJUnit_withFourSplits() throws Exception {
213213 }
214214
215215 @ 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 );
218223
219224 final var testSplit = new TestSplit (0 ,
220225 1 ,
221- "**/no-tests -project/**/*Test.java" ,
226+ "**/multiline-class-definition -project/**/*Test.java" ,
222227 null ,
223228 null ,
224229 projectFolder ,
225230 true ,
226231 exitCode ::set );
227232 testSplit .run ();
228233
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 ();
231261 }
232262
233263 @ Test
@@ -245,18 +275,17 @@ void run_noPackage() throws Exception {
245275 exitCode ::set );
246276 testSplit .run ();
247277
248- assertThat (systemOut .getLinesNormalized ()).isEmpty ( );
249- assertThat (exitCode ).hasValue ( 1 );
278+ assertThat (systemOut .getLines ()).singleElement (). isEqualTo ( "NoPackageTest" );
279+ assertThat (exitCode ).hasNullValue ( );
250280 }
251281
252282 @ 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" );
256285
257286 final var testSplit = new TestSplit (0 ,
258287 1 ,
259- "**/no-classname -project/**/*Test.java" ,
288+ "**/no-tests -project/**/*Test.java" ,
260289 null ,
261290 null ,
262291 projectFolder ,
@@ -269,25 +298,21 @@ void run_noClassName() throws Exception {
269298 }
270299
271300 @ 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 );
278304
279305 final var testSplit = new TestSplit (0 ,
280306 1 ,
281- "**/multiline-class-definition -project/**/*Test.java" ,
307+ "**/no-classname -project/**/*Test.java" ,
282308 null ,
283309 null ,
284310 projectFolder ,
285311 true ,
286312 exitCode ::set );
287313 testSplit .run ();
288314
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 );
292317 }
293318}
0 commit comments