Skip to content

Commit 27dc74b

Browse files
1 parent a701fb9 commit 27dc74b

11 files changed

+37
-48
lines changed

src/test/java/org/codehaus/plexus/util/DirectoryScannerTest.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void setUp() {
6767
* @throws java.net.URISyntaxException if any.
6868
*/
6969
@Test
70-
void crossPlatformIncludesString() throws IOException, URISyntaxException {
70+
void crossPlatformIncludesString() throws Exception {
7171
DirectoryScanner ds = new DirectoryScanner();
7272
ds.setBasedir(new File(getTestResourcesDir() + File.separator + "directory-scanner").getCanonicalFile());
7373

@@ -93,7 +93,7 @@ void crossPlatformIncludesString() throws IOException, URISyntaxException {
9393
* @throws java.net.URISyntaxException if any.
9494
*/
9595
@Test
96-
void crossPlatformExcludesString() throws IOException, URISyntaxException {
96+
void crossPlatformExcludesString() throws Exception {
9797
DirectoryScanner ds = new DirectoryScanner();
9898
ds.setBasedir(new File(getTestResourcesDir() + File.separator + "directory-scanner").getCanonicalFile());
9999
ds.setIncludes(new String[] {"**"});
@@ -173,7 +173,7 @@ private boolean checkTestFilesSymlinks() {
173173
* @throws java.io.IOException if any.
174174
*/
175175
@Test
176-
void general() throws IOException {
176+
void general() throws Exception {
177177
this.createTestFiles();
178178

179179
String includes = "scanner1.dat,scanner2.dat,scanner3.dat,scanner4.dat,scanner5.dat";
@@ -193,7 +193,7 @@ void general() throws IOException {
193193
* @throws java.io.IOException if any.
194194
*/
195195
@Test
196-
void includesExcludesWithWhiteSpaces() throws IOException {
196+
void includesExcludesWithWhiteSpaces() throws Exception {
197197
this.createTestFiles();
198198

199199
String includes = "scanner1.dat,\n \n,scanner2.dat \n\r, scanner3.dat\n, \tscanner4.dat,scanner5.dat\n,";
@@ -294,7 +294,7 @@ private void createTestDirectories() throws IOException {
294294
* @throws java.io.IOException if any.
295295
*/
296296
@Test
297-
void directoriesWithHyphens() throws IOException {
297+
void directoriesWithHyphens() throws Exception {
298298
this.createTestDirectories();
299299

300300
DirectoryScanner ds = new DirectoryScanner();
@@ -316,7 +316,7 @@ void directoriesWithHyphens() throws IOException {
316316
* @throws java.io.IOException if any.
317317
*/
318318
@Test
319-
void antExcludesOverrideIncludes() throws IOException {
319+
void antExcludesOverrideIncludes() throws Exception {
320320
printTestHeader();
321321

322322
File dir = new File(testDir, "regex-dir");
@@ -354,7 +354,7 @@ void antExcludesOverrideIncludes() throws IOException {
354354
* @throws java.io.IOException if any.
355355
*/
356356
@Test
357-
void antExcludesOverrideIncludesWithExplicitAntPrefix() throws IOException {
357+
void antExcludesOverrideIncludesWithExplicitAntPrefix() throws Exception {
358358
printTestHeader();
359359

360360
File dir = new File(testDir, "regex-dir");
@@ -393,7 +393,7 @@ void antExcludesOverrideIncludesWithExplicitAntPrefix() throws IOException {
393393
* @throws java.io.IOException if any.
394394
*/
395395
@Test
396-
void regexIncludeWithExcludedPrefixDirs() throws IOException {
396+
void regexIncludeWithExcludedPrefixDirs() throws Exception {
397397
printTestHeader();
398398

399399
File dir = new File(testDir, "regex-dir");
@@ -427,7 +427,7 @@ void regexIncludeWithExcludedPrefixDirs() throws IOException {
427427
* @throws java.io.IOException if any.
428428
*/
429429
@Test
430-
void regexExcludeWithNegativeLookahead() throws IOException {
430+
void regexExcludeWithNegativeLookahead() throws Exception {
431431
printTestHeader();
432432

433433
File dir = new File(testDir, "regex-dir");
@@ -466,7 +466,7 @@ void regexExcludeWithNegativeLookahead() throws IOException {
466466
* @throws java.io.IOException if any.
467467
*/
468468
@Test
469-
void regexWithSlashInsideCharacterClass() throws IOException {
469+
void regexWithSlashInsideCharacterClass() throws Exception {
470470
printTestHeader();
471471

472472
File dir = new File(testDir, "regex-dir");
@@ -507,7 +507,7 @@ void regexWithSlashInsideCharacterClass() throws IOException {
507507
* @throws java.io.IOException if occurs an I/O error.
508508
*/
509509
@Test
510-
void doNotScanUnnecesaryDirectories() throws IOException {
510+
void doNotScanUnnecesaryDirectories() throws Exception {
511511
createTestDirectories();
512512

513513
// create additional directories 'anotherDir1', 'anotherDir2' and 'anotherDir3' with a 'file1.dat' file
@@ -576,7 +576,7 @@ protected void scandir(File dir, String vpath, boolean fast) {
576576
* @throws java.io.IOException if any.
577577
*/
578578
@Test
579-
void isSymbolicLink() throws IOException {
579+
void isSymbolicLink() throws Exception {
580580
assumeTrue(checkTestFilesSymlinks());
581581

582582
final File directory = new File("src/test/resources/symlinks/src");
@@ -593,7 +593,7 @@ void isSymbolicLink() throws IOException {
593593
* @throws java.io.IOException if any.
594594
*/
595595
@Test
596-
void isParentSymbolicLink() throws IOException {
596+
void isParentSymbolicLink() throws Exception {
597597
assumeTrue(checkTestFilesSymlinks());
598598

599599
final File directory = new File("src/test/resources/symlinks/src");

src/test/java/org/codehaus/plexus/util/FileUtilsTest.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ void mkdir() {
220220
FileUtils.mkdir(winFile.getAbsolutePath());
221221
fail();
222222
} catch (IllegalArgumentException e) {
223-
assertTrue(true);
224223
}
225224
}
226225
}
@@ -358,7 +357,6 @@ void forceMkdir() throws Exception {
358357
FileUtils.forceMkdir(winFile);
359358
fail();
360359
} catch (IllegalArgumentException e) {
361-
assertTrue(true);
362360
}
363361
}
364362
}
@@ -1243,7 +1241,7 @@ void filteredWithoutFilterAndOlderFileAndOverwrite() throws Exception {
12431241
* @throws java.io.IOException if any.
12441242
*/
12451243
@Test
1246-
void fileRead() throws IOException {
1244+
void fileRead() throws Exception {
12471245
File testFile = new File(getTestDirectory(), "testFileRead.txt");
12481246
String testFileName = testFile.getAbsolutePath();
12491247
/*
@@ -1272,7 +1270,7 @@ void fileRead() throws IOException {
12721270
* @throws java.io.IOException if any.
12731271
*/
12741272
@Test
1275-
void fileReadWithEncoding() throws IOException {
1273+
void fileReadWithEncoding() throws Exception {
12761274
String encoding = "UTF-8";
12771275
File testFile = new File(getTestDirectory(), "testFileRead.txt");
12781276
String testFileName = testFile.getAbsolutePath();
@@ -1297,7 +1295,7 @@ void fileReadWithEncoding() throws IOException {
12971295
* @throws java.io.IOException if any.
12981296
*/
12991297
@Test
1300-
void fileAppend() throws IOException {
1298+
void fileAppend() throws Exception {
13011299
String baseString = "abc";
13021300
File testFile = new File(getTestDirectory(), "testFileAppend.txt");
13031301
String testFileName = testFile.getAbsolutePath();
@@ -1322,7 +1320,7 @@ void fileAppend() throws IOException {
13221320
* @throws java.io.IOException if any.
13231321
*/
13241322
@Test
1325-
void fileAppendWithEncoding() throws IOException {
1323+
void fileAppendWithEncoding() throws Exception {
13261324
String baseString = "abc";
13271325
String encoding = "UTF-8";
13281326
File testFile = new File(getTestDirectory(), "testFileAppend.txt");
@@ -1348,7 +1346,7 @@ void fileAppendWithEncoding() throws IOException {
13481346
* @throws java.io.IOException if any.
13491347
*/
13501348
@Test
1351-
void fileWrite() throws IOException {
1349+
void fileWrite() throws Exception {
13521350
File testFile = new File(getTestDirectory(), "testFileWrite.txt");
13531351
String testFileName = testFile.getAbsolutePath();
13541352
// unicode escaped Japanese hiragana, "aiueo" + Umlaut a
@@ -1364,7 +1362,7 @@ void fileWrite() throws IOException {
13641362
* @throws java.io.IOException if any.
13651363
*/
13661364
@Test
1367-
void fileWriteWithEncoding() throws IOException {
1365+
void fileWriteWithEncoding() throws Exception {
13681366
String encoding = "UTF-8";
13691367
File testFile = new File(getTestDirectory(), "testFileWrite.txt");
13701368
String testFileName = testFile.getAbsolutePath();
@@ -1422,7 +1420,7 @@ void deleteLongPathOnWindows() throws Exception {
14221420
* @throws java.io.IOException if any.
14231421
*/
14241422
@Test
1425-
void copyFileOnSameFile() throws IOException {
1423+
void copyFileOnSameFile() throws Exception {
14261424
String content = "ggrgreeeeeeeeeeeeeeeeeeeeeeeoierjgioejrgiojregioejrgufcdxivbsdibgfizgerfyaezgv!zeez";
14271425
final File theFile = File.createTempFile("test", ".txt");
14281426
theFile.deleteOnExit();

src/test/java/org/codehaus/plexus/util/LineOrientedInterpolatingReaderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class LineOrientedInterpolatingReaderTest {
4646
* @throws java.io.IOException if any.
4747
*/
4848
@Test
49-
void shouldInterpolateExpressionAtEndOfDataWithInvalidEndToken() throws IOException {
49+
void shouldInterpolateExpressionAtEndOfDataWithInvalidEndToken() throws Exception {
5050
String testStr = "This is a ${test";
5151
LineOrientedInterpolatingReader iReader = new LineOrientedInterpolatingReader(
5252
new StringReader(testStr), Collections.singletonMap("test", "TestValue"));

src/test/java/org/codehaus/plexus/util/ReflectionUtilsTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @see org.codehaus.plexus.util.ReflectionUtils
3232
* @since 3.4.0
3333
*/
34-
public final class ReflectionUtilsTest {
34+
final class ReflectionUtilsTest {
3535
private final ReflectionUtilsTestClass testClass = new ReflectionUtilsTestClass();
3636

3737
/**
@@ -40,7 +40,7 @@ public final class ReflectionUtilsTest {
4040
* @throws java.lang.IllegalAccessException if any.
4141
*/
4242
@Test
43-
void simpleVariableAccess() throws IllegalAccessException {
43+
void simpleVariableAccess() throws Exception {
4444
assertEquals("woohoo", ReflectionUtils.getValueIncludingSuperclasses("myString", testClass));
4545
}
4646

@@ -50,7 +50,7 @@ void simpleVariableAccess() throws IllegalAccessException {
5050
* @throws java.lang.IllegalAccessException if any.
5151
*/
5252
@Test
53-
void complexVariableAccess() throws IllegalAccessException {
53+
void complexVariableAccess() throws Exception {
5454
Map<String, Object> map = ReflectionUtils.getVariablesAndValuesIncludingSuperclasses(testClass);
5555

5656
Map myMap = (Map) map.get("myMap");
@@ -65,7 +65,7 @@ void complexVariableAccess() throws IllegalAccessException {
6565
* @throws java.lang.IllegalAccessException if any.
6666
*/
6767
@Test
68-
void superClassVariableAccess() throws IllegalAccessException {
68+
void superClassVariableAccess() throws Exception {
6969
assertEquals("super-duper", ReflectionUtils.getValueIncludingSuperclasses("mySuperString", testClass));
7070
}
7171

@@ -75,7 +75,7 @@ void superClassVariableAccess() throws IllegalAccessException {
7575
* @throws java.lang.IllegalAccessException if any.
7676
*/
7777
@Test
78-
void settingVariableValue() throws IllegalAccessException {
78+
void settingVariableValue() throws Exception {
7979
ReflectionUtils.setVariableValueInObject(testClass, "mySettableString", "mySetString");
8080

8181
assertEquals("mySetString", ReflectionUtils.getValueIncludingSuperclasses("mySettableString", testClass));

src/test/java/org/codehaus/plexus/util/StringUtilsTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ void unifyLineSeparators() throws Exception {
323323
StringUtils.unifyLineSeparators(s, "abs");
324324
fail("Exception NOT catched");
325325
} catch (IllegalArgumentException e) {
326-
assertTrue(true, "Exception catched");
327326
}
328327

329328
assertEquals("this\nis\na\ntest", StringUtils.unifyLineSeparators(s, "\n"));

src/test/java/org/codehaus/plexus/util/cli/CommandLineUtilsTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@
2121
import java.util.Properties;
2222

2323
import org.codehaus.plexus.util.Os;
24-
import org.junit.jupiter.api.Assertions;
2524
import org.junit.jupiter.api.Test;
2625

27-
import static org.junit.jupiter.api.Assertions.assertEquals;
28-
import static org.junit.jupiter.api.Assertions.assertNotNull;
29-
import static org.junit.jupiter.api.Assertions.fail;
26+
import static org.junit.jupiter.api.Assertions.*;
3027

3128
/**
3229
* <p>CommandLineUtilsTest class.</p>
@@ -43,7 +40,7 @@ class CommandLineUtilsTest {
4340
*/
4441
@Test
4542
void quoteArguments() {
46-
Assertions.assertDoesNotThrow(() -> {
43+
assertDoesNotThrow(() -> {
4744
String result = CommandLineUtils.quote("Hello");
4845
System.out.println(result);
4946
assertEquals("Hello", result);

src/test/java/org/codehaus/plexus/util/dag/CycleDetectorTest.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,9 @@
1818

1919
import java.util.List;
2020

21-
import org.junit.jupiter.api.Assertions;
2221
import org.junit.jupiter.api.Test;
2322

24-
import static org.junit.jupiter.api.Assertions.assertEquals;
25-
import static org.junit.jupiter.api.Assertions.assertFalse;
26-
import static org.junit.jupiter.api.Assertions.assertNotNull;
27-
import static org.junit.jupiter.api.Assertions.assertTrue;
28-
import static org.junit.jupiter.api.Assertions.fail;
23+
import static org.junit.jupiter.api.Assertions.*;
2924

3025
/**
3126
* <p>CycleDetectorTest class.</p>
@@ -45,7 +40,7 @@ void cycyleDetection() {
4540
//
4641
// a --> b --->c
4742
//
48-
Assertions.assertDoesNotThrow(
43+
assertDoesNotThrow(
4944
() -> {
5045
final DAG dag1 = new DAG();
5146

@@ -89,7 +84,7 @@ void cycyleDetection() {
8984
// a --> b
9085
// | | --> d
9186
// --------->
92-
Assertions.assertDoesNotThrow(
87+
assertDoesNotThrow(
9388
() -> {
9489
final DAG dag3 = new DAG();
9590

src/test/java/org/codehaus/plexus/util/dag/DAGTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class DAGTest {
4040
* @throws org.codehaus.plexus.util.dag.CycleDetectedException if any.
4141
*/
4242
@Test
43-
void dag() throws CycleDetectedException {
43+
void dag() throws Exception {
4444
final DAG dag = new DAG();
4545

4646
dag.addVertex("a");
@@ -146,7 +146,7 @@ void dag() throws CycleDetectedException {
146146
* @throws org.codehaus.plexus.util.dag.CycleDetectedException if any.
147147
*/
148148
@Test
149-
void getPredecessors() throws CycleDetectedException {
149+
void getPredecessors() throws Exception {
150150
final DAG dag = new DAG();
151151

152152
dag.addEdge("a", "b");

src/test/java/org/codehaus/plexus/util/dag/TopologicalSorterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class TopologicalSorterTest {
3737
* @throws org.codehaus.plexus.util.dag.CycleDetectedException if any.
3838
*/
3939
@Test
40-
void dfs() throws CycleDetectedException {
40+
void dfs() throws Exception {
4141
// a --> b --->c
4242
//
4343
// result a,b,c

src/test/java/org/codehaus/plexus/util/io/CachingOutputStreamTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private void waitLastModified() throws IOException, InterruptedException {
6060
}
6161

6262
@Test
63-
void writeNoExistingFile() throws IOException, InterruptedException {
63+
void writeNoExistingFile() throws Exception {
6464
byte[] data = "Hello world!".getBytes(StandardCharsets.UTF_8);
6565
Path path = tempDir.resolve("file.txt");
6666
assertFalse(Files.exists(path));

0 commit comments

Comments
 (0)