From e7ad4b92ffca2159bc7f2b082faf889c219df627 Mon Sep 17 00:00:00 2001 From: Graham Date: Tue, 18 Aug 2020 18:19:11 +0100 Subject: [PATCH] Group test files by test Signed-off-by: Graham --- .../java/dev/openrs2/cache/Js5CompressionTest.kt | 2 +- .../cache/{ => compression}/bzip2-encrypted.dat | Bin .../dev/openrs2/cache/{ => compression}/bzip2.dat | Bin .../cache/{ => compression}/gzip-encrypted.dat | Bin .../dev/openrs2/cache/{ => compression}/gzip.dat | Bin .../cache/{ => compression}/lzma-encrypted.dat | Bin .../dev/openrs2/cache/{ => compression}/lzma.dat | Bin .../cache/{ => compression}/none-encrypted.dat | Bin .../dev/openrs2/cache/{ => compression}/none.dat | Bin .../test/java/dev/openrs2/crypto/IsaacRandomTest.kt | 3 +-- .../test/java/dev/openrs2/crypto/WhirlpoolTest.kt | 3 +-- .../dev/openrs2/crypto/{ => isaac}/noseedvect.txt | 0 .../dev/openrs2/crypto/{ => isaac}/randvect.txt | 0 .../dev/openrs2/crypto/{ => isaac}/seedvect.txt | 0 .../crypto/{ => whirlpool}/nessie-one-vectors.txt | 0 .../crypto/{ => whirlpool}/nessie-zero-vectors.txt | 0 16 files changed, 3 insertions(+), 5 deletions(-) rename cache/src/test/resources/dev/openrs2/cache/{ => compression}/bzip2-encrypted.dat (100%) rename cache/src/test/resources/dev/openrs2/cache/{ => compression}/bzip2.dat (100%) rename cache/src/test/resources/dev/openrs2/cache/{ => compression}/gzip-encrypted.dat (100%) rename cache/src/test/resources/dev/openrs2/cache/{ => compression}/gzip.dat (100%) rename cache/src/test/resources/dev/openrs2/cache/{ => compression}/lzma-encrypted.dat (100%) rename cache/src/test/resources/dev/openrs2/cache/{ => compression}/lzma.dat (100%) rename cache/src/test/resources/dev/openrs2/cache/{ => compression}/none-encrypted.dat (100%) rename cache/src/test/resources/dev/openrs2/cache/{ => compression}/none.dat (100%) rename crypto/src/test/resources/dev/openrs2/crypto/{ => isaac}/noseedvect.txt (100%) rename crypto/src/test/resources/dev/openrs2/crypto/{ => isaac}/randvect.txt (100%) rename crypto/src/test/resources/dev/openrs2/crypto/{ => isaac}/seedvect.txt (100%) rename crypto/src/test/resources/dev/openrs2/crypto/{ => whirlpool}/nessie-one-vectors.txt (100%) rename crypto/src/test/resources/dev/openrs2/crypto/{ => whirlpool}/nessie-zero-vectors.txt (100%) diff --git a/cache/src/test/java/dev/openrs2/cache/Js5CompressionTest.kt b/cache/src/test/java/dev/openrs2/cache/Js5CompressionTest.kt index 4a92bb96da..206ee8b3db 100644 --- a/cache/src/test/java/dev/openrs2/cache/Js5CompressionTest.kt +++ b/cache/src/test/java/dev/openrs2/cache/Js5CompressionTest.kt @@ -224,7 +224,7 @@ object Js5CompressionTest { } private fun read(name: String): ByteBuf { - Js5CompressionTest::class.java.getResourceAsStream(name).use { input -> + Js5CompressionTest::class.java.getResourceAsStream("compression/$name").use { input -> return Unpooled.wrappedBuffer(input.readAllBytes()) } } diff --git a/cache/src/test/resources/dev/openrs2/cache/bzip2-encrypted.dat b/cache/src/test/resources/dev/openrs2/cache/compression/bzip2-encrypted.dat similarity index 100% rename from cache/src/test/resources/dev/openrs2/cache/bzip2-encrypted.dat rename to cache/src/test/resources/dev/openrs2/cache/compression/bzip2-encrypted.dat diff --git a/cache/src/test/resources/dev/openrs2/cache/bzip2.dat b/cache/src/test/resources/dev/openrs2/cache/compression/bzip2.dat similarity index 100% rename from cache/src/test/resources/dev/openrs2/cache/bzip2.dat rename to cache/src/test/resources/dev/openrs2/cache/compression/bzip2.dat diff --git a/cache/src/test/resources/dev/openrs2/cache/gzip-encrypted.dat b/cache/src/test/resources/dev/openrs2/cache/compression/gzip-encrypted.dat similarity index 100% rename from cache/src/test/resources/dev/openrs2/cache/gzip-encrypted.dat rename to cache/src/test/resources/dev/openrs2/cache/compression/gzip-encrypted.dat diff --git a/cache/src/test/resources/dev/openrs2/cache/gzip.dat b/cache/src/test/resources/dev/openrs2/cache/compression/gzip.dat similarity index 100% rename from cache/src/test/resources/dev/openrs2/cache/gzip.dat rename to cache/src/test/resources/dev/openrs2/cache/compression/gzip.dat diff --git a/cache/src/test/resources/dev/openrs2/cache/lzma-encrypted.dat b/cache/src/test/resources/dev/openrs2/cache/compression/lzma-encrypted.dat similarity index 100% rename from cache/src/test/resources/dev/openrs2/cache/lzma-encrypted.dat rename to cache/src/test/resources/dev/openrs2/cache/compression/lzma-encrypted.dat diff --git a/cache/src/test/resources/dev/openrs2/cache/lzma.dat b/cache/src/test/resources/dev/openrs2/cache/compression/lzma.dat similarity index 100% rename from cache/src/test/resources/dev/openrs2/cache/lzma.dat rename to cache/src/test/resources/dev/openrs2/cache/compression/lzma.dat diff --git a/cache/src/test/resources/dev/openrs2/cache/none-encrypted.dat b/cache/src/test/resources/dev/openrs2/cache/compression/none-encrypted.dat similarity index 100% rename from cache/src/test/resources/dev/openrs2/cache/none-encrypted.dat rename to cache/src/test/resources/dev/openrs2/cache/compression/none-encrypted.dat diff --git a/cache/src/test/resources/dev/openrs2/cache/none.dat b/cache/src/test/resources/dev/openrs2/cache/compression/none.dat similarity index 100% rename from cache/src/test/resources/dev/openrs2/cache/none.dat rename to cache/src/test/resources/dev/openrs2/cache/compression/none.dat diff --git a/crypto/src/test/java/dev/openrs2/crypto/IsaacRandomTest.kt b/crypto/src/test/java/dev/openrs2/crypto/IsaacRandomTest.kt index 27897cf7e1..d5b43a2dee 100644 --- a/crypto/src/test/java/dev/openrs2/crypto/IsaacRandomTest.kt +++ b/crypto/src/test/java/dev/openrs2/crypto/IsaacRandomTest.kt @@ -61,8 +61,7 @@ object IsaacRandomTest { } private fun readVector(file: String): IntArray { - val path = "/dev/openrs2/crypto/$file" - val input = IsaacRandomTest::class.java.getResourceAsStream(path) + val input = IsaacRandomTest::class.java.getResourceAsStream("isaac/$file") return BufferedReader(InputStreamReader(input)).useLines { lines -> val elements = mutableListOf() diff --git a/crypto/src/test/java/dev/openrs2/crypto/WhirlpoolTest.kt b/crypto/src/test/java/dev/openrs2/crypto/WhirlpoolTest.kt index a8d55dc3de..a6bb4f3822 100644 --- a/crypto/src/test/java/dev/openrs2/crypto/WhirlpoolTest.kt +++ b/crypto/src/test/java/dev/openrs2/crypto/WhirlpoolTest.kt @@ -63,8 +63,7 @@ object WhirlpoolTest { private val NESSIE_ONE_VECTORS = readVectors("nessie-one-vectors.txt") private fun readVectors(file: String): List { - val path = "/dev/openrs2/crypto/$file" - val input = WhirlpoolTest::class.java.getResourceAsStream(path) + val input = WhirlpoolTest::class.java.getResourceAsStream("whirlpool/$file") return input.bufferedReader().use { reader -> reader.lines() .map(ByteBufUtil::decodeHexDump) diff --git a/crypto/src/test/resources/dev/openrs2/crypto/noseedvect.txt b/crypto/src/test/resources/dev/openrs2/crypto/isaac/noseedvect.txt similarity index 100% rename from crypto/src/test/resources/dev/openrs2/crypto/noseedvect.txt rename to crypto/src/test/resources/dev/openrs2/crypto/isaac/noseedvect.txt diff --git a/crypto/src/test/resources/dev/openrs2/crypto/randvect.txt b/crypto/src/test/resources/dev/openrs2/crypto/isaac/randvect.txt similarity index 100% rename from crypto/src/test/resources/dev/openrs2/crypto/randvect.txt rename to crypto/src/test/resources/dev/openrs2/crypto/isaac/randvect.txt diff --git a/crypto/src/test/resources/dev/openrs2/crypto/seedvect.txt b/crypto/src/test/resources/dev/openrs2/crypto/isaac/seedvect.txt similarity index 100% rename from crypto/src/test/resources/dev/openrs2/crypto/seedvect.txt rename to crypto/src/test/resources/dev/openrs2/crypto/isaac/seedvect.txt diff --git a/crypto/src/test/resources/dev/openrs2/crypto/nessie-one-vectors.txt b/crypto/src/test/resources/dev/openrs2/crypto/whirlpool/nessie-one-vectors.txt similarity index 100% rename from crypto/src/test/resources/dev/openrs2/crypto/nessie-one-vectors.txt rename to crypto/src/test/resources/dev/openrs2/crypto/whirlpool/nessie-one-vectors.txt diff --git a/crypto/src/test/resources/dev/openrs2/crypto/nessie-zero-vectors.txt b/crypto/src/test/resources/dev/openrs2/crypto/whirlpool/nessie-zero-vectors.txt similarity index 100% rename from crypto/src/test/resources/dev/openrs2/crypto/nessie-zero-vectors.txt rename to crypto/src/test/resources/dev/openrs2/crypto/whirlpool/nessie-zero-vectors.txt