Skip to content

Commit c5e1438

Browse files
authored
Resolves #368 by adding checkstyle explicit line ending and test fixes (#369)
1 parent 5a44b1d commit c5e1438

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

checkstyle.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333

3434
<!-- Checks whether files end with a new line. -->
3535
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
36-
<module name="NewlineAtEndOfFile"/>
36+
<module name="NewlineAtEndOfFile">
37+
<property name="lineSeparator" value="lf"/>
38+
</module>
3739

3840
<!-- Checks that property files contain the same keys. -->
3941
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->

java-manta-client-unshaded/src/test/java/com/joyent/manta/client/MantaObjectDepthComparatorTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ private static List<MantaObject> fileObjects(final MantaObject dirObject, final
109109

110110
for (int i = 0; i < number; i++) {
111111
final MantaObject object = mock(MantaObject.class);
112+
final int segmentChar = (number + i) % 26;
112113
String path = dirObject.getPath() + SEPARATOR
113-
+ StringUtils.repeat((char)(97 + number + i), 4) + ".json";
114+
+ StringUtils.repeat(((char)(97 + segmentChar) ), 4) + ".json";
114115
when(object.getPath()).thenReturn(path);
115116
when(object.getType()).thenReturn(MantaObject.MANTA_OBJECT_TYPE_OBJECT);
116117
when(object.getContentType()).thenReturn(ContentType.APPLICATION_JSON.toString());
@@ -129,7 +130,8 @@ private static List<MantaObject> dirObjects(final int depth) {
129130
path.append("stor");
130131

131132
for (int i = 3; i <= depth; i++) {
132-
path.append(SEPARATOR).append(StringUtils.repeat((char)(97 + depth + i), 3));
133+
final int segmentChar = (depth + i) % 26;
134+
path.append(SEPARATOR).append(StringUtils.repeat(((char)(97 + segmentChar) ), 3));
133135
MantaObject object = mockDirectory(path);
134136
objects.add(object);
135137
}

java-manta-client-unshaded/src/test/java/com/joyent/manta/client/crypto/SecretKeyUtilsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
import org.testng.Assert;
1212
import org.testng.annotations.Test;
1313

14-
import javax.crypto.SecretKey;
1514
import java.io.File;
1615
import java.io.IOException;
1716
import java.net.URI;
1817
import java.nio.charset.StandardCharsets;
1918
import java.nio.file.Path;
2019
import java.nio.file.Paths;
2120
import java.util.Arrays;
21+
import javax.crypto.SecretKey;
2222

2323
@Test
2424
public class SecretKeyUtilsTest {
@@ -68,7 +68,7 @@ public void canLoadKeyFromURIPath() throws IOException {
6868
File file = File.createTempFile("ciphertext-", ".data");
6969
FileUtils.forceDeleteOnExit(file);
7070
FileUtils.writeByteArrayToFile(file, keyBytes);
71-
URI uri = URI.create("file://" + file.getAbsolutePath());
71+
URI uri = file.toURI();
7272

7373
SecretKey expected = SecretKeyUtils.loadKey(keyBytes, AesGcmCipherDetails.INSTANCE_128_BIT);
7474
SecretKey actual = SecretKeyUtils.loadKeyFromPath(Paths.get(uri), AesGcmCipherDetails.INSTANCE_128_BIT);

0 commit comments

Comments
 (0)