@@ -214,22 +214,26 @@ class MavenConfigGenerationTest extends BaseConfigSuite {
214214 case (configFile, projectName, List (module1, module2)) =>
215215 // module1 is "module1"
216216 // module2 is "module1-test"
217-
217+
218218 // module1's test configuration should be renamed to avoid conflict with module2
219219 // Default would be "module1-test", but "module1-test" exists as a reactor artifact (module2)
220220 // So it should be "module1-test-scope"
221221 assertEquals(" module1" , module1.project.name)
222-
222+
223223 // We need to check the test configuration name for module1.
224224 // check() function loads the "compile" configuration (default expectation in this test suite assumption?)
225225 // Actually check() loads the config based on the project file name.
226226 // module1 comes from "conflicting_modules/module1/pom.xml" -> parent dir is "module1".
227227 // The bloop file loaded is "module1.json".
228-
228+
229229 // Let's check the test config of module1
230- val module1TestConfigPath = configFile.project.directory.resolve(" .bloop" ).resolve(" module1-test-scope.json" )
231- assertTrue(s " Test config for module1 should be renamed to module1-test-scope.json " , Files .exists(module1TestConfigPath))
232-
230+ val module1TestConfigPath =
231+ configFile.project.directory.resolve(" .bloop" ).resolve(" module1-test-scope.json" )
232+ assertTrue(
233+ s " Test config for module1 should be renamed to module1-test-scope.json " ,
234+ Files .exists(module1TestConfigPath)
235+ )
236+
233237 val module1TestConfig = readValidBloopConfig(module1TestConfigPath.toFile())
234238 assertEquals(" module1-test-scope" , module1TestConfig.project.name)
235239
@@ -310,48 +314,62 @@ class MavenConfigGenerationTest extends BaseConfigSuite {
310314 case List (m1, m2) => (m1, m2)
311315 case _ => fail(s " Expected 2 submodules, but got ${submodulesList.size}" )
312316 }
313-
317+
314318 // Standard naming should be preserved when no collision exists
315319 assert(! configFile.project.name.contains(" -compile" ))
316320 assert(! module1.project.name.contains(" -compile" ))
317321 assert(! module2.project.name.contains(" -compile" ))
318-
319- // Note: To test actual collision, we would need to construct a project structure
320- // where a submodule name conflicts with the test suffix of another module.
321- // For now, we verify that the default behavior is correct (no suffixes).
322+
323+ // Note: To test actual collision, we would need to construct a project structure
324+ // where a submodule name conflicts with the test suffix of another module.
325+ // For now, we verify that the default behavior is correct (no suffixes).
322326 }
323327 }
324328
325329 @ Test
326330 def junitSupport () = {
327331 check(" junit_project/pom.xml" ) { (configFile, projectName, subprojects) =>
328332 assert(subprojects.isEmpty)
329-
333+
330334 // Read the test configuration file
331- val testConfigFile = readValidBloopConfig(configFile.project.directory.resolve(" .bloop" ).resolve(s " $projectName-test.json " ).toFile())
332-
335+ val testConfigFile = readValidBloopConfig(
336+ configFile.project.directory.resolve(" .bloop" ).resolve(s " $projectName-test.json " ).toFile()
337+ )
338+
333339 // Check if junit-interface is present in the resolution modules of the test config
334340 val resolutionModules = testConfigFile.project.resolution.get.modules
335341 val hasJunitInterface = resolutionModules.exists(_.name.contains(" junit-interface" ))
336-
337- assertTrue(" junit-interface should be present in test config when junit is used" , hasJunitInterface)
338-
342+
343+ assertTrue(
344+ " junit-interface should be present in test config when junit is used" ,
345+ hasJunitInterface
346+ )
347+
339348 // Also check classpath
340- val hasJunitInterfaceInClasspath = testConfigFile.project.classpath.exists(_.toString.contains(" junit-interface" ))
341- assertTrue(" junit-interface should be present in test classpath when junit is used" , hasJunitInterfaceInClasspath)
349+ val hasJunitInterfaceInClasspath =
350+ testConfigFile.project.classpath.exists(_.toString.contains(" junit-interface" ))
351+ assertTrue(
352+ " junit-interface should be present in test classpath when junit is used" ,
353+ hasJunitInterfaceInClasspath
354+ )
342355 }
343356 }
344357
345- private def check (testProject : String , submodules : List [String ] = Nil , extraContent : Map [String , String ] = Map .empty)(
358+ private def check (
359+ testProject : String ,
360+ submodules : List [String ] = Nil ,
361+ extraContent : Map [String , String ] = Map .empty
362+ )(
346363 checking : (Config .File , String , List [Config .File ]) => Unit
347364 ): Unit = {
348365 println(s " Checking $testProject" )
349366 val tempDir = Files .createTempDirectory(" mavenBloop" )
350367 val outFile = copyFromResource(tempDir, testProject)
351- extraContent.foreach { case (relativePath, content) =>
352- val p = tempDir.resolve(relativePath)
353- Files .createDirectories(p.getParent)
354- Files .write(p, content.getBytes(" UTF-8" ))
368+ extraContent.foreach {
369+ case (relativePath, content) =>
370+ val p = tempDir.resolve(relativePath)
371+ Files .createDirectories(p.getParent)
372+ Files .write(p, content.getBytes(" UTF-8" ))
355373 }
356374 submodules.foreach(copyFromResource(tempDir, _))
357375 val wrapperJar = copyFromResource(tempDir, s " maven-wrapper.jar " )
@@ -443,8 +461,6 @@ class MavenConfigGenerationTest extends BaseConfigSuite {
443461 }
444462 }
445463
446-
447-
448464 @ Test
449465 def withIncludes () = {
450466 check(
@@ -456,17 +472,20 @@ class MavenConfigGenerationTest extends BaseConfigSuite {
456472 ) { (configFile, projectName, subprojects) =>
457473 assert(subprojects.isEmpty)
458474 val resources = configFile.project.resources.getOrElse(Nil )
459-
475+
460476 val included = resources.find(_.toString.endsWith(" included.txt" ))
461477 val excluded = resources.find(_.toString.endsWith(" excluded.txt" ))
462-
478+
463479 assert(included.isDefined, " included.txt should be in resources" )
464480 assert(excluded.isEmpty, " excluded.txt should NOT be in resources" )
465481
466482 // Ensure the directory itself is not added when we have explicit includes
467483 val resourceDir = configFile.project.directory.resolve(" src/main/resources" ).toAbsolutePath
468484 val hasResourceDir = resources.exists(_.toAbsolutePath == resourceDir)
469- assert(! hasResourceDir, s " Resource directory $resourceDir should NOT be in resources when includes are specified " )
485+ assert(
486+ ! hasResourceDir,
487+ s " Resource directory $resourceDir should NOT be in resources when includes are specified "
488+ )
470489 }
471490 }
472491
@@ -488,7 +507,10 @@ class MavenConfigGenerationTest extends BaseConfigSuite {
488507
489508 val baseDirectory = configFile.project.directory.toAbsolutePath
490509 val hasBaseDir = resources.exists(_.toAbsolutePath == baseDirectory)
491- assert(! hasBaseDir, s " Base directory $baseDirectory should NOT be in resources when includes are specified " )
510+ assert(
511+ ! hasBaseDir,
512+ s " Base directory $baseDirectory should NOT be in resources when includes are specified "
513+ )
492514 }
493515 }
494516
@@ -506,7 +528,7 @@ class MavenConfigGenerationTest extends BaseConfigSuite {
506528 val resourceDir = configFile.project.directory.resolve(" src/main/resources" ).toAbsolutePath
507529 val hasResourceDir = resources.exists(_.toAbsolutePath == resourceDir)
508530 assert(hasResourceDir, s " Resource directory $resourceDir SHOULD be in resources " )
509-
531+
510532 // Individual files should NOT be listed
511533 val hasFile = resources.exists(_.toString.endsWith(" hello.txt" ))
512534 assert(! hasFile, " Individual files inside resource dir should NOT be in resources list" )
0 commit comments