From 4b8439a55cf76115cf011cc3bf90e071aa6baca4 Mon Sep 17 00:00:00 2001 From: Willem Date: Sat, 28 Dec 2024 02:45:26 +0100 Subject: [PATCH] Used normal static code WarpManifestorDriver --- .../nx01/king/java3seed/Java3Seed.java | 18 ++-- .../sitra/ZilLaLaManyfestoGrowlFactory.java | 4 +- .../nx01/warp/fault/FaultSignalTraceTest.java | 5 +- .../warp/manifestor/WarpManifestorDriver.java | 84 ++++++++++--------- .../manifest/WarpManifestX0TheMimeType.java | 4 +- .../manifest/WarpManifestX18Import.java | 3 + .../manifestor/WarpManifestChinaTest.java | 8 +- .../manifestor/WarpManifestorDriverTest.java | 16 ++-- .../manifestor/WarpManifestorVIniTest.java | 14 ++-- .../manifest/WarpManifestBigBodyTest.java | 14 ++-- .../manifest/WarpManifestBodyIllegalTest.java | 18 ++-- .../manifest/WarpManifestNameDupTest.java | 28 +++---- .../manifest/WarpManifestNameEmptyTest.java | 10 +-- .../WarpManifestNameForbidCharTest.java | 24 +++--- .../manifest/WarpManifestNameLimitTest.java | 12 +-- .../WarpManifestNameSeperatorTest.java | 12 +-- .../manifest/WarpManifestNameUnicodeTest.java | 18 ++-- .../WarpManifestSectionNameEmptyTest.java | 10 +-- .../server/web/ZilLaLaFaultFilter.java | 2 +- 19 files changed, 156 insertions(+), 148 deletions(-) diff --git a/nx01-king-java3seed/src/main/java/love/distributedrebirth/nx01/king/java3seed/Java3Seed.java b/nx01-king-java3seed/src/main/java/love/distributedrebirth/nx01/king/java3seed/Java3Seed.java index c9528ab..fd45420 100644 --- a/nx01-king-java3seed/src/main/java/love/distributedrebirth/nx01/king/java3seed/Java3Seed.java +++ b/nx01-king-java3seed/src/main/java/love/distributedrebirth/nx01/king/java3seed/Java3Seed.java @@ -72,7 +72,8 @@ import love.distributedrebirth.nx01.warp.fault.BassFaultAnchor; import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver; import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8; import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0TheMimeType; - +import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX18; +import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX18Import; import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注; @DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天") @@ -263,14 +264,17 @@ public class Java3Seed extends PrintStream { if (file.equals("/META-INF/MANIFEST.MF")) { System.out.println("jar: " + jar.getName()); InputStream in = jar.get(path).getAsset().openStream(); - WarpManifestX8 manifest = WarpManifestorDriver.亞.readV1Stream(in); + WarpManifestX8 manifestX8 = WarpManifestorDriver.readV1Stream(in); in.close(); jar.delete(path); - manifest.withAttribute("Manifest-Toilet-Cleaned-By", Java3Seed.class.getName()); - manifest.withAttribute("Manifest-Toilet-Cleaned-Date", toiletCleanDate); - jar.add(new StringAsset(WarpManifestorDriver.亞.writeV1String(manifest)), "/META-INF/"+WarpManifestX0TheMimeType.MANIFEST_1.getQFileName()); - jar.add(new StringAsset(WarpManifestorDriver.亞.writeV2String(manifest)), "/META-INF/"+WarpManifestX0TheMimeType.MANIFEST_2.getQFileName()); - jar.add(new ByteArrayAsset(WarpManifestorDriver.亞.writeV3Array(manifest)), "/META-INF/"+WarpManifestX0TheMimeType.MANIFEST_3.getQFileName()); + manifestX8.withAttribute("Manifest-Toilet-Cleaned-By", Java3Seed.class.getName()); + manifestX8.withAttribute("Manifest-Toilet-Cleaned-Date", toiletCleanDate); + WarpManifestX18 manifestX18 = WarpManifestX18Import.fromX8(manifestX8); + jar.add(new StringAsset(WarpManifestorDriver.writeV1String(manifestX8)), "/META-INF/"+WarpManifestX0TheMimeType.MANIFEST_1.getQFileName()); + jar.add(new StringAsset(WarpManifestorDriver.writeV2String(manifestX8)), "/META-INF/"+WarpManifestX0TheMimeType.MANIFEST_2.getQFileName()); + jar.add(new ByteArrayAsset(WarpManifestorDriver.writeV3Array(manifestX8)), "/META-INF/"+WarpManifestX0TheMimeType.MANIFEST_3.getQFileName()); + jar.add(new ByteArrayAsset(WarpManifestorDriver.writeV4Array(manifestX18)), "/META-INF/"+WarpManifestX0TheMimeType.MANIFEST_4.getQFileName()); + jar.add(new ByteArrayAsset(WarpManifestorDriver.writeV5Array(manifestX8)), "/META-INF/"+WarpManifestX0TheMimeType.MANIFEST_5.getQFileName()); convertedManifests++; } } diff --git a/nx01-warp-fault/src/main/java/love/distributedrebirth/nx01/warp/fault/sitra/ZilLaLaManyfestoGrowlFactory.java b/nx01-warp-fault/src/main/java/love/distributedrebirth/nx01/warp/fault/sitra/ZilLaLaManyfestoGrowlFactory.java index ec2901c..8d21964 100644 --- a/nx01-warp-fault/src/main/java/love/distributedrebirth/nx01/warp/fault/sitra/ZilLaLaManyfestoGrowlFactory.java +++ b/nx01-warp-fault/src/main/java/love/distributedrebirth/nx01/warp/fault/sitra/ZilLaLaManyfestoGrowlFactory.java @@ -54,13 +54,13 @@ public enum ZilLaLaManyfestoGrowlFactory { buf.append(")"); } buf.append(VALUE_WHITE_SPACE); - buf.append(WarpManifestorDriver.亞.writeV2String(manifest)); + buf.append(WarpManifestorDriver.writeV2String(manifest)); return buf.toString(); } @Deprecated public String buildFaultScreamBase64(WarpManifestX8 manifest, BassFaultAnchor fault) { - byte[] traceManifestBytes = WarpManifestorDriver.亞.writeV3Array(manifest); // TODO: Upgrade to version 6 or 7 ?? + byte[] traceManifestBytes = WarpManifestorDriver.writeV3Array(manifest); // TODO: Upgrade to version 6 or 7 ?? String trace64 = Base64.getEncoder().encodeToString(traceManifestBytes); // FIXME: report as "normal" text in nostr event StringBuilder buf = new StringBuilder(); // TODO: Move base data uri + nostr data uri to provider interface diff --git a/nx01-warp-fault/src/test/java/love/distributedrebirth/nx01/warp/fault/FaultSignalTraceTest.java b/nx01-warp-fault/src/test/java/love/distributedrebirth/nx01/warp/fault/FaultSignalTraceTest.java index 22f0ab8..66701f2 100644 --- a/nx01-warp-fault/src/test/java/love/distributedrebirth/nx01/warp/fault/FaultSignalTraceTest.java +++ b/nx01-warp-fault/src/test/java/love/distributedrebirth/nx01/warp/fault/FaultSignalTraceTest.java @@ -30,9 +30,6 @@ package love.distributedrebirth.nx01.warp.fault; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import love.distributedrebirth.nx01.warp.fault.BassFaultAnchor; -import love.distributedrebirth.nx01.warp.fault.FaultBeanInstantiation; -import love.distributedrebirth.nx01.warp.fault.FaultBeanState; import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver; import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8; @@ -114,7 +111,7 @@ public class FaultSignalTraceTest { Assertions.assertNotNull(error); Assertions.assertNotNull(error.getMessage()); WarpManifestX8 manifest = error.toZilLaLaManyfesto(); - String sitraText = WarpManifestorDriver.亞.writeV2String(manifest); + String sitraText = WarpManifestorDriver.writeV2String(manifest); //System.out.println(sitraText); Assertions.assertNotNull(sitraText); Assertions.assertTrue(sitraText.contains("Manifest")); diff --git a/nx01-warp-manifestor/src/main/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestorDriver.java b/nx01-warp-manifestor/src/main/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestorDriver.java index 6047c54..29af75c 100644 --- a/nx01-warp-manifestor/src/main/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestorDriver.java +++ b/nx01-warp-manifestor/src/main/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestorDriver.java @@ -67,22 +67,24 @@ import love.distributedrebirth.nx01.warp.manifestor.scopic.iomf5.ScopicManifest5 /// /// @author للَّٰهِilLצسُو /// @version ©Δ∞ 仙上主天 -public enum WarpManifestorDriver { - 亞; +public final class WarpManifestorDriver { - public WarpManifestX8 readV1String(String input) { + private WarpManifestorDriver() { + } + + static public WarpManifestX8 readV1String(String input) { return readV1Array(input.getBytes(StandardCharsets.UTF_8)); } - public WarpManifestX8 readV1Buffer(ByteBuffer input) { + static public WarpManifestX8 readV1Buffer(ByteBuffer input) { return readV1Array(input.array()); } - public WarpManifestX8 readV1Array(byte[] input) { + static public WarpManifestX8 readV1Array(byte[] input) { return readV1Stream(new ByteArrayInputStream(input)); } - public WarpManifestX8 readV1Stream(InputStream input) { + static public WarpManifestX8 readV1Stream(InputStream input) { WarpManifestX8 result = new WarpManifestX8(); ScopicManifestContentStringHandler handler = new ScopicManifestContentStringHandler(result, WarpManifestX0TheVersion.VERSION_1_0); ScopicManifestContentReader reader = new ScopicManifestContentReader(handler, ScopicManifestContentReader.FORCE_VERSION_1_0); @@ -94,19 +96,19 @@ public enum WarpManifestorDriver { return result; } - public WarpManifestX8 readV2String(String input) { + static public WarpManifestX8 readV2String(String input) { return readV2Array(input.getBytes(StandardCharsets.UTF_8)); } - public WarpManifestX8 readV2Buffer(ByteBuffer input) { + static public WarpManifestX8 readV2Buffer(ByteBuffer input) { return readV2Array(input.array()); } - public WarpManifestX8 readV2Array(byte[] input) { + static public WarpManifestX8 readV2Array(byte[] input) { return readV2Stream(new ByteArrayInputStream(input)); } - public WarpManifestX8 readV2Stream(InputStream input) { + static public WarpManifestX8 readV2Stream(InputStream input) { WarpManifestX8 result = new WarpManifestX8(); ScopicManifestContentStringHandler handler = new ScopicManifestContentStringHandler(result, WarpManifestX0TheVersion.VERSION_1_0, WarpManifestX0TheVersion.VERSION_2_0); ScopicManifestContentReader reader = new ScopicManifestContentReader(handler); @@ -118,15 +120,15 @@ public enum WarpManifestorDriver { return result; } - public WarpManifestX8 readV3Buffer(ByteBuffer input) { + static public WarpManifestX8 readV3Buffer(ByteBuffer input) { return readV3Array(input.array()); } - public WarpManifestX8 readV3Array(byte[] input) { + static public WarpManifestX8 readV3Array(byte[] input) { return readV3Stream(new ByteArrayInputStream(input)); } - public WarpManifestX8 readV3Stream(InputStream input) { + static public WarpManifestX8 readV3Stream(InputStream input) { WarpManifestX8 result = new WarpManifestX8(); ScopicManifestContentStringHandler handler = new ScopicManifestContentStringHandler(result, WarpManifestX0TheVersion.VERSION_3_0); ScopicManifest3ContentReader reader = new ScopicManifest3ContentReader(handler); @@ -144,15 +146,15 @@ public enum WarpManifestorDriver { return result; } - public WarpManifestX18 readV4Buffer(ByteBuffer input) { + static public WarpManifestX18 readV4Buffer(ByteBuffer input) { return readV4Array(input.array()); } - public WarpManifestX18 readV4Array(byte[] input) { + static public WarpManifestX18 readV4Array(byte[] input) { return readV4Stream(new ByteArrayInputStream(input)); } - public WarpManifestX18 readV4Stream(InputStream input) { + static public WarpManifestX18 readV4Stream(InputStream input) { WarpManifestX18 result = new WarpManifestX18(); ScopicManifest4ContentHandler handler = new ScopicManifest4ContentHandler(result); ScopicManifest4ContentReader reader = new ScopicManifest4ContentReader(handler); @@ -170,15 +172,15 @@ public enum WarpManifestorDriver { return result; } - public WarpManifestX8 readV5Buffer(ByteBuffer input) { + static public WarpManifestX8 readV5Buffer(ByteBuffer input) { return readV5Array(input.array()); } - public WarpManifestX8 readV5Array(byte[] input) { + static public WarpManifestX8 readV5Array(byte[] input) { return readV5Stream(new ByteArrayInputStream(input)); } - public WarpManifestX8 readV5Stream(InputStream input) { + static public WarpManifestX8 readV5Stream(InputStream input) { WarpManifestX8 result = new WarpManifestX8(); ScopicManifestContentStringHandler handler = new ScopicManifestContentStringHandler(result, WarpManifestX0TheVersion.VERSION_5_0); ScopicManifest5ContentParser contentParser = new ScopicManifest5ContentParser(handler); @@ -191,19 +193,19 @@ public enum WarpManifestorDriver { return result; } - public WarpManifestX8 readViniString(String input) { + static public WarpManifestX8 readViniString(String input) { return readViniArray(input.getBytes(StandardCharsets.UTF_8)); } - public WarpManifestX8 readViniBuffer(ByteBuffer input) { + static public WarpManifestX8 readViniBuffer(ByteBuffer input) { return readViniArray(input.array()); } - public WarpManifestX8 readViniArray(byte[] input) { + static public WarpManifestX8 readViniArray(byte[] input) { return readViniStream(new ByteArrayInputStream(input)); } - public WarpManifestX8 readViniStream(InputStream input) { + static public WarpManifestX8 readViniStream(InputStream input) { WarpManifestX8 result = new WarpManifestX8(); ScopicManifestContentStringHandler handler = new ScopicManifestContentStringHandler(result); ScopicIniContentReader reader = new ScopicIniContentReader(handler); @@ -217,45 +219,45 @@ public enum WarpManifestorDriver { // ================================================================================================================= - public String writeV1String(WarpManifestX8 manifest) { + static public String writeV1String(WarpManifestX8 manifest) { StringWriter writer = new StringWriter(); writeV1StreamChar(manifest, writer); return writer.toString(); } - public void writeV1Stream(WarpManifestX8 manifest, OutputStream output) { + static public void writeV1Stream(WarpManifestX8 manifest, OutputStream output) { writeV1StreamChar(manifest, new OutputStreamWriter(output, StandardCharsets.UTF_8)); } - public void writeV1StreamChar(WarpManifestX8 manifest, Writer output) { + static public void writeV1StreamChar(WarpManifestX8 manifest, Writer output) { ScopicManifestContentPulser.strobelight(manifest, new ScopicManifestContentWriter(output), WarpManifestX0TheVersion.VERSION_1_0.getQName()); } - public String writeV2String(WarpManifestX8 manifest) { + static public String writeV2String(WarpManifestX8 manifest) { StringWriter writer = new StringWriter(); writeV2StreamChar(manifest, writer); return writer.toString(); } - public void writeV2Stream(WarpManifestX8 manifest, OutputStream output) { + static public void writeV2Stream(WarpManifestX8 manifest, OutputStream output) { writeV2StreamChar(manifest, new OutputStreamWriter(output, StandardCharsets.UTF_8)); } - public void writeV2StreamChar(WarpManifestX8 manifest, Writer output) { + static public void writeV2StreamChar(WarpManifestX8 manifest, Writer output) { ScopicManifestContentPulser.strobelight(manifest, new ScopicManifestContentWriter(output), WarpManifestX0TheVersion.VERSION_2_0.getQName()); } - public ByteBuffer writeV3Buffer(WarpManifestX8 manifest) { + static public ByteBuffer writeV3Buffer(WarpManifestX8 manifest) { return ByteBuffer.wrap(writeV3Array(manifest)); } - public byte[] writeV3Array(WarpManifestX8 manifest) { + static public byte[] writeV3Array(WarpManifestX8 manifest) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); writeV3Stream(manifest, baos); return baos.toByteArray(); } - public void writeV3Stream(WarpManifestX8 manifest, OutputStream output) { + static public void writeV3Stream(WarpManifestX8 manifest, OutputStream output) { TLVChainSexTeenBit chain = new TLVChainSexTeenBit(); ScopicManifestContentPulser.strobelight(manifest, new ScopicManifest3ContentWriter(chain), WarpManifestX0TheVersion.VERSION_3_0.getQName()); try { @@ -266,17 +268,17 @@ public enum WarpManifestorDriver { } } - public ByteBuffer writeV4Buffer(WarpManifestX18 manifest) { + static public ByteBuffer writeV4Buffer(WarpManifestX18 manifest) { return ByteBuffer.wrap(writeV4Array(manifest)); } - public byte[] writeV4Array(WarpManifestX18 manifest) { + static public byte[] writeV4Array(WarpManifestX18 manifest) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); writeV4Stream(manifest, baos); return baos.toByteArray(); } - public void writeV4Stream(WarpManifestX18 manifest, OutputStream output) { + static public void writeV4Stream(WarpManifestX18 manifest, OutputStream output) { TLVChainOctalSex chain = new TLVChainOctalSex(); ScopicManifestContentPulser.strobelight(manifest, new ScopicManifest4ContentWriter(chain), WarpManifestX0TheVersion.VERSION_4_0); try { @@ -287,33 +289,33 @@ public enum WarpManifestorDriver { } } - public ByteBuffer writeV5Buffer(WarpManifestX8 manifest) { + static public ByteBuffer writeV5Buffer(WarpManifestX8 manifest) { return ByteBuffer.wrap(writeV5Array(manifest)); } - public byte[] writeV5Array(WarpManifestX8 manifest) { + static public byte[] writeV5Array(WarpManifestX8 manifest) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); writeV5Stream(manifest, baos); return baos.toByteArray(); } - public void writeV5Stream(WarpManifestX8 manifest, OutputStream output) { + static public void writeV5Stream(WarpManifestX8 manifest, OutputStream output) { XDBXWriterXml writerXml = new XDBXWriterXml(output); ScopicManifest5ContentWriter writer = new ScopicManifest5ContentWriter(writerXml); ScopicManifestContentPulser.strobelight(manifest, writer, WarpManifestX0TheVersion.VERSION_5_0.getQName()); } - public String writeViniString(WarpManifestX8 manifest) { + static public String writeViniString(WarpManifestX8 manifest) { StringWriter writer = new StringWriter(); writeViniStreamChar(manifest, writer); return writer.toString(); } - public void writeViniStream(WarpManifestX8 manifest, OutputStream output) { + static public void writeViniStream(WarpManifestX8 manifest, OutputStream output) { writeViniStreamChar(manifest, new OutputStreamWriter(output, StandardCharsets.UTF_8)); } - public void writeViniStreamChar(WarpManifestX8 manifest, Writer output) { + static public void writeViniStreamChar(WarpManifestX8 manifest, Writer output) { ScopicManifestContentPulser.strobelight(manifest, new ScopicIniContentWriter(output), ScopicIniConstants.VERSION_NEW_TESTAMENT); } } diff --git a/nx01-warp-manifestor/src/main/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestX0TheMimeType.java b/nx01-warp-manifestor/src/main/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestX0TheMimeType.java index 8221243..b9f6887 100644 --- a/nx01-warp-manifestor/src/main/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestX0TheMimeType.java +++ b/nx01-warp-manifestor/src/main/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestX0TheMimeType.java @@ -33,6 +33,8 @@ import java.io.OutputStream; import java.util.Arrays; import java.util.Optional; +import org.x4o.o2o.io.sax3.xdbx.XDBXConstants; + import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException; /// Warp manifest 0 bit schema of the mime types and magic markers. @@ -45,7 +47,7 @@ public enum WarpManifestX0TheMimeType { MANIFEST_2 ("application/manifest2", "MF2", null), MANIFEST_3 ("application/manifest3", "MF3", new byte[] {0x4d,0x53,0x58,0x33,0x4d,0x46,0x30,0x42}), MANIFEST_4 ("application/manifest4", "MF4", new byte[] {0x4d,0x53,0x58,0x34,0x4d,0x53,0x58,0x34,0x2d,0x2d,0x4d,0x46,0x31,0x38,0x4d,0x46,0x31,0x38}), - //MANIFEST_5 ("application/manifest5", "MF5", null), + MANIFEST_5 ("application/manifest5", "MF5", XDBXConstants.HEADER_MARKER), // FIXME: marker is not yet used here //MANIFEST_6 ("application/manifest6", "MF6", null), //MANIFEST_7 ("application/manifest7", "MF7", null), ; diff --git a/nx01-warp-manifestor/src/main/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestX18Import.java b/nx01-warp-manifestor/src/main/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestX18Import.java index 997618b..6a31452 100644 --- a/nx01-warp-manifestor/src/main/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestX18Import.java +++ b/nx01-warp-manifestor/src/main/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestX18Import.java @@ -39,6 +39,9 @@ import org.x4o.o2o.octal.PrimordialOctalOrangeString; /// @version ©Δ∞ 仙上主天 public final class WarpManifestX18Import { + private WarpManifestX18Import() { + } + static public WarpManifestX18 fromX8(WarpManifestX8 manifest) { WarpManifestX18 result = new WarpManifestX18(); for (WarpManifestX8HeaderField attr : manifest.getAttributes()) { diff --git a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestChinaTest.java b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestChinaTest.java index 6ae0dae..f14b14c 100644 --- a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestChinaTest.java +++ b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestChinaTest.java @@ -201,14 +201,14 @@ public class WarpManifestChinaTest { section.withAttribute("七號線", "不得不服從"); section.withAttribute("八號線", "在正義中。"); - String outputV2 = WarpManifestorDriver.亞.writeV2String(manifest); + String outputV2 = WarpManifestorDriver.writeV2String(manifest); Assertions.assertNotNull(outputV2); - String outputIni = WarpManifestorDriver.亞.writeViniString(new WarpManifestX8().withSections(manifest.getSections())); // removes main attributes + String outputIni = WarpManifestorDriver.writeViniString(new WarpManifestX8().withSections(manifest.getSections())); // removes main attributes Assertions.assertNotNull(outputIni); - byte[] outputV5 = WarpManifestorDriver.亞.writeV5Array(manifest); + byte[] outputV5 = WarpManifestorDriver.writeV5Array(manifest); Assertions.assertNotNull(outputV5); - WarpManifestX8 manifestV5 = WarpManifestorDriver.亞.readV5Array(outputV5); + WarpManifestX8 manifestV5 = WarpManifestorDriver.readV5Array(outputV5); StringWriter outputXml = new StringWriter(); ContentWriterXml writerXml = new ContentWriterXml(outputXml); ScopicManifest5ContentWriter writer = new ScopicManifest5ContentWriter(writerXml); diff --git a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestorDriverTest.java b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestorDriverTest.java index d6cea96..0aaedb9 100644 --- a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestorDriverTest.java +++ b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestorDriverTest.java @@ -45,7 +45,7 @@ public class WarpManifestorDriverTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.makeAttribute("foo", "bar"); manifest.makeSection("my1").withAttribute("foo1", "bar1"); - String output = WarpManifestorDriver.亞.writeV1String(manifest); + String output = WarpManifestorDriver.writeV1String(manifest); Assertions.assertNotNull(output); Assertions.assertTrue(output.contains("foo1")); } @@ -54,7 +54,7 @@ public class WarpManifestorDriverTest { public void testLineWrapAsLastLine() { String checkWrap = "https://github.com/shrinkwrap/resolver/shrinkwrap-resolver-spi-maven-archive"; String checkWrapLast = "http://www.jboss.org/shrinkwrap-resolver-parent/shrinkwrap-resolver-spi-maven-archive"; - WarpManifestX8 manitest = WarpManifestorDriver.亞.readV1Stream(getClass().getResourceAsStream("test-line-wrap.mf")); + WarpManifestX8 manitest = WarpManifestorDriver.readV1Stream(getClass().getResourceAsStream("test-line-wrap.mf")); Assertions.assertNotNull(manitest); Assertions.assertEquals(21, manitest.getAttributes().size()); Assertions.assertEquals("Implementation-Title", manitest.getAttributes().get(0).getName()); @@ -64,16 +64,16 @@ public class WarpManifestorDriverTest { @Test public void testSizeOfVersions() { - WarpManifestX8 manitest = WarpManifestorDriver.亞.readV1Stream(getClass().getResourceAsStream("test-line-wrap.mf")); + WarpManifestX8 manitest = WarpManifestorDriver.readV1Stream(getClass().getResourceAsStream("test-line-wrap.mf")); Assertions.assertNotNull(manitest); WarpManifestX18 manitestX18 = WarpManifestX18Import.fromX8(manitest); Assertions.assertNotNull(manitestX18); System.out.println("size-OF: " + manitest.getAttributeBodyNullable("Implementation-Vendor-Id")); - System.out.println("size-V1: " + WarpManifestorDriver.亞.writeV1String(manitest).getBytes(StandardCharsets.UTF_8).length); - System.out.println("size-V2: " + WarpManifestorDriver.亞.writeV2String(manitest).getBytes(StandardCharsets.UTF_8).length); - System.out.println("size-V3: " + WarpManifestorDriver.亞.writeV3Array(manitest).length); - System.out.println("size-V4: " + WarpManifestorDriver.亞.writeV4Array(manitestX18).length); - System.out.println("size-V5: " + WarpManifestorDriver.亞.writeV5Array(manitest).length); + System.out.println("size-V1: " + WarpManifestorDriver.writeV1String(manitest).getBytes(StandardCharsets.UTF_8).length); + System.out.println("size-V2: " + WarpManifestorDriver.writeV2String(manitest).getBytes(StandardCharsets.UTF_8).length); + System.out.println("size-V3: " + WarpManifestorDriver.writeV3Array(manitest).length); + System.out.println("size-V4: " + WarpManifestorDriver.writeV4Array(manitestX18).length); + System.out.println("size-V5: " + WarpManifestorDriver.writeV5Array(manitest).length); } } diff --git a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestorVIniTest.java b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestorVIniTest.java index 9d03e16..6cf3542 100644 --- a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestorVIniTest.java +++ b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/WarpManifestorVIniTest.java @@ -38,17 +38,17 @@ public class WarpManifestorVIniTest { @Test public void testViniReadSystemdService() { - WarpManifestX8 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-ntp.service")); + WarpManifestX8 manitest = WarpManifestorDriver.readViniStream(getClass().getResourceAsStream("ini/test-ntp.service")); Assertions.assertNotNull(manitest); Assertions.assertEquals(3, manitest.getSections().size()); Assertions.assertEquals("Network Time Service", manitest.getSectionAttributeBodyNullable("Unit", "Description")); Assertions.assertEquals("man:ntpd(8)", manitest.getSectionAttributeBodyNullable("Unit", "Documentation")); - //System.out.println(WarpManifestorDriver.亞.writeViniString(manitest)); + //System.out.println(WarpManifestorDriver.writeViniString(manitest)); } @Test public void testViniReadSimple() { - WarpManifestX8 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-simple.ini")); + WarpManifestX8 manitest = WarpManifestorDriver.readViniStream(getClass().getResourceAsStream("ini/test-simple.ini")); Assertions.assertNotNull(manitest); Assertions.assertEquals(3, manitest.getSections().size()); @@ -69,7 +69,7 @@ public class WarpManifestorVIniTest { @Test public void testViniReadFruitFolding() { - WarpManifestX8 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-fruit-folding.ini")); + WarpManifestX8 manitest = WarpManifestorDriver.readViniStream(getClass().getResourceAsStream("ini/test-fruit-folding.ini")); Assertions.assertNotNull(manitest); Assertions.assertEquals(6, manitest.getSections().size()); @@ -93,9 +93,9 @@ public class WarpManifestorVIniTest { @Test public void testViniWriteFruitFolding() { - WarpManifestX8 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-fruit-folding.ini")); + WarpManifestX8 manitest = WarpManifestorDriver.readViniStream(getClass().getResourceAsStream("ini/test-fruit-folding.ini")); Assertions.assertNotNull(manitest); - String strini = WarpManifestorDriver.亞.writeViniString(manitest); + String strini = WarpManifestorDriver.writeViniString(manitest); Assertions.assertTrue(strini.contains("target region = Bay Area")); Assertions.assertTrue(strini.contains("# TODO: advertise vacant positions")); Assertions.assertTrue(strini.contains("Trademark Issues = truly unlikely")); @@ -107,7 +107,7 @@ public class WarpManifestorVIniTest { @Test public void testViniReadEscQuote() { - WarpManifestX8 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-esc-quote.ini")); + WarpManifestX8 manitest = WarpManifestorDriver.readViniStream(getClass().getResourceAsStream("ini/test-esc-quote.ini")); Assertions.assertNotNull(manitest); Assertions.assertEquals(3, manitest.getSections().size()); diff --git a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestBigBodyTest.java b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestBigBodyTest.java index d94a526..6780ff5 100644 --- a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestBigBodyTest.java +++ b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestBigBodyTest.java @@ -47,7 +47,7 @@ public class WarpManifestBigBodyTest { } WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("long-longer-longggger", buf.toString()); - String output = WarpManifestorDriver.亞.writeV1String(manifest); + String output = WarpManifestorDriver.writeV1String(manifest); Assertions.assertNotNull(output); String lines[] = output.split("\n"); Assertions.assertEquals(31, lines.length); @@ -63,15 +63,15 @@ public class WarpManifestBigBodyTest { } WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("long-longer-longggger", buf.toString()); - String output = WarpManifestorDriver.亞.writeV2String(manifest); + String output = WarpManifestorDriver.writeV2String(manifest); Assertions.assertNotNull(output); String lines[] = output.split("\n"); Assertions.assertEquals(2, lines.length); Assertions.assertEquals(21, lines[0].length()); Assertions.assertEquals(2071, lines[1].getBytes(StandardCharsets.UTF_8).length); - String outputV1 = WarpManifestorDriver.亞.writeV1String(manifest); - WarpManifestX8 manitestV1 = WarpManifestorDriver.亞.readV2String(outputV1); + String outputV1 = WarpManifestorDriver.writeV1String(manifest); + WarpManifestX8 manitestV1 = WarpManifestorDriver.readV2String(outputV1); Assertions.assertNotNull(manitestV1); Assertions.assertEquals(1, manitestV1.getAttributes().size()); } @@ -84,13 +84,13 @@ public class WarpManifestBigBodyTest { } WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("limit-lines", buf.toString()); - byte[] output = WarpManifestorDriver.亞.writeV3Array(manifest); + byte[] output = WarpManifestorDriver.writeV3Array(manifest); Assertions.assertNotNull(output); - WarpManifestX8 manifestClone = WarpManifestorDriver.亞.readV3Array(output); + WarpManifestX8 manifestClone = WarpManifestorDriver.readV3Array(output); Assertions.assertEquals(manifest.getAttributes().get(0).getBody(), manifestClone.getAttributes().get(0).getBody()); Assertions.assertThrows(ScopicManifestException.class, () -> { manifest.withAttribute("limit-lines", "1" + buf.toString()); - WarpManifestorDriver.亞.writeV3Array(manifest); + WarpManifestorDriver.writeV3Array(manifest); }); } } diff --git a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestBodyIllegalTest.java b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestBodyIllegalTest.java index 137e674..2f7044a 100644 --- a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestBodyIllegalTest.java +++ b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestBodyIllegalTest.java @@ -42,7 +42,7 @@ public class WarpManifestBodyIllegalTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo", "bar\n"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); }); } @@ -51,7 +51,7 @@ public class WarpManifestBodyIllegalTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo", "bar\r"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); }); } @@ -60,7 +60,7 @@ public class WarpManifestBodyIllegalTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo", "bar\u0000"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); }); } @@ -69,7 +69,7 @@ public class WarpManifestBodyIllegalTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo", "bar\n"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV2String(manifest); + WarpManifestorDriver.writeV2String(manifest); }); } @@ -78,7 +78,7 @@ public class WarpManifestBodyIllegalTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo", "bar\r"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV2String(manifest); + WarpManifestorDriver.writeV2String(manifest); }); } @@ -87,7 +87,7 @@ public class WarpManifestBodyIllegalTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo", "bar\u0000"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV2String(manifest); + WarpManifestorDriver.writeV2String(manifest); }); } @@ -96,7 +96,7 @@ public class WarpManifestBodyIllegalTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo", "bar\n"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV3Array(manifest); + WarpManifestorDriver.writeV3Array(manifest); }); } @@ -105,7 +105,7 @@ public class WarpManifestBodyIllegalTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo", "bar\r"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV3Array(manifest); + WarpManifestorDriver.writeV3Array(manifest); }); } @@ -114,7 +114,7 @@ public class WarpManifestBodyIllegalTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo", "bar\u0000"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV3Array(manifest); + WarpManifestorDriver.writeV3Array(manifest); }); } } diff --git a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameDupTest.java b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameDupTest.java index 2bb149c..5a0dc37 100644 --- a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameDupTest.java +++ b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameDupTest.java @@ -46,7 +46,7 @@ public class WarpManifestNameDupTest { manifest.withAttribute("foo", "bar1"); manifest.withAttribute("foo", "bar2"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); }); } @@ -56,7 +56,7 @@ public class WarpManifestNameDupTest { manifest.makeSection("junit"); manifest.makeSection("junit"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); }); } @@ -65,7 +65,7 @@ public class WarpManifestNameDupTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.makeSection("junit").withAttribute("foo", "bar1").withAttribute("foo", "bar1"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); }); } @@ -75,7 +75,7 @@ public class WarpManifestNameDupTest { manifest.withAttribute("foo", "bar1"); manifest.withAttribute("foo", "bar2"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV2String(manifest); + WarpManifestorDriver.writeV2String(manifest); }); } @@ -85,7 +85,7 @@ public class WarpManifestNameDupTest { manifest.makeSection("junit"); manifest.makeSection("junit"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV2String(manifest); + WarpManifestorDriver.writeV2String(manifest); }); } @@ -94,7 +94,7 @@ public class WarpManifestNameDupTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.makeSection("junit").withAttribute("foo", "bar1").withAttribute("foo", "bar1"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV2String(manifest); + WarpManifestorDriver.writeV2String(manifest); }); } @@ -104,7 +104,7 @@ public class WarpManifestNameDupTest { manifest.withAttribute("foo", "bar1"); manifest.withAttribute("foo", "bar2"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV3Array(manifest); + WarpManifestorDriver.writeV3Array(manifest); }); } @@ -114,7 +114,7 @@ public class WarpManifestNameDupTest { manifest.makeSection("junit"); manifest.makeSection("junit"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV3Array(manifest); + WarpManifestorDriver.writeV3Array(manifest); }); } @@ -123,7 +123,7 @@ public class WarpManifestNameDupTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.makeSection("junit").withAttribute("foo", "bar1").withAttribute("foo", "bar1"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV3Array(manifest); + WarpManifestorDriver.writeV3Array(manifest); }); } @@ -133,7 +133,7 @@ public class WarpManifestNameDupTest { manifest.withAttribute(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3))); manifest.withAttribute(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3))); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV4Array(manifest); + WarpManifestorDriver.writeV4Array(manifest); }); } @@ -143,7 +143,7 @@ public class WarpManifestNameDupTest { manifest.makeSection(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3))); manifest.makeSection(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3))); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV4Array(manifest); + WarpManifestorDriver.writeV4Array(manifest); }); } @@ -154,7 +154,7 @@ public class WarpManifestNameDupTest { .withAttribute(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3))) .withAttribute(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3))); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV4Array(manifest); + WarpManifestorDriver.writeV4Array(manifest); }); } @@ -164,7 +164,7 @@ public class WarpManifestNameDupTest { manifest.makeSection("junit"); manifest.makeSection("junit"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV5Array(manifest); + WarpManifestorDriver.writeV5Array(manifest); }); } @@ -173,7 +173,7 @@ public class WarpManifestNameDupTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.makeSection("junit").withAttribute("foo", "bar1").withAttribute("foo", "bar1"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV5Array(manifest); + WarpManifestorDriver.writeV5Array(manifest); }); } } diff --git a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameEmptyTest.java b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameEmptyTest.java index 02d790e..61f3981 100644 --- a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameEmptyTest.java +++ b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameEmptyTest.java @@ -45,7 +45,7 @@ public class WarpManifestNameEmptyTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); }); } @@ -54,7 +54,7 @@ public class WarpManifestNameEmptyTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV2String(manifest); + WarpManifestorDriver.writeV2String(manifest); }); } @@ -63,7 +63,7 @@ public class WarpManifestNameEmptyTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV3Array(manifest); + WarpManifestorDriver.writeV3Array(manifest); }); } @@ -72,7 +72,7 @@ public class WarpManifestNameEmptyTest { WarpManifestX18 manifest = new WarpManifestX18(); manifest.withAttribute(PrimordialOctalOrangeString.valueOfEmpty(), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(12,34))); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV4Array(manifest); + WarpManifestorDriver.writeV4Array(manifest); }); } @@ -81,7 +81,7 @@ public class WarpManifestNameEmptyTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV5Array(manifest); + WarpManifestorDriver.writeV5Array(manifest); }); } } diff --git a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameForbidCharTest.java b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameForbidCharTest.java index 9c43076..f25eb63 100644 --- a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameForbidCharTest.java +++ b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameForbidCharTest.java @@ -42,7 +42,7 @@ public class WarpManifestNameForbidCharTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo\n", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); }); } @@ -51,7 +51,7 @@ public class WarpManifestNameForbidCharTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo\r", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); }); } @@ -60,7 +60,7 @@ public class WarpManifestNameForbidCharTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo\u0000", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); }); } @@ -69,7 +69,7 @@ public class WarpManifestNameForbidCharTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo\n", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV2String(manifest); + WarpManifestorDriver.writeV2String(manifest); }); } @@ -78,7 +78,7 @@ public class WarpManifestNameForbidCharTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo\r", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV2String(manifest); + WarpManifestorDriver.writeV2String(manifest); }); } @@ -87,7 +87,7 @@ public class WarpManifestNameForbidCharTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo\u0000", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV2String(manifest); + WarpManifestorDriver.writeV2String(manifest); }); } @@ -96,7 +96,7 @@ public class WarpManifestNameForbidCharTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo\n", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV3Array(manifest); + WarpManifestorDriver.writeV3Array(manifest); }); } @@ -105,7 +105,7 @@ public class WarpManifestNameForbidCharTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo\r", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV3Array(manifest); + WarpManifestorDriver.writeV3Array(manifest); }); } @@ -114,7 +114,7 @@ public class WarpManifestNameForbidCharTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo\u0000", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV3Array(manifest); + WarpManifestorDriver.writeV3Array(manifest); }); } @@ -123,7 +123,7 @@ public class WarpManifestNameForbidCharTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo\n", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV5Array(manifest); + WarpManifestorDriver.writeV5Array(manifest); }); } @@ -132,7 +132,7 @@ public class WarpManifestNameForbidCharTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo\r", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV5Array(manifest); + WarpManifestorDriver.writeV5Array(manifest); }); } @@ -141,7 +141,7 @@ public class WarpManifestNameForbidCharTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo\u0000", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV5Array(manifest); + WarpManifestorDriver.writeV5Array(manifest); }); } } diff --git a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameLimitTest.java b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameLimitTest.java index 6340b04..a0bbf24 100644 --- a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameLimitTest.java +++ b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameLimitTest.java @@ -45,10 +45,10 @@ public class WarpManifestNameLimitTest { } WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute(buf.toString(), "foo"); - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); Assertions.assertThrows(ScopicManifestException.class, () -> { manifest.withAttribute(buf.toString() + "1", "bar"); - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); }); } @@ -60,13 +60,13 @@ public class WarpManifestNameLimitTest { } WarpManifestX8 manifest = new WarpManifestX8(); manifest.makeAttribute(buf.toString(), "foo").withRemark("remarkable"); - String output = WarpManifestorDriver.亞.writeV2String(manifest); + String output = WarpManifestorDriver.writeV2String(manifest); Assertions.assertNotNull(output); Assertions.assertTrue(output.contains("foo")); Assertions.assertTrue(output.contains("remarkable")); Assertions.assertThrows(ScopicManifestException.class, () -> { manifest.withAttribute(buf.toString() + "1", "bar"); - WarpManifestorDriver.亞.writeV2String(manifest); + WarpManifestorDriver.writeV2String(manifest); }); } @@ -78,11 +78,11 @@ public class WarpManifestNameLimitTest { } WarpManifestX8 manifest = new WarpManifestX8(); manifest.makeAttribute(buf.toString(), "foo").withRemark("remarkable"); - byte[] output = WarpManifestorDriver.亞.writeV3Array(manifest); + byte[] output = WarpManifestorDriver.writeV3Array(manifest); Assertions.assertNotNull(output); Assertions.assertThrows(ScopicManifestException.class, () -> { manifest.withAttribute(buf.toString() + "1", "bar"); - WarpManifestorDriver.亞.writeV3Array(manifest); + WarpManifestorDriver.writeV3Array(manifest); }); } } diff --git a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameSeperatorTest.java b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameSeperatorTest.java index e9e8de0..672dfcb 100644 --- a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameSeperatorTest.java +++ b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameSeperatorTest.java @@ -42,7 +42,7 @@ public class WarpManifestNameSeperatorTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo:", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); }); } @@ -50,7 +50,7 @@ public class WarpManifestNameSeperatorTest { public void testWriteV2OutputSeperator() { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("ju n it:", "junit:"); - String output = WarpManifestorDriver.亞.writeV2String(manifest); + String output = WarpManifestorDriver.writeV2String(manifest); Assertions.assertNotNull(output); Assertions.assertTrue(output.contains("ju n it::")); Assertions.assertTrue(output.contains("junit:")); @@ -60,9 +60,9 @@ public class WarpManifestNameSeperatorTest { public void testWriteV3OutputSeperator() { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("ju n it:", "junit:"); - byte[] output = WarpManifestorDriver.亞.writeV3Array(manifest); + byte[] output = WarpManifestorDriver.writeV3Array(manifest); Assertions.assertNotNull(output); - WarpManifestX8 manitest = WarpManifestorDriver.亞.readV3Array(output); + WarpManifestX8 manitest = WarpManifestorDriver.readV3Array(output); Assertions.assertNotNull(manitest); Assertions.assertEquals(1, manitest.getAttributes().size()); Assertions.assertEquals("ju n it:", manitest.getAttributes().get(0).getName()); @@ -73,9 +73,9 @@ public class WarpManifestNameSeperatorTest { public void testWriteV5OutputSeperator() { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("ju n it:", "junit:"); - byte[] output = WarpManifestorDriver.亞.writeV5Array(manifest); + byte[] output = WarpManifestorDriver.writeV5Array(manifest); Assertions.assertNotNull(output); - WarpManifestX8 manitest = WarpManifestorDriver.亞.readV5Array(output); + WarpManifestX8 manitest = WarpManifestorDriver.readV5Array(output); Assertions.assertNotNull(manitest); Assertions.assertEquals(1, manitest.getAttributes().size()); Assertions.assertEquals("ju n it:", manitest.getAttributes().get(0).getName()); diff --git a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameUnicodeTest.java b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameUnicodeTest.java index 639b45b..8acd963 100644 --- a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameUnicodeTest.java +++ b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestNameUnicodeTest.java @@ -41,10 +41,10 @@ public class WarpManifestNameUnicodeTest { public void testWriteV1NameUnicode() { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo", "仙上主天"); - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); Assertions.assertThrows(ScopicManifestException.class, () -> { manifest.withAttribute("仙上主天", "bar"); - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); }); } @@ -53,21 +53,21 @@ public class WarpManifestNameUnicodeTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo", "仙上主天"); manifest.withAttribute("仙上主天", "bar"); - String output = WarpManifestorDriver.亞.writeV2String(manifest); + String output = WarpManifestorDriver.writeV2String(manifest); Assertions.assertNotNull(output); String lines[] = output.split("\n"); Assertions.assertEquals(3, lines.length); Assertions.assertEquals("foo: 仙上主天", lines[1]); Assertions.assertEquals("仙上主天: bar", lines[2]); - WarpManifestX8 manitest = WarpManifestorDriver.亞.readV2String(output); + WarpManifestX8 manitest = WarpManifestorDriver.readV2String(output); Assertions.assertNotNull(manitest); Assertions.assertEquals(2, manitest.getAttributes().size()); Assertions.assertEquals("foo", manitest.getAttributes().get(0).getName()); Assertions.assertEquals("仙上主天", manitest.getAttributes().get(1).getName()); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.readV1String(output); + WarpManifestorDriver.readV1String(output); }); } @@ -76,9 +76,9 @@ public class WarpManifestNameUnicodeTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo", "仙上主天"); manifest.withAttribute("仙上主天", "bar"); - byte[] output = WarpManifestorDriver.亞.writeV3Array(manifest); + byte[] output = WarpManifestorDriver.writeV3Array(manifest); Assertions.assertNotNull(output); - WarpManifestX8 manitest = WarpManifestorDriver.亞.readV3Array(output); + WarpManifestX8 manitest = WarpManifestorDriver.readV3Array(output); Assertions.assertNotNull(manitest); Assertions.assertEquals(2, manitest.getAttributes().size()); Assertions.assertEquals("foo", manitest.getAttributes().get(0).getName()); @@ -90,9 +90,9 @@ public class WarpManifestNameUnicodeTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.withAttribute("foo", "仙上主天"); manifest.withAttribute("仙上主天", "bar"); - byte[] output = WarpManifestorDriver.亞.writeV5Array(manifest); + byte[] output = WarpManifestorDriver.writeV5Array(manifest); Assertions.assertNotNull(output); - WarpManifestX8 manitest = WarpManifestorDriver.亞.readV5Array(output); + WarpManifestX8 manitest = WarpManifestorDriver.readV5Array(output); Assertions.assertNotNull(manitest); Assertions.assertEquals(2, manitest.getAttributes().size()); Assertions.assertEquals("foo", manitest.getAttributes().get(0).getName()); diff --git a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestSectionNameEmptyTest.java b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestSectionNameEmptyTest.java index 6398d3c..32f3995 100644 --- a/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestSectionNameEmptyTest.java +++ b/nx01-warp-manifestor/src/test/java/love/distributedrebirth/nx01/warp/manifestor/manifest/WarpManifestSectionNameEmptyTest.java @@ -45,7 +45,7 @@ public class WarpManifestSectionNameEmptyTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.makeSection("").withAttribute("foo", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV1String(manifest); + WarpManifestorDriver.writeV1String(manifest); }); } @@ -54,7 +54,7 @@ public class WarpManifestSectionNameEmptyTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.makeSection("").withAttribute("foo", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV2String(manifest); + WarpManifestorDriver.writeV2String(manifest); }); } @@ -63,7 +63,7 @@ public class WarpManifestSectionNameEmptyTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.makeSection("").withAttribute("foo", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV3Array(manifest); + WarpManifestorDriver.writeV3Array(manifest); }); } @@ -73,7 +73,7 @@ public class WarpManifestSectionNameEmptyTest { WarpManifestX18 manifest = new WarpManifestX18(); manifest.makeSection(PrimordialOctalOrangeString.valueOfEmpty()).withAttribute(foobar, foobar); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV4Array(manifest); + WarpManifestorDriver.writeV4Array(manifest); }); } @@ -82,7 +82,7 @@ public class WarpManifestSectionNameEmptyTest { WarpManifestX8 manifest = new WarpManifestX8(); manifest.makeSection("").withAttribute("foo", "bar"); Assertions.assertThrows(ScopicManifestException.class, () -> { - WarpManifestorDriver.亞.writeV5Array(manifest); + WarpManifestorDriver.writeV5Array(manifest); }); } } diff --git a/nx01-zerofungus-server/src/main/java/love/distributedrebirth/nx01/zerofungus/server/web/ZilLaLaFaultFilter.java b/nx01-zerofungus-server/src/main/java/love/distributedrebirth/nx01/zerofungus/server/web/ZilLaLaFaultFilter.java index 93bc27a..30652f3 100644 --- a/nx01-zerofungus-server/src/main/java/love/distributedrebirth/nx01/zerofungus/server/web/ZilLaLaFaultFilter.java +++ b/nx01-zerofungus-server/src/main/java/love/distributedrebirth/nx01/zerofungus/server/web/ZilLaLaFaultFilter.java @@ -72,7 +72,7 @@ public class ZilLaLaFaultFilter extends HttpFilter { res.setStatus(500); res.setContentType("text/plain"); PrintWriter out = res.getWriter(); - WarpManifestorDriver.亞.writeV2StreamChar(report, out); + WarpManifestorDriver.writeV2StreamChar(report, out); out.flush(); // logger.warning(fault.toStringZilLaLa());