Skip to content

Commit dcf1091

Browse files
committed
remove redundant modifiers
also fix some docs/messages
1 parent 9b8f372 commit dcf1091

File tree

1 file changed

+44
-46
lines changed

1 file changed

+44
-46
lines changed

opengrok-indexer/src/test/java/org/opengrok/indexer/configuration/RuntimeEnvironmentTest.java

Lines changed: 44 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void setUp() {
8686
}
8787

8888
@Test
89-
public void testDataRoot() throws IOException {
89+
void testDataRoot() throws IOException {
9090
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
9191
assertNull(instance.getDataRootFile());
9292
assertNull(instance.getDataRootPath());
@@ -104,7 +104,7 @@ public void testDataRoot() throws IOException {
104104
}
105105

106106
@Test
107-
public void testIncludeRoot() throws IOException {
107+
void testIncludeRoot() throws IOException {
108108
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
109109
assertNull(instance.getIncludeRootPath());
110110

@@ -124,7 +124,7 @@ public void testIncludeRoot() throws IOException {
124124
}
125125

126126
@Test
127-
public void testSourceRoot() throws IOException {
127+
void testSourceRoot() throws IOException {
128128
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
129129
assertNull(instance.getSourceRootFile());
130130
assertNull(instance.getSourceRootPath());
@@ -137,7 +137,7 @@ public void testSourceRoot() throws IOException {
137137
}
138138

139139
@Test
140-
public void testProjects() throws IOException {
140+
void testProjects() throws IOException {
141141
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
142142
instance.setProjectsEnabled(true);
143143
assertFalse(instance.hasProjects());
@@ -158,7 +158,7 @@ public void testProjects() throws IOException {
158158
}
159159

160160
@Test
161-
public void testGroups() {
161+
void testGroups() {
162162
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
163163
assertFalse(instance.hasGroups());
164164
assertNotNull(instance.getGroups());
@@ -176,7 +176,7 @@ public void testGroups() {
176176
}
177177

178178
@Test
179-
public void testPerThreadConsistency() throws InterruptedException {
179+
void testPerThreadConsistency() throws InterruptedException {
180180
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
181181
String path = "/tmp/dataroot1";
182182
instance.setDataRoot(path);
@@ -191,13 +191,13 @@ public void testPerThreadConsistency() throws InterruptedException {
191191
}
192192

193193
@Test
194-
public void testUrlPrefix() {
194+
void testUrlPrefix() {
195195
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
196196
assertEquals("/source/s?", instance.getUrlPrefix());
197197
}
198198

199199
@Test
200-
public void testCtags() {
200+
void testCtags() {
201201
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
202202
String instanceCtags = instance.getCtags();
203203
assertNotNull(instanceCtags);
@@ -216,47 +216,47 @@ public void testCtags() {
216216
}
217217

218218
@Test
219-
public void testFetchHistoryWhenNotInCache() {
219+
void testFetchHistoryWhenNotInCache() {
220220
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
221221
assertTrue(instance.isFetchHistoryWhenNotInCache());
222222
instance.setFetchHistoryWhenNotInCache(false);
223223
assertFalse(instance.isFetchHistoryWhenNotInCache());
224224
}
225225

226226
@Test
227-
public void testUseHistoryCache() {
227+
void testUseHistoryCache() {
228228
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
229229
assertTrue(instance.useHistoryCache());
230230
instance.setUseHistoryCache(false);
231231
assertFalse(instance.useHistoryCache());
232232
}
233233

234234
@Test
235-
public void testGenerateHtml() {
235+
void testGenerateHtml() {
236236
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
237237
assertTrue(instance.isGenerateHtml());
238238
instance.setGenerateHtml(false);
239239
assertFalse(instance.isGenerateHtml());
240240
}
241241

242242
@Test
243-
public void testCompressXref() {
243+
void testCompressXref() {
244244
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
245245
assertTrue(instance.isCompressXref());
246246
instance.setCompressXref(false);
247247
assertFalse(instance.isCompressXref());
248248
}
249249

250250
@Test
251-
public void testQuickContextScan() {
251+
void testQuickContextScan() {
252252
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
253253
assertTrue(instance.isQuickContextScan());
254254
instance.setQuickContextScan(false);
255255
assertFalse(instance.isQuickContextScan());
256256
}
257257

258258
@Test
259-
public void testRepositories() {
259+
void testRepositories() {
260260
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
261261
assertNotNull(instance.getRepositories());
262262
instance.removeRepositories();
@@ -267,31 +267,31 @@ public void testRepositories() {
267267
}
268268

269269
@Test
270-
public void testRamBufferSize() {
270+
void testRamBufferSize() {
271271
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
272272
assertEquals(16, instance.getRamBufferSize(), 0); //default is 16
273273
instance.setRamBufferSize(256);
274274
assertEquals(256, instance.getRamBufferSize(), 0);
275275
}
276276

277277
@Test
278-
public void testAllowLeadingWildcard() {
278+
void testAllowLeadingWildcard() {
279279
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
280280
assertTrue(instance.isAllowLeadingWildcard());
281281
instance.setAllowLeadingWildcard(false);
282282
assertFalse(instance.isAllowLeadingWildcard());
283283
}
284284

285285
@Test
286-
public void testIgnoredNames() {
286+
void testIgnoredNames() {
287287
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
288288
assertNotNull(instance.getIgnoredNames());
289289
instance.setIgnoredNames(null);
290290
assertNull(instance.getIgnoredNames());
291291
}
292292

293293
@Test
294-
public void testUserPage() {
294+
void testUserPage() {
295295
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
296296
String page = "http://www.myserver.org/viewProfile.jspa?username=";
297297
assertNull(instance.getUserPage()); // default value is null
@@ -300,7 +300,7 @@ public void testUserPage() {
300300
}
301301

302302
@Test
303-
public void testBugPage() {
303+
void testBugPage() {
304304
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
305305
String page = "http://bugs.myserver.org/bugdatabase/view_bug.do?bug_id=";
306306
assertNull(instance.getBugPage()); // default value is null
@@ -309,7 +309,7 @@ public void testBugPage() {
309309
}
310310

311311
@Test
312-
public void testBugPattern() {
312+
void testBugPattern() {
313313
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
314314
String[] tests = new String[]{
315315
"\\b([12456789][0-9]{6})\\b",
@@ -324,7 +324,7 @@ public void testBugPattern() {
324324
}
325325

326326
@Test
327-
public void testInvalidBugPattern() {
327+
void testInvalidBugPattern() {
328328
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
329329
String[] tests = new String[]{
330330
"\\b([",
@@ -341,7 +341,7 @@ public void testInvalidBugPattern() {
341341
}
342342

343343
@Test
344-
public void testReviewPage() {
344+
void testReviewPage() {
345345
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
346346
String page = "http://arc.myserver.org/caselog/PSARC/";
347347
assertNull(instance.getReviewPage()); // default value is null
@@ -350,7 +350,7 @@ public void testReviewPage() {
350350
}
351351

352352
@Test
353-
public void testReviewPattern() {
353+
void testReviewPattern() {
354354
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
355355
String[] tests = new String[]{
356356
"\\b(\\d{4}/\\d{3})\\b",
@@ -365,7 +365,7 @@ public void testReviewPattern() {
365365
}
366366

367367
@Test
368-
public void testInvalidReviewPattern() {
368+
void testInvalidReviewPattern() {
369369
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
370370
String[] tests = new String[]{
371371
"\\b([",
@@ -382,15 +382,15 @@ public void testInvalidReviewPattern() {
382382
}
383383

384384
@Test
385-
public void testWebappLAF() {
385+
void testWebappLAF() {
386386
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
387387
assertEquals("default", instance.getWebappLAF());
388388
instance.setWebappLAF("foo");
389389
assertEquals("foo", instance.getWebappLAF());
390390
}
391391

392392
@Test
393-
public void testRemoteScmSupported() {
393+
void testRemoteScmSupported() {
394394
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
395395
assertEquals(Configuration.RemoteSCM.OFF, instance.getRemoteScmSupported());
396396
instance.setRemoteScmSupported(Configuration.RemoteSCM.ON);
@@ -402,29 +402,29 @@ public void testRemoteScmSupported() {
402402
}
403403

404404
@Test
405-
public void testOptimizeDatabase() {
405+
void testOptimizeDatabase() {
406406
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
407407
assertTrue(instance.isOptimizeDatabase());
408408
instance.setOptimizeDatabase(false);
409409
assertFalse(instance.isOptimizeDatabase());
410410
}
411411

412412
@Test
413-
public void testUsingLuceneLocking() {
413+
void testUsingLuceneLocking() {
414414
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
415415
assertEquals(LuceneLockName.OFF, instance.getLuceneLocking());
416416
}
417417

418418
@Test
419-
public void testIndexVersionedFilesOnly() {
419+
void testIndexVersionedFilesOnly() {
420420
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
421421
assertFalse(instance.isIndexVersionedFilesOnly());
422422
instance.setIndexVersionedFilesOnly(true);
423423
assertTrue(instance.isIndexVersionedFilesOnly());
424424
}
425425

426426
@Test
427-
public void testXMLencdec() throws IOException {
427+
void testXMLencdec() throws IOException {
428428
Configuration c = new Configuration();
429429
String m = c.getXMLRepresentationAsString();
430430
Configuration o = Configuration.makeXMLStringAsConfiguration(m);
@@ -435,7 +435,7 @@ public void testXMLencdec() throws IOException {
435435
}
436436

437437
@Test
438-
public void testAuthorizationFlagDecode() throws IOException {
438+
void testAuthorizationFlagDecode() throws IOException {
439439
String confString = "<?xml version='1.0' encoding='UTF-8'?>\n"
440440
+ "<java class=\"java.beans.XMLDecoder\" version=\"1.8.0_121\">\n"
441441
+ " <object class=\"org.opengrok.indexer.configuration.Configuration\">\n"
@@ -498,7 +498,7 @@ public void testAuthorizationFlagDecode() throws IOException {
498498
}
499499

500500
@Test
501-
public void testAuthorizationStackDecode() throws IOException {
501+
void testAuthorizationStackDecode() throws IOException {
502502
String confString = "<?xml version='1.0' encoding='UTF-8'?>\n"
503503
+ "<java class=\"java.beans.XMLDecoder\" version=\"1.8.0_121\">\n"
504504
+ " <object class=\"org.opengrok.indexer.configuration.Configuration\">\n"
@@ -625,7 +625,7 @@ public void testAuthorizationStackDecode() throws IOException {
625625
assertTrue(pluginConfiguration.getStack().get(2).getFlag().isRequisite());
626626
assertEquals("Requisite", pluginConfiguration.getStack().get(2).getName());
627627

628-
/**
628+
/*
629629
* Third element is a stack which defines two nested plugins.
630630
*/
631631
assertTrue(pluginConfiguration.getStack().get(1) instanceof AuthorizationStack);
@@ -647,7 +647,7 @@ public void testAuthorizationStackDecode() throws IOException {
647647
assertTrue(plugin.getSetup().get("plugin") instanceof AuthorizationPlugin);
648648
assertEquals(pluginConfiguration.getStack().get(0), plugin.getSetup().get("plugin"));
649649

650-
/**
650+
/*
651651
* Fourth element is a stack slightly changed from the previous stack.
652652
* Only the setup for the particular plugin is changed.
653653
*/
@@ -670,7 +670,7 @@ public void testAuthorizationStackDecode() throws IOException {
670670
assertTrue(plugin.getSetup().get("plugin") instanceof AuthorizationPlugin);
671671
assertEquals(pluginConfiguration.getStack().get(0), plugin.getSetup().get("plugin"));
672672

673-
/**
673+
/*
674674
* Fifth element is a direct copy of the first stack.
675675
*/
676676
assertTrue(pluginConfiguration.getStack().get(4) instanceof AuthorizationStack);
@@ -699,7 +699,7 @@ public void testAuthorizationStackDecode() throws IOException {
699699
* @throws IOException I/O exception
700700
*/
701701
@Test
702-
public void testAuthorizationFlagDecodeInvalid() throws IOException {
702+
void testAuthorizationFlagDecodeInvalid() throws IOException {
703703
String confString = "<?xml version='1.0' encoding='UTF-8'?>\n"
704704
+ "<java class=\"java.beans.XMLDecoder\" version=\"1.8.0_121\">\n"
705705
+ " <object class=\"org.opengrok.indexer.configuration.Configuration\">\n"
@@ -722,8 +722,6 @@ public void testAuthorizationFlagDecodeInvalid() throws IOException {
722722

723723
/**
724724
* Testing invalid class names for authorization checks.
725-
*
726-
* @throws IOException I/O exception
727725
*/
728726
@Test
729727
void testAuthorizationDecodeInvalid() {
@@ -748,7 +746,7 @@ void testAuthorizationDecodeInvalid() {
748746
}
749747

750748
@Test
751-
public void testBug3095() throws IOException {
749+
void testBug3095() throws IOException {
752750
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
753751
File file = new File("foobar");
754752
assertTrue(file.createNewFile());
@@ -762,7 +760,7 @@ public void testBug3095() throws IOException {
762760
}
763761

764762
@Test
765-
public void testBug3154() throws IOException {
763+
void testBug3154() throws IOException {
766764
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
767765
File file = File.createTempFile("dataroot", null);
768766
assertTrue(file.delete());
@@ -775,7 +773,7 @@ public void testBug3154() throws IOException {
775773
}
776774

777775
@Test
778-
public void testObfuscateEMail() throws IOException {
776+
void testObfuscateEMail() throws IOException {
779777
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
780778

781779
// By default, don't obfuscate.
@@ -809,7 +807,7 @@ private void assertObfuscated(boolean expected, RuntimeEnvironment env)
809807
}
810808

811809
@Test
812-
public void isChattyStatusPage() {
810+
void isChattyStatusPage() {
813811
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
814812

815813
// By default, status page should not be chatty.
@@ -829,8 +827,8 @@ public void isChattyStatusPage() {
829827
* @throws ForbiddenSymlinkException forbidden symlink exception
830828
*/
831829
@Test
832-
public void testGetPathRelativeToSourceRoot() throws IOException,
833-
ForbiddenSymlinkException {
830+
void testGetPathRelativeToSourceRoot() throws IOException, ForbiddenSymlinkException {
831+
834832
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
835833

836834
// Create and set source root.
@@ -861,7 +859,7 @@ public void testGetPathRelativeToSourceRoot() throws IOException,
861859
expex = e;
862860
}
863861
assertNotNull(expex, "getPathRelativeToSourceRoot() should have thrown " +
864-
"IOexception for symlink that is not allowed");
862+
"IOException for symlink that is not allowed");
865863

866864
// Allow the symlink and retest.
867865
env.setAllowedSymlinks(new HashSet<>(Arrays.asList(symlink.getPath())));
@@ -874,7 +872,7 @@ public void testGetPathRelativeToSourceRoot() throws IOException,
874872
}
875873

876874
@Test
877-
public void testPopulateGroupsMultipleTimes() {
875+
void testPopulateGroupsMultipleTimes() {
878876
// create a structure with two repositories
879877
final RuntimeEnvironment env = RuntimeEnvironment.getInstance();
880878
Project project1 = new Project("bar", "/bar");

0 commit comments

Comments
 (0)