JUnit Jupiter best practices (#214) · codehaus-plexus/plexus-languages@17a9fee (original) (raw)

`@@ -57,7 +57,7 @@ ModuleInfoParser getBinaryModuleInfoParser(Path jdkHome) {

`

57

57

` }

`

58

58

``

59

59

`@Test

`

60

``

`-

void testNoPaths() throws Exception {

`

``

60

`+

void noPaths() throws Exception {

`

61

61

`ResolvePathsResult result =

`

62

62

`locationManager.resolvePaths(ResolvePathsRequest.ofFiles(Collections.emptyList()));

`

63

63

`assertThat(result.getMainModuleDescriptor()).isNull();

`

`@@ -68,7 +68,7 @@ void testNoPaths() throws Exception {

`

68

68

` }

`

69

69

``

70

70

`@Test

`

71

``

`-

void testWithUnknownRequires() throws Exception {

`

``

71

`+

void withUnknownRequires() throws Exception {

`

72

72

`JavaModuleDescriptor descriptor = JavaModuleDescriptor.newModule("base")

`

73

73

` .requires("java.base")

`

74

74

` .requires("jdk.net")

`

`@@ -87,7 +87,7 @@ void testWithUnknownRequires() throws Exception {

`

87

87

` }

`

88

88

``

89

89

`@Test

`

90

``

`-

void testManifestWithReflectRequires() throws Exception {

`

``

90

`+

void manifestWithReflectRequires() throws Exception {

`

91

91

`Path abc = Paths.get("src/test/test-data/dir.manifest.with/out");

`

92

92

`JavaModuleDescriptor descriptor = JavaModuleDescriptor.newModule("base")

`

93

93

` .requires("auto.by.manifest")

`

`@@ -107,7 +107,7 @@ void testManifestWithReflectRequires() throws Exception {

`

107

107

` }

`

108

108

``

109

109

`@Test

`

110

``

`-

void testDirDescriptorWithReflectRequires() throws Exception {

`

``

110

`+

void dirDescriptorWithReflectRequires() throws Exception {

`

111

111

`Path abc = Paths.get("src/test/test-data/dir.descriptor/out");

`

112

112

`JavaModuleDescriptor descriptor = JavaModuleDescriptor.newModule("base")

`

113

113

` .requires("dir.descriptor")

`

`@@ -130,7 +130,7 @@ void testDirDescriptorWithReflectRequires() throws Exception {

`

130

130

` }

`

131

131

``

132

132

`@Test

`

133

``

`-

void testJarWithAsmRequires() throws Exception {

`

``

133

`+

void jarWithAsmRequires() throws Exception {

`

134

134

`Path abc = Paths.get("src/test/test-data/jar.descriptor/asm-6.0_BETA.jar");

`

135

135

`JavaModuleDescriptor descriptor = JavaModuleDescriptor.newModule("base")

`

136

136

` .requires("org.objectweb.asm")

`

`@@ -152,7 +152,7 @@ void testJarWithAsmRequires() throws Exception {

`

152

152

` }

`

153

153

``

154

154

`@Test

`

155

``

`-

void testIdenticalModuleNames() throws Exception {

`

``

155

`+

void identicalModuleNames() throws Exception {

`

156

156

`Path pj1 = Paths.get("src/test/test-data/jar.empty/plexus-java-1.0.0-SNAPSHOT.jar");

`

157

157

`Path pj2 = Paths.get("src/test/test-data/jar.empty.2/plexus-java-2.0.0-SNAPSHOT.jar");

`

158

158

`JavaModuleDescriptor descriptor =

`

`@@ -182,7 +182,7 @@ void testIdenticalModuleNames() throws Exception {

`

182

182

` }

`

183

183

``

184

184

`@Test

`

185

``

`-

public void testIdenticalAutomaticModuleNames() throws Exception {

`

``

185

`+

void identicalAutomaticModuleNames() throws Exception {

`

186

186

`Path pj1 = Paths.get("src/test/test-data/jar.empty/plexus-java-1.0.0-SNAPSHOT.jar");

`

187

187

`Path pj2 = Paths.get("src/test/test-data/jar.empty.2/plexus-java-2.0.0-SNAPSHOT.jar");

`

188

188

`JavaModuleDescriptor descriptor =

`

`@@ -212,7 +212,7 @@ public void testIdenticalAutomaticModuleNames() throws Exception {

`

212

212

` }

`

213

213

``

214

214

`@Test

`

215

``

`-

public void testMainJarModuleAndTestJarAutomatic() throws Exception {

`

``

215

`+

void mainJarModuleAndTestJarAutomatic() throws Exception {

`

216

216

`Path pj1 = Paths.get("src/test/test-data/jar.tests/plexus-java-1.0.0-SNAPSHOT.jar");

`

217

217

`Path pj2 = Paths.get("src/test/test-data/jar.tests/plexus-java-1.0.0-SNAPSHOT-tests.jar");

`

218

218

`JavaModuleDescriptor descriptor =

`

`@@ -242,7 +242,7 @@ public void testMainJarModuleAndTestJarAutomatic() throws Exception {

`

242

242

` }

`

243

243

``

244

244

`@Test

`

245

``

`-

void testNonJar() throws Exception {

`

``

245

`+

void nonJar() throws Exception {

`

246

246

`Path p = Paths.get("src/test/test-data/nonjar/pom.xml");

`

247

247

``

248

248

`ResolvePathsRequest request =

`

`@@ -254,7 +254,7 @@ void testNonJar() throws Exception {

`

254

254

` }

`

255

255

``

256

256

`@Test

`

257

``

`-

void testAdditionalModules() throws Exception {

`

``

257

`+

void additionalModules() throws Exception {

`

258

258

`Path p = Paths.get("src/test/test-data/mock/jar0.jar");

`

259

259

``

260

260

`JavaModuleDescriptor descriptor = JavaModuleDescriptor.newModule("base").build();

`

`@@ -276,7 +276,7 @@ void testAdditionalModules() throws Exception {

`

276

276

` }

`

277

277

``

278

278

`@Test

`

279

``

`-

void testResolvePath() throws Exception {

`

``

279

`+

void resolvePath() throws Exception {

`

280

280

`Path abc = Paths.get("src/test/test-data/mock/jar0.jar");

`

281

281

`ResolvePathRequest request = ResolvePathRequest.ofPath(abc);

`

282

282

``

`@@ -291,7 +291,7 @@ void testResolvePath() throws Exception {

`

291

291

` }

`

292

292

``

293

293

`@Test

`

294

``

`-

void testNoMatchingProviders() throws Exception {

`

``

294

`+

void noMatchingProviders() throws Exception {

`

295

295

`Path abc = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java

`

296

296

`Path def = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file

`

297

297

`ResolvePathsRequest request =

`

`@@ -312,7 +312,7 @@ void testNoMatchingProviders() throws Exception {

`

312

312

` }

`

313

313

``

314

314

`@Test

`

315

``

`-

void testMainModuleDescriptorWithProviders() throws Exception {

`

``

315

`+

void mainModuleDescriptorWithProviders() throws Exception {

`

316

316

`Path abc = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java

`

317

317

`Path def = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file

`

318

318

`ResolvePathsRequest request =

`

`@@ -333,7 +333,7 @@ void testMainModuleDescriptorWithProviders() throws Exception {

`

333

333

` }

`

334

334

``

335

335

`@Test

`

336

``

`-

void testMainModuleDescriptorWithProvidersDontIncludeProviders() throws Exception {

`

``

336

`+

void mainModuleDescriptorWithProvidersDontIncludeProviders() throws Exception {

`

337

337

`Path abc = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java

`

338

338

`Path def = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file

`

339

339

`ResolvePathsRequest request = ResolvePathsRequest.ofPaths(def).setMainModuleDescriptor(abc);

`

`@@ -353,7 +353,7 @@ void testMainModuleDescriptorWithProvidersDontIncludeProviders() throws Exceptio

`

353

353

` }

`

354

354

``

355

355

`@Test

`

356

``

`-

void testTransitiveProviders() throws Exception {

`

``

356

`+

void transitiveProviders() throws Exception {

`

357

357

`Path abc = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java

`

358

358

`Path def = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file

`

359

359

`Path ghi = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file

`

`@@ -379,7 +379,7 @@ void testTransitiveProviders() throws Exception {

`

379

379

` }

`

380

380

``

381

381

`@Test

`

382

``

`-

void testDontIncludeProviders() throws Exception {

`

``

382

`+

void dontIncludeProviders() throws Exception {

`

383

383

`Path abc = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java

`

384

384

`Path def = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file

`

385

385

`Path ghi = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file

`

`@@ -404,7 +404,7 @@ void testDontIncludeProviders() throws Exception {

`

404

404

` }

`

405

405

``

406

406

`@Test

`

407

``

`-

void testAllowAdditionalModulesWithoutMainDescriptor() throws Exception {

`

``

407

`+

void allowAdditionalModulesWithoutMainDescriptor() throws Exception {

`

408

408

`Path def = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file

`

409

409

`Path ghi = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file

`

410

410

`ResolvePathsRequest request =

`

`@@ -423,7 +423,7 @@ void testAllowAdditionalModulesWithoutMainDescriptor() throws Exception {

`

423

423

` }

`

424

424

``

425

425

`@Test

`

426

``

`-

void testReuseModuleDescriptor() throws Exception {

`

``

426

`+

void reuseModuleDescriptor() throws Exception {

`

427

427

`Path def = Paths.get("src/test/test-data/mock/jar0.jar");

`

428

428

``

429

429

`ResolvePathRequest request1 = ResolvePathRequest.ofPath(def);

`

`@@ -441,7 +441,7 @@ void testReuseModuleDescriptor() throws Exception {

`

441

441

` }

`

442

442

``

443

443

`@Test

`

444

``

`-

void testParseModuleDescriptor() throws Exception {

`

``

444

`+

void parseModuleDescriptor() throws Exception {

`

445

445

`Path descriptorPath = Paths.get("src/test/test-data/src.dir/module-info.java");

`

446

446

`when(qdoxParser.fromSourcePath(descriptorPath))

`

447

447

` .thenReturn(JavaModuleDescriptor.newModule("a.b.c").build());

`

`@@ -460,7 +460,7 @@ void testParseModuleDescriptor() throws Exception {

`

460

460

` }

`

461

461

``

462

462

`@Test

`

463

``

`-

void testTransitiveStatic() throws Exception {

`

``

463

`+

void transitiveStatic() throws Exception {

`

464

464

`Path moduleA = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java

`

465

465

`Path moduleB = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file

`

466

466

`Path moduleC = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file

`

`@@ -486,7 +486,7 @@ void testTransitiveStatic() throws Exception {

`

486

486

` }

`

487

487

``

488

488

`@Test

`

489

``

`-

void testDirectStatic() throws Exception {

`

``

489

`+

void directStatic() throws Exception {

`

490

490

`Path moduleA = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java

`

491

491

`Path moduleB = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file

`

492

492

`Path moduleC = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file

`

`@@ -517,7 +517,7 @@ void testDirectStatic() throws Exception {

`

517

517

` }

`

518

518

``

519

519

`@Test

`

520

``

`-

void testDuplicateModule() throws Exception {

`

``

520

`+

void duplicateModule() throws Exception {

`

521

521

`Path moduleA = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java

`

522

522

`Path moduleB = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file

`

523

523

`Path moduleC = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file

`

`@@ -547,7 +547,7 @@ void testDuplicateModule() throws Exception {

`

547

547

` }

`

548

548

``

549

549

`@Test

`

550

``

`-

void testStaticTransitive() throws Exception {

`

``

550

`+

void staticTransitive() throws Exception {

`

551

551

`Path moduleA = Paths.get("src/test/test-data/mock/module-info.java"); // some file called module-info.java

`

552

552

`Path moduleB = Paths.get("src/test/test-data/mock/jar0.jar"); // any existing file

`

553

553

`Path moduleC = Paths.get("src/test/test-data/mock/jar1.jar"); // any existing file

`