diff --git a/dmn-core/src/main/java/com/gs/dmn/serialization/DMNConstants.java b/dmn-core/src/main/java/com/gs/dmn/serialization/DMNConstants.java index ad8e05d1a..9d193f8d3 100644 --- a/dmn-core/src/main/java/com/gs/dmn/serialization/DMNConstants.java +++ b/dmn-core/src/main/java/com/gs/dmn/serialization/DMNConstants.java @@ -15,6 +15,10 @@ public class DMNConstants { public static final String DMN_FILE_EXTENSION = ".dmn"; + // XSD + public static final String XSD_NS = "http://www.w3.org/2001/XMLSchema"; + public static final String XSD_PREFIX = "xsd"; + // XSI public static final String XSI_NS = "http://www.w3.org/2001/XMLSchema-instance"; public static final String XSI_PREFIX = "xsi"; diff --git a/dmn-core/src/main/java/com/gs/dmn/serialization/TCKVersion.java b/dmn-core/src/main/java/com/gs/dmn/serialization/TCKVersion.java index 38adedaba..fcaa4f1d0 100644 --- a/dmn-core/src/main/java/com/gs/dmn/serialization/TCKVersion.java +++ b/dmn-core/src/main/java/com/gs/dmn/serialization/TCKVersion.java @@ -14,13 +14,15 @@ import org.apache.commons.lang3.StringUtils; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; +import java.util.*; public class TCKVersion { protected static final LinkedHashMap TCK_1_OTHER_NAMESPACES = new LinkedHashMap<>(); + static { + TCK_1_OTHER_NAMESPACES.put(DMNConstants.XSD_NS, DMNConstants.XSD_PREFIX); + TCK_1_OTHER_NAMESPACES.put(DMNConstants.XSI_NS, DMNConstants.XSI_PREFIX); + } + public static final TCKVersion TCK_1 = new TCKVersion("1", "tck/testCases.xsd", "", "http://www.omg.org/spec/DMN/20160719/testcase", TCK_1_OTHER_NAMESPACES, @@ -29,12 +31,12 @@ public class TCKVersion { public static final TCKVersion LATEST = TCK_1; - protected static final List VALUES = Arrays.asList(TCK_1); + protected static final List VALUES = Collections.singletonList(TCK_1); public static TCKVersion fromVersion(String key) { - for (TCKVersion version: VALUES) { + for (TCKVersion version : VALUES) { if (version.version.equals(key)) { - return version; + return version; } } throw new IllegalArgumentException(String.format("Cannot find TCK version '%s'", key)); @@ -44,21 +46,25 @@ public static TCKVersion fromVersion(String key) { private final String schemaLocation; private final String prefix; private final String namespace; - private final Map otherNamespaces; + private final LinkedHashMap namespaceToPrefixMap; + private final LinkedHashMap prefixToNamespaceMap; private final String javaPackage; - private final LinkedHashMap namespaceMap; TCKVersion(String version, String schemaLocation, String prefix, String namespace, Map otherNamespaces, String javaPackage) { this.version = version; this.schemaLocation = schemaLocation; this.prefix = prefix; this.namespace = namespace; - this.otherNamespaces = otherNamespaces; this.javaPackage = javaPackage; - this.namespaceMap = new LinkedHashMap<>(); + this.namespaceToPrefixMap = new LinkedHashMap<>(); + this.prefixToNamespaceMap = new LinkedHashMap<>(); addMap(namespace, prefix); - this.namespaceMap.putAll(otherNamespaces); + for (Map.Entry entry : otherNamespaces.entrySet()) { + String otherNamespace = entry.getKey(); + String otherPrefix = entry.getValue(); + addMap(otherNamespace, otherPrefix); + } } public String getVersion() { @@ -77,8 +83,12 @@ public String getNamespace() { return namespace; } - public Map getNamespaceMap() { - return this.namespaceMap; + public Map getNamespaceToPrefixMap() { + return this.namespaceToPrefixMap; + } + + public LinkedHashMap getPrefixToNamespaceMap() { + return prefixToNamespaceMap; } public String getJavaPackage() { @@ -86,8 +96,13 @@ public String getJavaPackage() { } private void addMap(String namespace, String prefix) { - if (!StringUtils.isEmpty(prefix)) { - this.namespaceMap.put(namespace, prefix); + if (StringUtils.isEmpty(namespace)) { + throw new IllegalArgumentException("Namespace cannot be null or empty"); + } + if (prefix == null) { + prefix = ""; } + this.namespaceToPrefixMap.put(namespace, prefix); + this.prefixToNamespaceMap.put(prefix, namespace); } } diff --git a/dmn-core/src/main/java/com/gs/dmn/tck/TCKSerializer.java b/dmn-core/src/main/java/com/gs/dmn/tck/TCKSerializer.java index 77241cf6b..5cc068119 100644 --- a/dmn-core/src/main/java/com/gs/dmn/tck/TCKSerializer.java +++ b/dmn-core/src/main/java/com/gs/dmn/tck/TCKSerializer.java @@ -27,7 +27,7 @@ public abstract class TCKSerializer { public static boolean isTCKFile(File file) { return file != null && file.isFile() && ( - file.getName().endsWith(DEFAULT_TEST_CASE_FILE_EXTENSION) || file.getName().endsWith(TEST_CASE_FILE_EXTENSION) + file.getName().endsWith(DEFAULT_TEST_CASE_FILE_EXTENSION) || file.getName().endsWith(TEST_CASE_FILE_EXTENSION) ); } @@ -45,7 +45,7 @@ public TestCases read(File input) { try { return read(input.toURI().toURL()); } catch (Exception e) { - throw new DMNRuntimeException(String.format("Cannot read DMN from '%s'", input.getPath()), e); + throw new DMNRuntimeException(String.format("Cannot read TCK from '%s'", input.getPath()), e); } } @@ -66,7 +66,7 @@ public void write(TestCases testCases, File file) { try { this.marshaller.marshal(testCases, file); } catch (Exception e) { - throw new DMNRuntimeException(String.format("Cannot write DMN to '%s'", file.getPath()), e); + throw new DMNRuntimeException(String.format("Cannot write TCK to '%s'", file.getPath()), e); } } } diff --git a/dmn-core/src/main/java/com/gs/dmn/tck/ast/AnySimpleType.java b/dmn-core/src/main/java/com/gs/dmn/tck/ast/AnySimpleType.java index 5528cbcf1..5bcdbbdc4 100644 --- a/dmn-core/src/main/java/com/gs/dmn/tck/ast/AnySimpleType.java +++ b/dmn-core/src/main/java/com/gs/dmn/tck/ast/AnySimpleType.java @@ -24,11 +24,15 @@ import java.util.Map; import static com.gs.dmn.serialization.DMNConstants.XSI_NS; +import static com.gs.dmn.serialization.DMNConstants.XSI_PREFIX; @JsonPropertyOrder({ "test" }) public class AnySimpleType extends TCKBaseElement { + private static final QName NILL_QNAME = new QName(XSI_NS, "nil", XSI_PREFIX); + private static final QName TYPE_QNAME = new QName(XSI_NS, "type", XSI_PREFIX); + public static AnySimpleType from(String localPart, String value, String prefix, String text) { AnySimpleType anySimpleType = new AnySimpleType(); anySimpleType.getOtherAttributes().put(new QName(XSI_NS, localPart, prefix), value); @@ -44,49 +48,49 @@ public static AnySimpleType of(Object value) { if (value == null) { AnySimpleType result = new AnySimpleType(); result.setText(""); - result.getOtherAttributes().put(new QName(XSI_NS, "nil"), "true"); + result.getOtherAttributes().put(NILL_QNAME, "true"); return result; } else if (value instanceof String) { AnySimpleType result = new AnySimpleType(); result.setText((String) value); - result.getOtherAttributes().put(new QName(XSI_NS, "type"), "xsd:string"); + result.getOtherAttributes().put(TYPE_QNAME, "xsd:string"); return result; } else if (value instanceof Boolean) { AnySimpleType result = new AnySimpleType(); result.setText("" + value); - result.getOtherAttributes().put(new QName(XSI_NS, "type"), "xsd:boolean"); + result.getOtherAttributes().put(TYPE_QNAME, "xsd:boolean"); return result; } else if (value instanceof Float) { AnySimpleType result = new AnySimpleType(); result.setText("" + value); - result.getOtherAttributes().put(new QName(XSI_NS, "type"), "xsd:float"); + result.getOtherAttributes().put(TYPE_QNAME, "xsd:float"); return result; } else if (value instanceof Double) { AnySimpleType result = new AnySimpleType(); result.setText("" + value); - result.getOtherAttributes().put(new QName(XSI_NS, "type"), "xsd:double"); + result.getOtherAttributes().put(TYPE_QNAME, "xsd:double"); return result; } else if (value instanceof BigDecimal) { AnySimpleType result = new AnySimpleType(); result.setText("" + value); - result.getOtherAttributes().put(new QName(XSI_NS, "type"), "xsd:decimal"); + result.getOtherAttributes().put(TYPE_QNAME, "xsd:decimal"); return result; } else if (value instanceof XMLGregorianCalendar) { AnySimpleType result = new AnySimpleType(); result.setText(value.toString()); QName type = ((XMLGregorianCalendar) value).getXMLSchemaType(); if (type == DatatypeConstants.DATE) { - result.getOtherAttributes().put(new QName(XSI_NS, "type"), "xsd:date"); + result.getOtherAttributes().put(TYPE_QNAME, "xsd:date"); } else if (type == DatatypeConstants.TIME) { - result.getOtherAttributes().put(new QName(XSI_NS, "type"), "xsd:time"); + result.getOtherAttributes().put(TYPE_QNAME, "xsd:time"); } else if (type == DatatypeConstants.DATETIME) { - result.getOtherAttributes().put(new QName(XSI_NS, "type"), "xsd:dateTime"); + result.getOtherAttributes().put(TYPE_QNAME, "xsd:dateTime"); } return result; } else if (value instanceof Duration) { AnySimpleType result = new AnySimpleType(); result.setText(value.toString()); - result.getOtherAttributes().put(new QName(XSI_NS, "type"), "xsd:duration"); + result.getOtherAttributes().put(TYPE_QNAME, "xsd:duration"); return result; } throw new IllegalArgumentException(String.format("Not supported value '%s' yet", value.getClass().getSimpleName())); diff --git a/dmn-core/src/main/java/com/gs/dmn/tck/serialization/xstream/XStreamMarshaller.java b/dmn-core/src/main/java/com/gs/dmn/tck/serialization/xstream/XStreamMarshaller.java index c8d8a32d9..6ea0fc565 100644 --- a/dmn-core/src/main/java/com/gs/dmn/tck/serialization/xstream/XStreamMarshaller.java +++ b/dmn-core/src/main/java/com/gs/dmn/tck/serialization/xstream/XStreamMarshaller.java @@ -72,7 +72,7 @@ public TestCases unmarshal(String input, boolean validateSchema) { } return unmarshal(tckVersion, secondStringReader); } catch (Exception e) { - LOGGER.error("Error unmarshalling TCK model from reader.", e); + LOGGER.error("Error unmarshalling TCK content from reader.", e); } return null; } @@ -88,7 +88,7 @@ public TestCases unmarshal(File input, boolean validateSchema) { } return unmarshal(tckVersion, secondStringReader); } catch (Exception e) { - LOGGER.error("Error unmarshalling DMN model from reader.", e); + LOGGER.error("Error unmarshalling TCK content from reader.", e); } return null; } @@ -104,7 +104,7 @@ public TestCases unmarshal(URL input, boolean validateSchema) { } return unmarshal(tckVersion, secondStringReader); } catch (Exception e) { - LOGGER.error("Error unmarshalling DMN model from reader.", e); + LOGGER.error("Error unmarshalling TCK content from reader.", e); } return null; } @@ -120,7 +120,7 @@ public TestCases unmarshal(InputStream input, boolean validateSchema) { } return unmarshal(tckVersion, secondStringReader); } catch (Exception e) { - LOGGER.error("Error unmarshalling DMN model from reader.", e); + LOGGER.error("Error unmarshalling TCK content from reader.", e); } return null; } @@ -131,7 +131,7 @@ public TestCases unmarshal(Reader input, boolean validateSchema) { String xml = buffer.lines().collect(Collectors.joining("\n")); return unmarshal(xml, validateSchema); } catch (Exception e) { - LOGGER.error("Error unmarshalling DMN model from reader.", e); + LOGGER.error("Error unmarshalling TCK content from reader.", e); } return null; } @@ -208,8 +208,8 @@ private boolean validateXMLSchema(Source source, String schemaPath) { Validator validator = schema.newValidator(); validator.validate(source); return true; - } catch (Exception e){ - LOGGER.error("Invalid DMN file: " + e.getMessage()); + } catch (Exception e) { + LOGGER.error("Invalid XML file: " + e.getMessage()); return false; } } diff --git a/dmn-core/src/test/java/com/gs/dmn/serialization/DMNVersionTest.java b/dmn-core/src/test/java/com/gs/dmn/serialization/DMNVersionTest.java new file mode 100644 index 000000000..c9cd17d79 --- /dev/null +++ b/dmn-core/src/test/java/com/gs/dmn/serialization/DMNVersionTest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2016 Goldman Sachs. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. + * + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.gs.dmn.serialization; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +public class DMNVersionTest { + @Test + void testFromVersion() { + // Used in client code + assertEquals(DMNVersion.DMN_14, DMNVersion.fromVersion("1.4")); + } + + @Test + void testFromIncorrectVersion() { + // Used in client code + assertThrows(IllegalArgumentException.class, + () -> { + DMNVersion.fromVersion("xxx"); + }); + } + + @Test + void testNamespaceToPrefixMap() { + // Used in client code + assertNotNull(DMNVersion.LATEST.getNamespaceToPrefixMap()); + assertFalse(DMNVersion.LATEST.getNamespaceToPrefixMap().isEmpty()); + } + + @Test + void testPrefixToNamespaceMap() { + // Used in client code + assertNotNull(DMNVersion.LATEST.getPrefixToNamespaceMap()); + assertFalse(DMNVersion.LATEST.getPrefixToNamespaceMap().isEmpty()); + } +} \ No newline at end of file diff --git a/dmn-core/src/test/java/com/gs/dmn/serialization/TCKVersionTest.java b/dmn-core/src/test/java/com/gs/dmn/serialization/TCKVersionTest.java new file mode 100644 index 000000000..3066120d4 --- /dev/null +++ b/dmn-core/src/test/java/com/gs/dmn/serialization/TCKVersionTest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2016 Goldman Sachs. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. + * + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.gs.dmn.serialization; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class TCKVersionTest { + @Test + void testFromVersion() { + // Used in client code + assertEquals(TCKVersion.TCK_1, TCKVersion.fromVersion("1")); + } + + @Test + void testFromIncorrectVersion() { + // Used in client code + assertThrows(IllegalArgumentException.class, + () -> { + TCKVersion.fromVersion("1.4"); + }); + } + + @Test + void testNamespaceToPrefixMap() { + // Used in client code + assertNotNull(TCKVersion.LATEST.getNamespaceToPrefixMap()); + assertFalse(TCKVersion.LATEST.getNamespaceToPrefixMap().isEmpty()); + } + + @Test + void testPrefixToNamespaceMap() { + // Used in client code + assertNotNull(TCKVersion.LATEST.getPrefixToNamespaceMap()); + assertFalse(TCKVersion.LATEST.getPrefixToNamespaceMap().isEmpty()); + } +} \ No newline at end of file diff --git a/dmn-core/src/test/java/com/gs/dmn/tck/ast/AnySimpleTypeTest.java b/dmn-core/src/test/java/com/gs/dmn/tck/ast/AnySimpleTypeTest.java index 35c9a92bb..694a8af13 100644 --- a/dmn-core/src/test/java/com/gs/dmn/tck/ast/AnySimpleTypeTest.java +++ b/dmn-core/src/test/java/com/gs/dmn/tck/ast/AnySimpleTypeTest.java @@ -12,6 +12,7 @@ */ package com.gs.dmn.tck.ast; +import com.gs.dmn.serialization.DMNConstants; import org.junit.jupiter.api.Test; import javax.xml.datatype.DatatypeConstants; @@ -36,7 +37,7 @@ public void testFromForNumber() { AnySimpleType result = AnySimpleType.from("type", "decimal", "123"); assertEquals("123", result.getText()); assertEquals("{{http://www.w3.org/2001/XMLSchema-instance}type=decimal}", result.getOtherAttributes().toString()); - assertTrue(result.getValue() instanceof BigDecimal); + assertInstanceOf(BigDecimal.class, result.getValue()); } @Test @@ -44,7 +45,7 @@ public void testFromForString() { AnySimpleType result = AnySimpleType.from("type", "string", "abc"); assertEquals("abc", result.getText()); assertEquals("{{http://www.w3.org/2001/XMLSchema-instance}type=string}", result.getOtherAttributes().toString()); - assertTrue(result.getValue() instanceof String); + assertInstanceOf(String.class, result.getValue()); } @Test @@ -52,7 +53,7 @@ public void testFromForBoolean() { AnySimpleType result = AnySimpleType.from("type", "boolean", "true"); assertEquals("true", result.getText()); assertEquals("{{http://www.w3.org/2001/XMLSchema-instance}type=boolean}", result.getOtherAttributes().toString()); - assertTrue(result.getValue() instanceof Boolean); + assertInstanceOf(Boolean.class, result.getValue()); } @Test @@ -87,7 +88,7 @@ public void testFromForDuration() { AnySimpleType result = AnySimpleType.from("type", "duration", "P12D"); assertEquals("P12D", result.getText()); assertEquals("{{http://www.w3.org/2001/XMLSchema-instance}type=duration}", result.getOtherAttributes().toString()); - assertTrue(result.getValue() instanceof Duration); + assertInstanceOf(Duration.class, result.getValue()); } @Test @@ -95,6 +96,7 @@ public void testOfFromNull() { AnySimpleType result = AnySimpleType.of(null); assertEquals("", result.getText()); assertEquals("{{http://www.w3.org/2001/XMLSchema-instance}nil=true}", result.getOtherAttributes().toString()); + assertEquals(DMNConstants.XSI_PREFIX, result.getOtherAttributes().keySet().iterator().next().getPrefix()); } @Test @@ -102,6 +104,7 @@ public void testOfFromString() { AnySimpleType result = AnySimpleType.of("abc"); assertEquals("abc", result.getText()); assertEquals("{{http://www.w3.org/2001/XMLSchema-instance}type=xsd:string}", result.getOtherAttributes().toString()); + assertEquals(DMNConstants.XSI_PREFIX, result.getOtherAttributes().keySet().iterator().next().getPrefix()); } @Test @@ -109,6 +112,7 @@ public void testOfFromBoolean() { AnySimpleType result = AnySimpleType.of(true); assertEquals("true", result.getText()); assertEquals("{{http://www.w3.org/2001/XMLSchema-instance}type=xsd:boolean}", result.getOtherAttributes().toString()); + assertEquals(DMNConstants.XSI_PREFIX, result.getOtherAttributes().keySet().iterator().next().getPrefix()); } @Test @@ -124,6 +128,7 @@ public void testOfFromNumber() { result = AnySimpleType.of(BigDecimal.valueOf(123)); assertEquals("123", result.getText()); assertEquals("{{http://www.w3.org/2001/XMLSchema-instance}type=xsd:decimal}", result.getOtherAttributes().toString()); + assertEquals(DMNConstants.XSI_PREFIX, result.getOtherAttributes().keySet().iterator().next().getPrefix()); } @Test @@ -131,6 +136,7 @@ public void testOfFromDuration() { AnySimpleType result = AnySimpleType.of(DATATYPE_FACTORY.newDuration("P12Y")); assertEquals("P12Y", result.getText()); assertEquals("{{http://www.w3.org/2001/XMLSchema-instance}type=xsd:duration}", result.getOtherAttributes().toString()); + assertEquals(DMNConstants.XSI_PREFIX, result.getOtherAttributes().keySet().iterator().next().getPrefix()); } @Test @@ -138,6 +144,7 @@ public void testOfFromDate() { AnySimpleType result = AnySimpleType.of(DATATYPE_FACTORY.newXMLGregorianCalendar("2010-10-11")); assertEquals("2010-10-11", result.getText()); assertEquals("{{http://www.w3.org/2001/XMLSchema-instance}type=xsd:date}", result.getOtherAttributes().toString()); + assertEquals(DMNConstants.XSI_PREFIX, result.getOtherAttributes().keySet().iterator().next().getPrefix()); } @Test @@ -145,6 +152,7 @@ public void testOfFromTime() { AnySimpleType result = AnySimpleType.of(DATATYPE_FACTORY.newXMLGregorianCalendar("12:00:01")); assertEquals("12:00:01", result.getText()); assertEquals("{{http://www.w3.org/2001/XMLSchema-instance}type=xsd:time}", result.getOtherAttributes().toString()); + assertEquals(DMNConstants.XSI_PREFIX, result.getOtherAttributes().keySet().iterator().next().getPrefix()); } @Test @@ -152,5 +160,6 @@ public void testOfFromDateTime() { AnySimpleType result = AnySimpleType.of(DATATYPE_FACTORY.newXMLGregorianCalendar("2010-01-02T12:00:01")); assertEquals("2010-01-02T12:00:01", result.getText()); assertEquals("{{http://www.w3.org/2001/XMLSchema-instance}type=xsd:dateTime}", result.getOtherAttributes().toString()); + assertEquals(DMNConstants.XSI_PREFIX, result.getOtherAttributes().keySet().iterator().next().getPrefix()); } } \ No newline at end of file diff --git a/dmn-core/src/test/java/com/gs/dmn/tck/serialization/xstream/v1/UnmarshalMarshalTest.java b/dmn-core/src/test/java/com/gs/dmn/tck/serialization/xstream/v1/UnmarshalMarshalTest.java index 90e83f81d..29649d606 100644 --- a/dmn-core/src/test/java/com/gs/dmn/tck/serialization/xstream/v1/UnmarshalMarshalTest.java +++ b/dmn-core/src/test/java/com/gs/dmn/tck/serialization/xstream/v1/UnmarshalMarshalTest.java @@ -35,7 +35,7 @@ private void testRoundTrip(File file) throws Exception { LOGGER.debug(String.format("Testing '%s'", file.getPath())); testRoundTrip(file, marshaller, rootOutputPath); } else if (file.isDirectory() && !file.getName().equals("expected")) { - for (File child: file.listFiles()) { + for (File child : file.listFiles()) { testRoundTrip(child); } } @@ -46,6 +46,7 @@ public void testVersion11() throws Exception { String version = "1.1"; testRoundTrip(makeFile(version, "0001-input-data-string"), marshaller, makeOutputPath(version)); testRoundTrip(makeFile(version, "0002-input-data-number"), marshaller, makeOutputPath(version)); + testRoundTrip(makeFile(version, "0105-feel-math"), marshaller, makeOutputPath(version)); } @Test @@ -53,6 +54,7 @@ public void testVersion12() throws Exception { String version = "1.2"; testRoundTrip(makeFile(version, "0001-input-data-string"), marshaller, makeOutputPath(version)); testRoundTrip(makeFile(version, "0002-input-data-number"), marshaller, makeOutputPath(version)); + testRoundTrip(makeFile(version, "0105-feel-math"), marshaller, makeOutputPath(version)); } @Test @@ -60,6 +62,15 @@ public void testVersion13() throws Exception { String version = "1.3"; testRoundTrip(makeFile(version, "0001-input-data-string"), marshaller, makeOutputPath(version)); testRoundTrip(makeFile(version, "0002-input-data-number"), marshaller, makeOutputPath(version)); + testRoundTrip(makeFile(version, "0105-feel-math"), marshaller, makeOutputPath(version)); + } + + @Test + public void testVersion14() throws Exception { + String version = "1.4"; + testRoundTrip(makeFile(version, "0001-input-data-string"), marshaller, makeOutputPath(version)); + testRoundTrip(makeFile(version, "0002-input-data-number"), marshaller, makeOutputPath(version)); + testRoundTrip(makeFile(version, "0105-feel-math"), marshaller, makeOutputPath(version)); } private String makeOutputPath(String version) { @@ -70,5 +81,4 @@ private File makeFile(String version, String name) { String path = String.format("tck/%s/cl2/%s/%s-test-01.xml", version, name, name); return new File(STANDARD_FOLDER, path); } - }