Skip to content

Commit c89376d

Browse files
Remove public scope identifier from junit classes and method (#4444)
--------- Signed-off-by: Gino Augustine <[email protected]>
1 parent 9fc0a4b commit c89376d

File tree

245 files changed

+1076
-1101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+1076
-1101
lines changed

opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/AnalyzerGuruHelpTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
/**
3131
* Represents a container for tests of {@link AnalyzerGuruHelp}.
3232
*/
33-
public class AnalyzerGuruHelpTest {
33+
class AnalyzerGuruHelpTest {
3434
@Test
35-
public void shouldCreateReadableUsage() {
35+
void shouldCreateReadableUsage() {
3636
String usage = AnalyzerGuruHelp.getUsage();
3737
assertFalse(usage.isEmpty(), "usage is not empty");
3838
assertTrue(usage.contains("*."), "usage contains \"*.\"");

opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/AnalyzerGuruTest.java

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@
6060
/**
6161
* Tests for the functionality provided by the AnalyzerGuru class.
6262
*/
63-
public class AnalyzerGuruTest {
63+
class AnalyzerGuruTest {
6464

6565
@Test
66-
public void testGetFileTypeDescriptions() {
66+
void testGetFileTypeDescriptions() {
6767
Map<String, String> map = AnalyzerGuru.getfileTypeDescriptions();
6868
assertTrue(map.size() > 0);
6969
}
@@ -73,7 +73,7 @@ public void testGetFileTypeDescriptions() {
7373
* known extension.
7474
*/
7575
@Test
76-
public void testFileNameSameAsExtension() throws Exception {
76+
void testFileNameSameAsExtension() throws Exception {
7777
ByteArrayInputStream in = new ByteArrayInputStream(
7878
"#!/bin/sh\nexec /usr/bin/zip \"$@\"\n".getBytes(StandardCharsets.US_ASCII));
7979
String file = "/dummy/path/to/source/zip";
@@ -82,7 +82,7 @@ public void testFileNameSameAsExtension() throws Exception {
8282
}
8383

8484
@Test
85-
public void testUTF8ByteOrderMark() throws Exception {
85+
void testUTF8ByteOrderMark() throws Exception {
8686
byte[] xml = {(byte) 0xEF, (byte) 0xBB, (byte) 0xBF, // UTF-8 BOM
8787
'<', '?', 'x', 'm', 'l', ' ',
8888
'v', 'e', 'r', 's', 'i', 'o', 'n', '=',
@@ -93,7 +93,7 @@ public void testUTF8ByteOrderMark() throws Exception {
9393
}
9494

9595
@Test
96-
public void testUTF8ByteOrderMarkPlusCopyrightSymbol() throws Exception {
96+
void testUTF8ByteOrderMarkPlusCopyrightSymbol() throws Exception {
9797
byte[] doc = {(byte) 0xEF, (byte) 0xBB, (byte) 0xBF, // UTF-8 BOM
9898
'/', '/', ' ', (byte) 0xC2, (byte) 0xA9};
9999
ByteArrayInputStream in = new ByteArrayInputStream(doc);
@@ -102,7 +102,7 @@ public void testUTF8ByteOrderMarkPlusCopyrightSymbol() throws Exception {
102102
}
103103

104104
@Test
105-
public void testUTF8ByteOrderMarkPlainFile() throws Exception {
105+
void testUTF8ByteOrderMarkPlainFile() throws Exception {
106106
byte[] bytes = {(byte) 0xEF, (byte) 0xBB, (byte) 0xBF, // UTF-8 BOM
107107
'h', 'e', 'l', 'l', 'o', ' ',
108108
'w', 'o', 'r', 'l', 'd'};
@@ -113,7 +113,7 @@ public void testUTF8ByteOrderMarkPlainFile() throws Exception {
113113
}
114114

115115
@Test
116-
public void testUTF16BigByteOrderMarkPlusCopyrightSymbol() throws Exception {
116+
void testUTF16BigByteOrderMarkPlusCopyrightSymbol() throws Exception {
117117
byte[] doc = {(byte) 0xFE, (byte) 0xFF, // UTF-16BE BOM
118118
0, '#', 0, ' ', (byte) 0xC2, (byte) 0xA9};
119119
ByteArrayInputStream in = new ByteArrayInputStream(doc);
@@ -122,7 +122,7 @@ public void testUTF16BigByteOrderMarkPlusCopyrightSymbol() throws Exception {
122122
}
123123

124124
@Test
125-
public void testUTF16LittleByteOrderMarkPlusCopyrightSymbol() throws Exception {
125+
void testUTF16LittleByteOrderMarkPlusCopyrightSymbol() throws Exception {
126126
byte[] doc = {(byte) 0xFF, (byte) 0xFE, // UTF-16BE BOM
127127
'#', 0, ' ', 0, (byte) 0xA9, (byte) 0xC2};
128128
ByteArrayInputStream in = new ByteArrayInputStream(doc);
@@ -131,7 +131,7 @@ public void testUTF16LittleByteOrderMarkPlusCopyrightSymbol() throws Exception {
131131
}
132132

133133
@Test
134-
public void addExtension() throws Exception {
134+
void addExtension() throws Exception {
135135
// should not find analyzer for this unlikely extension
136136
assertNull(AnalyzerGuru.find("file.unlikely_extension"));
137137

@@ -150,7 +150,7 @@ public void addExtension() throws Exception {
150150
}
151151

152152
@Test
153-
public void addPrefix() throws Exception {
153+
void addPrefix() throws Exception {
154154
// should not find analyzer for this unlikely extension
155155
assertNull(AnalyzerGuru.find("unlikely_prefix.foo"));
156156

@@ -169,7 +169,7 @@ public void addPrefix() throws Exception {
169169
}
170170

171171
@Test
172-
public void testZip() throws IOException {
172+
void testZip() throws IOException {
173173
ByteArrayOutputStream baos = new ByteArrayOutputStream();
174174
ZipOutputStream zos = new ZipOutputStream(baos);
175175
zos.putNextEntry(new ZipEntry("dummy"));
@@ -181,7 +181,7 @@ public void testZip() throws IOException {
181181
}
182182

183183
@Test
184-
public void testJar() throws IOException {
184+
void testJar() throws IOException {
185185
ByteArrayOutputStream baos = new ByteArrayOutputStream();
186186
JarOutputStream jos = new JarOutputStream(baos);
187187
jos.putNextEntry(new JarEntry("dummy"));
@@ -193,21 +193,21 @@ public void testJar() throws IOException {
193193
}
194194

195195
@Test
196-
public void testPlainText() throws IOException {
196+
void testPlainText() throws IOException {
197197
ByteArrayInputStream in = new ByteArrayInputStream(
198198
"This is a plain text file.".getBytes(StandardCharsets.US_ASCII));
199199
assertSame(PlainAnalyzer.class, AnalyzerGuru.getAnalyzer(in, "dummy").getClass());
200200
}
201201

202202
@Test
203-
public void rfe2969() {
203+
void rfe2969() {
204204
AnalyzerFactory faf = AnalyzerGuru.find("foo.hxx");
205205
assertNotNull(faf);
206206
assertSame(CxxAnalyzerFactory.class, faf.getClass());
207207
}
208208

209209
@Test
210-
public void rfe3401() {
210+
void rfe3401() {
211211
AnalyzerFactory f1 = AnalyzerGuru.find("main.c");
212212
assertNotNull(f1);
213213
AnalyzerFactory f2 = AnalyzerGuru.find("main.cc");
@@ -219,7 +219,7 @@ public void rfe3401() {
219219
* Test that matching of full names works. Bug #859.
220220
*/
221221
@Test
222-
public void matchesFullName() {
222+
void matchesFullName() {
223223
String s = File.separator; // so test works on Unix and Windows
224224
String path = s + "path" + s + "to" + s + "Makefile";
225225
AnalyzerFactory faf = AnalyzerGuru.find(path);
@@ -238,7 +238,7 @@ public void matchesFullName() {
238238
* language + "AnalyzerFactory"
239239
*/
240240
@Test
241-
public void getAnalyzerFactoryClass() {
241+
void getAnalyzerFactoryClass() {
242242
Class<?> fcForSh = AnalyzerGuru.getFactoryClass("Sh");
243243
Class<?> fcForShAnalyzer = AnalyzerGuru.getFactoryClass("ShAnalyzer");
244244
Class<?> fcSimpleName = AnalyzerGuru.getFactoryClass("ShAnalyzerFactory");
@@ -251,50 +251,50 @@ public void getAnalyzerFactoryClass() {
251251
}
252252

253253
@Test
254-
public void shouldNotThrowGettingCsprojOpening() throws IOException {
254+
void shouldNotThrowGettingCsprojOpening() throws IOException {
255255
InputStream res = getClass().getClassLoader().getResourceAsStream("analysis/a.csproj");
256256
assertNotNull(res, "despite embedded a.csproj,");
257257
assertSame(XMLAnalyzer.class, AnalyzerGuru.getAnalyzer(res, "dummy").getClass(), "despite normal a.csproj,");
258258
}
259259

260260
@Test
261-
public void shouldMatchPerlHashbang() throws IOException {
261+
void shouldMatchPerlHashbang() throws IOException {
262262
ByteArrayInputStream in = new ByteArrayInputStream(
263263
"#!/usr/bin/perl -w".getBytes(StandardCharsets.US_ASCII));
264264
assertSame(PerlAnalyzer.class, AnalyzerGuru.getAnalyzer(in, "dummy").getClass(), "despite Perl hashbang,");
265265
}
266266

267267
@Test
268-
public void shouldMatchPerlHashbangSpaced() throws IOException {
268+
void shouldMatchPerlHashbangSpaced() throws IOException {
269269
ByteArrayInputStream in = new ByteArrayInputStream(
270270
"\n\t #! /usr/bin/perl -w".getBytes(StandardCharsets.US_ASCII));
271271
assertSame(PerlAnalyzer.class, AnalyzerGuru.getAnalyzer(in, "dummy").getClass(), "despite Perl hashbang,");
272272
}
273273

274274
@Test
275-
public void shouldMatchEnvPerlHashbang() throws IOException {
275+
void shouldMatchEnvPerlHashbang() throws IOException {
276276
ByteArrayInputStream in = new ByteArrayInputStream(
277277
"#!/usr/bin/env perl -w".getBytes(StandardCharsets.US_ASCII));
278278
assertSame(PerlAnalyzer.class, AnalyzerGuru.getAnalyzer(in, "dummy").getClass(), "despite env hashbang with perl,");
279279
}
280280

281281
@Test
282-
public void shouldMatchEnvPerlHashbangSpaced() throws IOException {
282+
void shouldMatchEnvPerlHashbangSpaced() throws IOException {
283283
ByteArrayInputStream in = new ByteArrayInputStream(
284284
"\n\t #! /usr/bin/env\t perl -w".getBytes(StandardCharsets.US_ASCII));
285285
assertSame(PerlAnalyzer.class, AnalyzerGuru.getAnalyzer(in, "dummy").getClass(),
286286
"despite env hashbang with perl,");
287287
}
288288

289289
@Test
290-
public void shouldNotMatchEnvLFPerlHashbang() throws IOException {
290+
void shouldNotMatchEnvLFPerlHashbang() throws IOException {
291291
ByteArrayInputStream in = new ByteArrayInputStream(
292292
"#!/usr/bin/env\nperl".getBytes(StandardCharsets.US_ASCII));
293293
assertNotSame(PerlAnalyzer.class, AnalyzerGuru.getAnalyzer(in, "dummy").getClass(), "despite env hashbang LF,");
294294
}
295295

296296
@Test
297-
public void shouldMatchELFMagic() throws Exception {
297+
void shouldMatchELFMagic() throws Exception {
298298
byte[] elfmt = {(byte) 0x7F, 'E', 'L', 'F', (byte) 2, (byte) 2, (byte) 1,
299299
(byte) 0x06};
300300
ByteArrayInputStream in = new ByteArrayInputStream(elfmt);
@@ -303,7 +303,7 @@ public void shouldMatchELFMagic() throws Exception {
303303
}
304304

305305
@Test
306-
public void shouldMatchJavaClassMagic() throws Exception {
306+
void shouldMatchJavaClassMagic() throws Exception {
307307
String oldMagic = "\312\376\272\276"; // cafebabe?
308308
String newMagic = new String(new byte[] {(byte) 0xCA, (byte) 0xFE,
309309
(byte) 0xBA, (byte) 0xBE}, StandardCharsets.UTF_8);
@@ -318,15 +318,15 @@ public void shouldMatchJavaClassMagic() throws Exception {
318318
}
319319

320320
@Test
321-
public void shouldMatchTroffMagic() throws Exception {
321+
void shouldMatchTroffMagic() throws Exception {
322322
byte[] mandoc = {' ', '\n', '.', '\"', '\n', '.', 'T', 'H', (byte) 0x20, '\n'};
323323
ByteArrayInputStream in = new ByteArrayInputStream(mandoc);
324324
AbstractAnalyzer fa = AnalyzerGuru.getAnalyzer(in, "/dummy/file");
325325
assertSame(TroffAnalyzer.class, fa.getClass(), "despite .TH magic,");
326326
}
327327

328328
@Test
329-
public void shouldMatchMandocMagic() throws Exception {
329+
void shouldMatchMandocMagic() throws Exception {
330330
byte[] mandoc = {'\n', ' ', '.', '\"', '\n', '.', 'D', 'd', (byte) 0x20, '\n'};
331331
ByteArrayInputStream in = new ByteArrayInputStream(mandoc);
332332
AbstractAnalyzer fa = AnalyzerGuru.getAnalyzer(in, "/dummy/file");

opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/CtagsParserTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
*
3232
* @author Lubos Kosco
3333
*/
34-
public class CtagsParserTest {
34+
class CtagsParserTest {
3535

3636
@Test
37-
public void ctagsVsUniversalCtags() throws Exception {
37+
void ctagsVsUniversalCtags() throws Exception {
3838
String universal_ctags_c = "TEST\tsample.c\t/^#define TEST($/;\"\tmacro\tline:6\tsignature:(x)\n"
3939
+ "foo\tsample.c\t/^int foo(int a, int b) {$/;\"\tfunction\tline:8\ttyperef:typename:int\tsignature:(int a, int b)\n"
4040
+ "c\tsample.c\t/^ int c;$/;\"\tlocal\tline:13\tfunction:foo\ttyperef:typename:int\n"

opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/CtagsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@
4343
*
4444
* @author Lubos Kosco
4545
*/
46-
public class CtagsTest {
46+
class CtagsTest {
4747

4848
private static Ctags ctags;
4949
private static TestRepository repository;
5050

5151
@BeforeAll
52-
public static void setUpClass() throws Exception {
52+
static void setUpClass() throws Exception {
5353
ctags = new Ctags();
5454

5555
repository = new TestRepository();
@@ -66,7 +66,7 @@ public static void setUpClass() throws Exception {
6666
}
6767

6868
@AfterAll
69-
public static void tearDownClass() {
69+
static void tearDownClass() {
7070
ctags.close();
7171
ctags = null;
7272
repository.destroy();

opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/DefinitionsTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@
3535
/**
3636
* @author austvik
3737
*/
38-
public class DefinitionsTest {
38+
class DefinitionsTest {
3939

4040
/**
4141
* Test of getSymbols method, of class Definitions.
4242
*/
4343
@Test
44-
public void getSymbols() {
44+
void getSymbols() {
4545
Definitions instance = new Definitions();
4646
Set<String> result = instance.getSymbols();
4747
assertNotNull(result);
@@ -56,7 +56,7 @@ public void getSymbols() {
5656
* Test of hasSymbol method, of class Definitions.
5757
*/
5858
@Test
59-
public void hasSymbol() {
59+
void hasSymbol() {
6060
Definitions instance = new Definitions();
6161
instance.addTag(1, "found", "", "", 0, 0);
6262
assertFalse(instance.hasSymbol("notFound"));
@@ -67,7 +67,7 @@ public void hasSymbol() {
6767
* Test of hasDefinitionAt method, of class Definitions.
6868
*/
6969
@Test
70-
public void hasDefinitionAt() {
70+
void hasDefinitionAt() {
7171
Definitions instance = new Definitions();
7272
String[] type = {""};
7373
instance.addTag(1, "found", "", "", 0, 0);
@@ -82,7 +82,7 @@ public void hasDefinitionAt() {
8282
* Test of occurrences method, of class Definitions.
8383
*/
8484
@Test
85-
public void occurrences() {
85+
void occurrences() {
8686
Definitions instance = new Definitions();
8787
instance.addTag(1, "one", "", "", 0, 0);
8888
instance.addTag(1, "two", "", "", 0, 0);
@@ -96,7 +96,7 @@ public void occurrences() {
9696
* Test of numberOfSymbols method, of class Definitions.
9797
*/
9898
@Test
99-
public void numberOfSymbols() {
99+
void numberOfSymbols() {
100100
Definitions instance = new Definitions();
101101
assertEquals(0, instance.numberOfSymbols());
102102
instance.addTag(1, "one", "", "", 0, 0);
@@ -110,7 +110,7 @@ public void numberOfSymbols() {
110110
* Test of getTags method, of class Definitions.
111111
*/
112112
@Test
113-
public void getTags() {
113+
void getTags() {
114114
Definitions instance = new Definitions();
115115
assertEquals(0, instance.getTags().size());
116116
instance.addTag(1, "one", "", "", 0, 0);
@@ -125,7 +125,7 @@ public void getTags() {
125125
* Test of addTag method, of class Definitions.
126126
*/
127127
@Test
128-
public void addTag() {
128+
void addTag() {
129129
Definitions instance = new Definitions();
130130
assertEquals(0, instance.getTags().size());
131131
instance.addTag(1, "one", "", "", 0, 0);
@@ -136,7 +136,7 @@ public void addTag() {
136136
* Test of serialize method, of class Definitions.
137137
*/
138138
@Test
139-
public void serialize() throws Exception {
139+
void serialize() throws Exception {
140140
Definitions instance = new Definitions();
141141
instance.addTag(1, "one", "", "", 0, 0);
142142
byte[] serial = instance.serialize();

opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/ExpandTabsReaderTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@
3737
/**
3838
* Unit tests for the ExpandTabsReader class.
3939
*/
40-
public class ExpandTabsReaderTest {
40+
class ExpandTabsReaderTest {
4141

4242
/**
4343
* Test that tabs are expanded to spaces.
4444
*/
4545
@Test
46-
public void testExpandTabs() throws IOException {
46+
void testExpandTabs() throws IOException {
4747
// Create a couple of lines to see if tabs are expanded as expected.
4848
String inputLine = "abc\tdef\t\t12345678\t1\t1234567\tabc";
4949

@@ -70,7 +70,7 @@ public void testExpandTabs() throws IOException {
7070
* Test that skip() works over tabs.
7171
*/
7272
@Test
73-
public void testSkip() throws IOException {
73+
void testSkip() throws IOException {
7474
Reader r = new ExpandTabsReader(new StringReader("\txyz"), 8);
7575

7676
// Skip four characters. That is, half of the tab after expansion.
@@ -96,7 +96,7 @@ public void testSkip() throws IOException {
9696
* Tests that line offsets are translated as expected.
9797
*/
9898
@Test
99-
public void testTranslate() {
99+
void testTranslate() {
100100
final String INPUT = "abc\tdef\t\t12345678\t1\t1234567\tabc";
101101

102102
int tbsz = 8;

0 commit comments

Comments
 (0)