From 569fc724c527ff88fcbc7b2a0cdcb08a4ebc854c Mon Sep 17 00:00:00 2001 From: Willem Date: Wed, 23 Feb 2022 20:45:23 +0100 Subject: [PATCH] Done warp sea and fixed warp core --- .../warpme/sea/WaterOcean.java | 10 ++-- .../warpme/sea/WaterOceanDriver.java | 2 +- .../warpme/sea/WaterSea.java | 5 +- .../warpme/sea/WaterSeaChain.java | 10 ++-- .../warpme/sea/WaterSeaMagic.java | 32 ++++++------- .../warpme/sea/WaterSeaMagicResource.java | 17 ------- .../META-INF/warp-core/warp-core-lang.eld | 20 ++++---- .../META-INF/warp-sea/warp-sea-lang.eld | 46 +++++++++++++++++++ .../META-INF/warp-sea/warp-sea-modules.xml | 10 ++++ .../warpme/core/WaterBucketDriverTest.java | 39 ++++++++++++++++ .../warpme/hash/WaterShotDriverTest.java | 2 +- .../warpme/sea/WaterOceanDriverTest.java | 32 +++++++++++++ 12 files changed, 168 insertions(+), 57 deletions(-) delete mode 100644 lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSeaMagicResource.java create mode 100644 lib-warpme/src/resources/META-INF/warp-sea/warp-sea-lang.eld create mode 100644 lib-warpme/src/resources/META-INF/warp-sea/warp-sea-modules.xml create mode 100644 lib-warpme/src/test/love/distributedrebirth/warpme/core/WaterBucketDriverTest.java create mode 100644 lib-warpme/src/test/love/distributedrebirth/warpme/sea/WaterOceanDriverTest.java diff --git a/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterOcean.java b/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterOcean.java index db553546..4366c426 100644 --- a/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterOcean.java +++ b/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterOcean.java @@ -5,13 +5,13 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class WaterOcean { - private WaterSea sea; + private WaterSea water; - public WaterSea theSea() { - return sea; + public WaterSea theWater() { + return water; } - public void setSea(WaterSea sea) { - this.sea = sea; + public void fillWater(WaterSea water) { + this.water = water; } } diff --git a/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterOceanDriver.java b/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterOceanDriver.java index 6ff1d882..34459e88 100644 --- a/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterOceanDriver.java +++ b/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterOceanDriver.java @@ -8,7 +8,7 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class WaterOceanDriver extends X4ODriver { - static final public String LANGUAGE_NAME = "warp-ocean"; + static final public String LANGUAGE_NAME = "warp-sea"; static final public String[] LANGUAGE_VERSIONS = new String[]{X4ODriver.DEFAULT_LANGUAGE_VERSION}; @Override diff --git a/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSea.java b/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSea.java index c65571c2..ed175283 100644 --- a/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSea.java +++ b/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSea.java @@ -1,5 +1,6 @@ package love.distributedrebirth.warpme.sea; +import java.util.ArrayList; import java.util.List; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; @@ -8,8 +9,8 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; public class WaterSea { private String name; - private List seaChains; - private List seaMagics; + private List seaChains = new ArrayList<>(); + private List seaMagics = new ArrayList<>(); public String getName() { return name; diff --git a/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSeaChain.java b/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSeaChain.java index edb80edf..891403f4 100644 --- a/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSeaChain.java +++ b/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSeaChain.java @@ -5,19 +5,19 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class WaterSeaChain { - private String path; private String key; private String tag; public WaterSeaChain() { } - public String getPath() { - return path; + public WaterSeaChain(String key) { + setKey(key); } - public void setPath(String path) { - this.path = path; + public WaterSeaChain(String key, String tag) { + setKey(key); + setTag(tag); } public String getKey() { diff --git a/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSeaMagic.java b/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSeaMagic.java index 4bdaab98..6d4e43f3 100644 --- a/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSeaMagic.java +++ b/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSeaMagic.java @@ -1,34 +1,34 @@ package love.distributedrebirth.warpme.sea; -import java.util.List; - import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class WaterSeaMagic { - private String magicMime; - private List resources; + private String mime; + private String file; - public String getMagicMime() { - return magicMime; + public WaterSeaMagic() { } - public void setMagicMime(String magicMime) { - this.magicMime = magicMime; + public WaterSeaMagic(String mime, String file) { + setMime(mime); + setFile(file); } - public List getResources() { - return resources; + public String getMime() { + return mime; } - public void setResources(List resources) { - for (WaterSeaMagicResource resource: resources) { - addResource(resource); - } + public void setMime(String mime) { + this.mime = mime; } - public void addResource(WaterSeaMagicResource resource) { - resources.add(resource); + public String getFile() { + return file; + } + + public void setFile(String file) { + this.file = file; } } diff --git a/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSeaMagicResource.java b/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSeaMagicResource.java deleted file mode 100644 index c7e9518d..00000000 --- a/lib-warpme/src/main/love/distributedrebirth/warpme/sea/WaterSeaMagicResource.java +++ /dev/null @@ -1,17 +0,0 @@ -package love.distributedrebirth.warpme.sea; - -import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; - -@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") -public class WaterSeaMagicResource { - - private String file; - - public String getFile() { - return file; - } - - public void setFile(String file) { - this.file = file; - } -} diff --git a/lib-warpme/src/resources/META-INF/warp-core/warp-core-lang.eld b/lib-warpme/src/resources/META-INF/warp-core/warp-core-lang.eld index 6f67b628..ed16313e 100644 --- a/lib-warpme/src/resources/META-INF/warp-core/warp-core-lang.eld +++ b/lib-warpme/src/resources/META-INF/warp-core/warp-core-lang.eld @@ -8,16 +8,16 @@ id="warp-core-module"> + objectClass="love.distributedrebirth.warpme.core.WaterBucket"/> + objectClass="love.distributedrebirth.warpme.core.WaterCipher" /> + objectClass="love.distributedrebirth.warpme.core.WaterCipherHeart" /> + objectClass="love.distributedrebirth.warpme.core.WaterCipherHeartTone" /> \ No newline at end of file diff --git a/lib-warpme/src/resources/META-INF/warp-sea/warp-sea-lang.eld b/lib-warpme/src/resources/META-INF/warp-sea/warp-sea-lang.eld new file mode 100644 index 00000000..66007769 --- /dev/null +++ b/lib-warpme/src/resources/META-INF/warp-sea/warp-sea-lang.eld @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib-warpme/src/resources/META-INF/warp-sea/warp-sea-modules.xml b/lib-warpme/src/resources/META-INF/warp-sea/warp-sea-modules.xml new file mode 100644 index 00000000..3bc251e2 --- /dev/null +++ b/lib-warpme/src/resources/META-INF/warp-sea/warp-sea-modules.xml @@ -0,0 +1,10 @@ + + + + warp-sea-lang.eld + + diff --git a/lib-warpme/src/test/love/distributedrebirth/warpme/core/WaterBucketDriverTest.java b/lib-warpme/src/test/love/distributedrebirth/warpme/core/WaterBucketDriverTest.java new file mode 100644 index 00000000..dc251cf2 --- /dev/null +++ b/lib-warpme/src/test/love/distributedrebirth/warpme/core/WaterBucketDriverTest.java @@ -0,0 +1,39 @@ +package love.distributedrebirth.warpme.core; + +import java.io.IOException; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.x4o.xml.io.X4OConnectionException; +import org.xml.sax.SAXException; + +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +public class WaterBucketDriverTest { + + + @Test + public void testWaterOcean() throws X4OConnectionException, SAXException, IOException { + + WaterBucket bucket = new WaterBucket(); + WaterCipher cipher = new WaterCipher(); + + bucket.fillWater(cipher); + cipher.setName("name"); + + WaterCipherHeartTone tone = new WaterCipherHeartTone(); + tone.setChinaKey("cn"); + tone.setDialTone("T1"); + tone.setPart("PART_0"); + tone.setChinaValue("china"); + + WaterCipherHeart heart = new WaterCipherHeart(); + heart.setBass(12345); + heart.addHeartTone(tone); + cipher.addCipherHeart(heart); + + Assertions.assertNotNull(bucket); + WaterBucketDriver.newInstance().createWriter().writeFile(bucket, new java.io.File("build/out-core.xml")); + } +} \ No newline at end of file diff --git a/lib-warpme/src/test/love/distributedrebirth/warpme/hash/WaterShotDriverTest.java b/lib-warpme/src/test/love/distributedrebirth/warpme/hash/WaterShotDriverTest.java index 6a97ec02..02b8c65f 100644 --- a/lib-warpme/src/test/love/distributedrebirth/warpme/hash/WaterShotDriverTest.java +++ b/lib-warpme/src/test/love/distributedrebirth/warpme/hash/WaterShotDriverTest.java @@ -21,6 +21,6 @@ public class WaterShotDriverTest { drugs.addSoftHash(new WaterSoftHash("test2.txt", "ASDFYYF234234SDFSDFASDFS")); Assertions.assertNotNull(drugs); - WaterShotDriver.newInstance().createWriter().writeFile(drugs, new java.io.File("build/output.xml")); + WaterShotDriver.newInstance().createWriter().writeFile(drugs, new java.io.File("build/out-hash.xml")); } } \ No newline at end of file diff --git a/lib-warpme/src/test/love/distributedrebirth/warpme/sea/WaterOceanDriverTest.java b/lib-warpme/src/test/love/distributedrebirth/warpme/sea/WaterOceanDriverTest.java new file mode 100644 index 00000000..76c25213 --- /dev/null +++ b/lib-warpme/src/test/love/distributedrebirth/warpme/sea/WaterOceanDriverTest.java @@ -0,0 +1,32 @@ +package love.distributedrebirth.warpme.sea; + +import java.io.IOException; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.x4o.xml.io.X4OConnectionException; +import org.xml.sax.SAXException; + +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +public class WaterOceanDriverTest { + + @Test + public void testWaterOcean() throws X4OConnectionException, SAXException, IOException { + WaterOcean ocean = new WaterOcean(); + WaterSea sea = new WaterSea(); + sea.setName("MyFirstSea"); + + ocean.fillWater(sea); + + sea.addSeaChain(new WaterSeaChain("2891738927138923")); + sea.addSeaChain(new WaterSeaChain("2389473875891293")); + + sea.addSeaMagic(new WaterSeaMagic("audio/mpegurl", "album/test.m3u")); + sea.addSeaMagic(new WaterSeaMagic("inode/directory", "album/")); + + Assertions.assertNotNull(ocean); + WaterOceanDriver.newInstance().createWriter().writeFile(ocean, new java.io.File("build/out-sea.xml")); + } +} \ No newline at end of file