Skip to content

Commit 9879ee5

Browse files
GH-4544 Openrewrite changes to the test classes. A few reverts regarding pom changes.
Signed-off-by: Jerven Bolleman <[email protected]>
1 parent fca0822 commit 9879ee5

File tree

408 files changed

+4841
-3303
lines changed

Some content is hidden

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

408 files changed

+4841
-3303
lines changed

Diff for: core/common/io/pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
<groupId>org.slf4j</groupId>
2525
<artifactId>slf4j-api</artifactId>
2626
</dependency>
27+
<dependency>
28+
<groupId>org.junit.jupiter</groupId>
29+
<artifactId>junit-jupiter</artifactId>
30+
<scope>test</scope>
31+
</dependency>
2732
<dependency>
2833
<groupId>org.openjdk.jmh</groupId>
2934
<artifactId>jmh-core</artifactId>

Diff for: core/common/io/src/test/java/org/eclipse/rdf4j/common/io/ByteArrayUtilTest.java

+15-15
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020

2121
import org.junit.jupiter.api.Test;
2222

23-
public class ByteArrayUtilTest {
23+
class ByteArrayUtilTest {
2424

2525
@Test
26-
public void testMatchesPattern() {
26+
void testMatchesPattern() {
2727
assertTrue(ByteArrayUtil.matchesPattern(new byte[] {}, new byte[] { 0, 32 }, new byte[] { 0, 16 }));
2828
assertTrue(ByteArrayUtil.matchesPattern(new byte[] { 4 }, new byte[] { 0 }, new byte[] { 2 }));
2929

3030
assertFalse(ByteArrayUtil.matchesPattern(new byte[] { 2, 0 }, new byte[] { 2, 0 }, new byte[] { 0, 16 }));
3131
}
3232

3333
@Test
34-
public void testRegionMatches() {
34+
void testRegionMatches() {
3535
assertTrue(ByteArrayUtil.regionMatches(new byte[] {}, new byte[] { 1, 0 }, 0));
3636
assertTrue(ByteArrayUtil.regionMatches(new byte[] { 2, 3, 4, 5 }, new byte[] { 1, 2, 3, 4, 5, 6 }, 1));
3737

@@ -40,7 +40,7 @@ public void testRegionMatches() {
4040
}
4141

4242
@Test
43-
public void testCompareRegion() {
43+
void testCompareRegion() {
4444
assertEquals(0, ByteArrayUtil.compareRegion(new byte[] {}, 0, new byte[] {}, 0, 0));
4545
assertEquals(0, ByteArrayUtil.compareRegion(new byte[] { 0, 2 }, 0, new byte[] { 0, 1 }, 0, 1));
4646

@@ -49,7 +49,7 @@ public void testCompareRegion() {
4949
}
5050

5151
@Test
52-
public void testFind() {
52+
void testFind() {
5353
assertEquals(-1, ByteArrayUtil.find(new byte[] {}, 0, 1, (byte) 0));
5454
assertEquals(-1, ByteArrayUtil.find(new byte[] { 0, 1, 2, 3, 4, 5, 6 }, 0, 20, (byte) 7));
5555
assertEquals(-1, ByteArrayUtil.find(new byte[] { 0, 1, 2, 3, 4, 5, 6 }, -5, 20, (byte) 7));
@@ -59,7 +59,7 @@ public void testFind() {
5959
}
6060

6161
@Test
62-
public void testFindArray() {
62+
void testFindArray() {
6363
assertEquals(0, ByteArrayUtil.find(new byte[] {}, 0, 1, new byte[] {}));
6464
assertEquals(2, ByteArrayUtil.find(new byte[] { 0, 1, 2, 3, 4, 5, 6 }, 0, 7, new byte[] { 2, 3 }));
6565
assertEquals(2, ByteArrayUtil.find(new byte[] { 0, 1, 2, 3, 4, 5, 6 }, 0, 20, new byte[] { 2, 3 }));
@@ -69,7 +69,7 @@ public void testFindArray() {
6969
}
7070

7171
@Test
72-
public void testGetInt() {
72+
void testGetInt() {
7373
assertEquals(0, ByteArrayUtil.getInt(new byte[] { 0, 0, 0, 0, 0, 0 }, 0));
7474
assertEquals((1 << 24) + (2 << 16) + (3 << 8) + 4, ByteArrayUtil.getInt(new byte[] { 1, 2, 3, 4 }, 0));
7575
assertEquals((1 << 24) + (2 << 16) + (3 << 8) + 4, ByteArrayUtil.getInt(new byte[] { 10, 1, 2, 3, 4, 10 }, 1));
@@ -78,7 +78,7 @@ public void testGetInt() {
7878
}
7979

8080
@Test
81-
public void testGetLong() {
81+
void testGetLong() {
8282
assertEquals(0L, ByteArrayUtil.getLong(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }, 0));
8383
assertEquals(1L, ByteArrayUtil.getLong(new byte[] { 0, 0, 0, 0, 0, 0, 0, 1 }, 0));
8484
assertEquals(1L << 56, ByteArrayUtil.getLong(new byte[] { 1, 0, 0, 0, 0, 0, 0, 0 }, 0));
@@ -88,15 +88,15 @@ public void testGetLong() {
8888
}
8989

9090
@Test
91-
public void testToBitSet() {
91+
void testToBitSet() {
9292
assertEquals(new BitSet(), ByteArrayUtil.toBitSet(new byte[] {}));
9393

9494
final BitSet bitSet = ByteArrayUtil.toBitSet(new byte[] { 1, 2, 3, 4 });
9595
assertArrayEquals(new byte[] { -128, 64, -64, 32 }, bitSet.toByteArray());
9696
}
9797

9898
@Test
99-
public void testToByteArray() {
99+
void testToByteArray() {
100100
final BitSet bitSet = new BitSet();
101101

102102
assertArrayEquals(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, ByteArrayUtil.toByteArray(bitSet));
@@ -109,15 +109,15 @@ public void testToByteArray() {
109109
}
110110

111111
@Test
112-
public void testToHexString() {
112+
void testToHexString() {
113113
assertEquals("", ByteArrayUtil.toHexString(new byte[] {}));
114114
assertEquals("1a", ByteArrayUtil.toHexString(new byte[] { 0x1A }));
115115
assertEquals("1a2b3c", ByteArrayUtil.toHexString(new byte[] { 0x1A, 0x2B, 0x3C }));
116116
assertEquals("010203", ByteArrayUtil.toHexString(new byte[] { 0x01, 0x02, 0x03 }));
117117
}
118118

119119
@Test
120-
public void testPutLong() {
120+
void testPutLong() {
121121
final byte[] byteArray = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
122122

123123
ByteArrayUtil.putLong(1L, byteArray, 0);
@@ -134,7 +134,7 @@ public void testPutLong() {
134134
}
135135

136136
@Test
137-
public void testPutInt() {
137+
void testPutInt() {
138138
final byte[] byteArray = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
139139

140140
ByteArrayUtil.putInt(1, byteArray, 0);
@@ -151,15 +151,15 @@ public void testPutInt() {
151151
}
152152

153153
@Test
154-
public void testGet() {
154+
void testGet() {
155155
assertArrayEquals(new byte[] {}, ByteArrayUtil.get(new byte[] {}, 0));
156156
assertArrayEquals(new byte[] { 3, 4 }, ByteArrayUtil.get(new byte[] { 1, 2, 3, 4 }, 2));
157157
assertArrayEquals(new byte[] { 3, 4, 5 }, ByteArrayUtil.get(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }, 2, 3));
158158
assertArrayEquals(new byte[] {}, ByteArrayUtil.get(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }, 2, 0));
159159
}
160160

161161
@Test
162-
public void testPut() {
162+
void testPut() {
163163
final byte[] byteArray = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
164164

165165
ByteArrayUtil.put(new byte[] { 1, 2, 3, 4 }, byteArray, 0);

Diff for: core/common/io/src/test/java/org/eclipse/rdf4j/common/io/ZipUtilTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class ZipUtilTest {
2929
public File dir;
3030

3131
@Test
32-
public void testWriteEntryNormal() throws IOException {
32+
void testWriteEntryNormal() throws IOException {
3333
File f = new File(dir, "testok.zip");
3434
f.createNewFile();
3535

@@ -49,7 +49,7 @@ public void testWriteEntryNormal() throws IOException {
4949
}
5050

5151
@Test
52-
public void testWriteEntryPathTraversing() throws IOException {
52+
void testWriteEntryPathTraversing() throws IOException {
5353
File f = new File(dir, "testnotok.zip");
5454
f.createNewFile();
5555

0 commit comments

Comments
 (0)