From b5a0e181090ac5e182dd7f61787d06d7f473f8a5 Mon Sep 17 00:00:00 2001 From: Willem Cazander Date: Sun, 13 Mar 2022 01:42:19 +0100 Subject: [PATCH] Added Terminator test --- ...ryTest.java => Base2PartsFactoryTest.java} | 2 +- .../numberxd/base2t/Base2TerminatorTest.java | 43 +++++++++++++++++++ .../base2t/{ => part}/T02PartBinaryTest.java | 2 +- .../base2t/{ => part}/T03PartTritTest.java | 2 +- .../base2t/{ => part}/T04PartQuadTest.java | 2 +- .../base2t/{ => part}/T05PartPentalTest.java | 2 +- .../base2t/{ => part}/T06PartSeximalTest.java | 2 +- .../base2t/{ => part}/T07PartPlanItTest.java | 2 +- .../base2t/{ => part}/T08PartOctalTest.java | 2 +- .../base2t/{ => part}/T09PartNonaryTest.java | 2 +- .../base2t/{ => part}/T10PartDecimalTest.java | 2 +- .../{ => part}/T11PartUndecimalTest.java | 2 +- .../base2t/{ => part}/T12PartUncialTest.java | 2 +- .../base2t/{ => part}/T16PartHexTest.java | 2 +- .../base2t/{ => part}/T20PartScoreTest.java | 2 +- .../base2t/{ => part}/T60SexagesimalTest.java | 2 +- 16 files changed, 58 insertions(+), 15 deletions(-) rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{BasePartFactoryTest.java => Base2PartsFactoryTest.java} (98%) create mode 100644 gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/Base2TerminatorTest.java rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{ => part}/T02PartBinaryTest.java (95%) rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{ => part}/T03PartTritTest.java (95%) rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{ => part}/T04PartQuadTest.java (97%) rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{ => part}/T05PartPentalTest.java (96%) rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{ => part}/T06PartSeximalTest.java (96%) rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{ => part}/T07PartPlanItTest.java (96%) rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{ => part}/T08PartOctalTest.java (96%) rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{ => part}/T09PartNonaryTest.java (96%) rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{ => part}/T10PartDecimalTest.java (96%) rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{ => part}/T11PartUndecimalTest.java (96%) rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{ => part}/T12PartUncialTest.java (96%) rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{ => part}/T16PartHexTest.java (96%) rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{ => part}/T20PartScoreTest.java (97%) rename gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/{ => part}/T60SexagesimalTest.java (96%) diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/BasePartFactoryTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/Base2PartsFactoryTest.java similarity index 98% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/BasePartFactoryTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/Base2PartsFactoryTest.java index d8b667b9..d27b95a9 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/BasePartFactoryTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/Base2PartsFactoryTest.java @@ -10,7 +10,7 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartʸᴰ; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") -public class BasePartFactoryTest { +public class Base2PartsFactoryTest { @Test public void testSupportedBases() { diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/Base2TerminatorTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/Base2TerminatorTest.java new file mode 100644 index 00000000..30990e1b --- /dev/null +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/Base2TerminatorTest.java @@ -0,0 +1,43 @@ +package love.distributedrebirth.numberxd.base2t; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; +import love.distributedrebirth.numberxd.base2t.part.T02PartBinary; +import love.distributedrebirth.numberxd.base2t.type.V072Tong; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +public class Base2TerminatorTest { + + @Test + public void testBytes() throws IOException { + V072Tong tong = new V072Tong(); + tong.getValue(T02PartBinary.PART_1).setValueNumber(123456000); + tong.getValue(T02PartBinary.PART_2).setValueNumber(234567000); + + List tongs = new ArrayList<>(); + tongs.add(tong); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + Base2Terminator.INSTANCE.Bãß2WriteTong(tongs, baos); + byte[] data = baos.toByteArray(); + + ByteArrayInputStream bais = new ByteArrayInputStream(data); + List result = new ArrayList<>(); + Base2Terminator.INSTANCE.Bãß2ReadTong(bais, result); + + V072Tong tong2 = result.get(0); + Assertions.assertNotNull(tong2); + + Assertions.assertEquals(123456000L, tong.getValue(T02PartBinary.PART_1).getValueNumber()); + Assertions.assertEquals(234567000L, tong.getValue(T02PartBinary.PART_2).getValueNumber()); + } + +} diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T02PartBinaryTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T02PartBinaryTest.java similarity index 95% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T02PartBinaryTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T02PartBinaryTest.java index 65f8374e..24482bd9 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T02PartBinaryTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T02PartBinaryTest.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.numberxd.base2t; +package love.distributedrebirth.numberxd.base2t.part; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T03PartTritTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T03PartTritTest.java similarity index 95% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T03PartTritTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T03PartTritTest.java index f4648c58..d9efe9c1 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T03PartTritTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T03PartTritTest.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.numberxd.base2t; +package love.distributedrebirth.numberxd.base2t.part; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T04PartQuadTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T04PartQuadTest.java similarity index 97% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T04PartQuadTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T04PartQuadTest.java index e456d6fa..f2c3823a 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T04PartQuadTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T04PartQuadTest.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.numberxd.base2t; +package love.distributedrebirth.numberxd.base2t.part; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T05PartPentalTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T05PartPentalTest.java similarity index 96% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T05PartPentalTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T05PartPentalTest.java index fd744bbc..2395ff73 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T05PartPentalTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T05PartPentalTest.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.numberxd.base2t; +package love.distributedrebirth.numberxd.base2t.part; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T06PartSeximalTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T06PartSeximalTest.java similarity index 96% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T06PartSeximalTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T06PartSeximalTest.java index 8c82caa3..3b08ba23 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T06PartSeximalTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T06PartSeximalTest.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.numberxd.base2t; +package love.distributedrebirth.numberxd.base2t.part; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T07PartPlanItTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T07PartPlanItTest.java similarity index 96% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T07PartPlanItTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T07PartPlanItTest.java index b50403c7..6e320d87 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T07PartPlanItTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T07PartPlanItTest.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.numberxd.base2t; +package love.distributedrebirth.numberxd.base2t.part; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T08PartOctalTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T08PartOctalTest.java similarity index 96% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T08PartOctalTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T08PartOctalTest.java index 6f661ec1..cae28fed 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T08PartOctalTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T08PartOctalTest.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.numberxd.base2t; +package love.distributedrebirth.numberxd.base2t.part; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T09PartNonaryTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T09PartNonaryTest.java similarity index 96% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T09PartNonaryTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T09PartNonaryTest.java index a25cc0c3..6d85eac5 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T09PartNonaryTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T09PartNonaryTest.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.numberxd.base2t; +package love.distributedrebirth.numberxd.base2t.part; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T10PartDecimalTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T10PartDecimalTest.java similarity index 96% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T10PartDecimalTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T10PartDecimalTest.java index bce8ae22..7eb3a750 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T10PartDecimalTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T10PartDecimalTest.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.numberxd.base2t; +package love.distributedrebirth.numberxd.base2t.part; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T11PartUndecimalTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T11PartUndecimalTest.java similarity index 96% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T11PartUndecimalTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T11PartUndecimalTest.java index 17df5b7f..dfa4fe7a 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T11PartUndecimalTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T11PartUndecimalTest.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.numberxd.base2t; +package love.distributedrebirth.numberxd.base2t.part; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T12PartUncialTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T12PartUncialTest.java similarity index 96% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T12PartUncialTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T12PartUncialTest.java index 293fd963..06eec997 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T12PartUncialTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T12PartUncialTest.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.numberxd.base2t; +package love.distributedrebirth.numberxd.base2t.part; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T16PartHexTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T16PartHexTest.java similarity index 96% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T16PartHexTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T16PartHexTest.java index 35f8415f..be1a6ed2 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T16PartHexTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T16PartHexTest.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.numberxd.base2t; +package love.distributedrebirth.numberxd.base2t.part; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T20PartScoreTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T20PartScoreTest.java similarity index 97% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T20PartScoreTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T20PartScoreTest.java index debf2276..d0471fee 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T20PartScoreTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T20PartScoreTest.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.numberxd.base2t; +package love.distributedrebirth.numberxd.base2t.part; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T60SexagesimalTest.java b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T60SexagesimalTest.java similarity index 96% rename from gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T60SexagesimalTest.java rename to gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T60SexagesimalTest.java index 3b7c9a53..63bc236a 100644 --- a/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/T60SexagesimalTest.java +++ b/gdxapp4d-lib-numberxd/src/test/java/love/distributedrebirth/numberxd/base2t/part/T60SexagesimalTest.java @@ -1,4 +1,4 @@ -package love.distributedrebirth.numberxd.base2t; +package love.distributedrebirth.numberxd.base2t.part; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test;