diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.test/src/data/shiporder/shiporder.xml b/io/plugins/eu.esdihumboldt.hale.io.gml.test/src/data/shiporder/shiporder.xml index 776d5006a7..7e9c8186d7 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.test/src/data/shiporder/shiporder.xml +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.test/src/data/shiporder/shiporder.xml @@ -14,11 +14,16 @@ xsi:schemaLocation="http://www.example.com shiporder.xsd"> Empire Burlesque Special Edition 1 - 10.90 + 0E-11 Hide your heart 1 9.90 + 123 + 12.3 + 123.456 + 1234567890123456789 + 12345 \ No newline at end of file diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.test/src/data/shiporder/shiporder.xsd b/io/plugins/eu.esdihumboldt.hale.io.gml.test/src/data/shiporder/shiporder.xsd index e8f282e49d..3d649b00d9 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.test/src/data/shiporder/shiporder.xsd +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.test/src/data/shiporder/shiporder.xsd @@ -22,6 +22,11 @@ + + + + + diff --git a/io/plugins/eu.esdihumboldt.hale.io.gml.test/src/eu/esdihumboldt/hale/io/gml/reader/internal/GmlInstanceCollectionTest.java b/io/plugins/eu.esdihumboldt.hale.io.gml.test/src/eu/esdihumboldt/hale/io/gml/reader/internal/GmlInstanceCollectionTest.java index e8ed0e3ea3..d03616c054 100644 --- a/io/plugins/eu.esdihumboldt.hale.io.gml.test/src/eu/esdihumboldt/hale/io/gml/reader/internal/GmlInstanceCollectionTest.java +++ b/io/plugins/eu.esdihumboldt.hale.io.gml.test/src/eu/esdihumboldt/hale/io/gml/reader/internal/GmlInstanceCollectionTest.java @@ -22,6 +22,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; +import java.math.BigDecimal; import java.net.URI; import java.util.Collection; @@ -162,8 +163,6 @@ public void testLoadShiporder() throws Exception { Object[] orderid = instance.getProperty(new QName("orderid")); // attribute // form - // not - // qualified assertNotNull(orderid); assertEquals(1, orderid.length); assertEquals("889923", orderid[0]); @@ -213,6 +212,11 @@ public void testLoadShiporder() throws Exception { assertEquals(1, title1.length); assertEquals("Empire Burlesque", title1[0]); + Object[] price1 = ((Instance) item1).getProperty(new QName(ns, "price")); + assertNotNull(price1); + BigDecimal bigDecimal = new BigDecimal("0.00000000000"); + assertEquals(bigDecimal, price1[0]); + // item 2 Object item2 = items[1]; assertTrue(item2 instanceof Instance); @@ -222,6 +226,35 @@ public void testLoadShiporder() throws Exception { assertEquals(1, title2.length); assertEquals("Hide your heart", title2[0]); + Object[] price2 = ((Instance) item2).getProperty(new QName(ns, "price")); + assertNotNull(price2); + bigDecimal = new BigDecimal("9.90"); + assertEquals(bigDecimal, price2[0]); + + Object[] priceInteger = ((Instance) item2).getProperty(new QName(ns, "priceInteger")); + int intNumber = 123; + assertEquals(intNumber, priceInteger[0]); + + // Double + Object[] priceDouble = ((Instance) item2).getProperty(new QName(ns, "priceDouble")); + double doubleNumber = 12.3; + assertEquals(doubleNumber, priceDouble[0]); + + // Float + Object[] priceFloat = ((Instance) item2).getProperty(new QName(ns, "priceFloat")); + float floatNumber = 123.456F; + assertEquals(floatNumber, priceFloat[0]); + + // Long + Object[] priceLong = ((Instance) item2).getProperty(new QName(ns, "priceLong")); + long longNumber = 1234567890123456789L; + assertEquals(longNumber, priceLong[0]); + + // short + Object[] priceShort = ((Instance) item2).getProperty(new QName(ns, "priceShort")); + short shortNumber = 12345; + assertEquals(shortNumber, priceShort[0]); + // only one object assertFalse(it.hasNext()); } finally {