Fixed warp-ship xml

This commit is contained in:
Willem Cazander 2022-02-24 02:37:00 +01:00
parent 41dc5bcc88
commit 0f33a5a77e
3 changed files with 36 additions and 2 deletions

View file

@ -33,7 +33,10 @@
description="Language namespace to store the warp ship."
name="WarpShip Language Namespace" id="boot">
<eld:element tag="ship"
objectClass="love.distributedrebirth.warpme.ship.WaterShip" />
objectClass="love.distributedrebirth.warpme.ship.WaterShip" >
<eld:attribute id="name" writeOrder="0"/>
<eld:attribute id="engine" writeOrder="1"/>
</eld:element>
<eld:element tag="ocean"
objectClass="love.distributedrebirth.warpme.ship.WaterShipOcean" />
</eld:namespace>

View file

@ -7,5 +7,5 @@
<driver language="warp-core" className="love.distributedrebirth.warpme.core.WaterBucketDriver"/>
<driver language="warp-hash" className="love.distributedrebirth.warpme.hash.WaterShotDriver"/>
<driver language="warp-sea" className="love.distributedrebirth.warpme.sea.WaterOceanDriver"/>
<driver language="warp-ship" className="love.distributedrebirth.warpme.sea.WaterDeviceDriver"/>
<driver language="warp-ship" className="love.distributedrebirth.warpme.ship.WaterDeviceDriver"/>
</drivers>

View file

@ -0,0 +1,31 @@
package love.distributedrebirth.warpme.ship;
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 WaterDeviceDriverTest {
@Test
public void testWaterDevice() throws X4OConnectionException, SAXException, IOException {
WaterDevice device = new WaterDevice();
WaterShip ship = new WaterShip();
ship.setName("tos4-mark1");
ship.setEngine("123349858934");
ship.addShipOcean(new WaterShipOcean("2349058490584"));
ship.addShipOcean(new WaterShipOcean("7867834823244"));
ship.addShipOcean(new WaterShipOcean("3948758927389"));
device.buildShip(ship);
Assertions.assertNotNull(device);
WaterDeviceDriver.newInstance().createWriter().writeFile(device, new java.io.File("build/out-ship.xml"));
}
}