From 6b0cf15e75164724b31bc7194b1663daa6d3268a Mon Sep 17 00:00:00 2001 From: lresende Date: Sat, 17 Jan 2009 01:35:01 +0000 Subject: TUSCANY-2663 - UPdating test scenarios to split valid extended element from invalid scenario where require attribute has empty value git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@735200 13f79535-47bb-0310-9956-ffa450edef68 --- .../assembly/xml/ReadWriteAnyElementTestCase.java | 45 ++++++++++++++++++---- 1 file changed, 37 insertions(+), 8 deletions(-) (limited to 'branches/sca-java-1.x/modules/assembly-xml') diff --git a/branches/sca-java-1.x/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyElementTestCase.java b/branches/sca-java-1.x/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyElementTestCase.java index c335af962c..4fcb9982bd 100644 --- a/branches/sca-java-1.x/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyElementTestCase.java +++ b/branches/sca-java-1.x/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyElementTestCase.java @@ -55,12 +55,24 @@ public class ReadWriteAnyElementTestCase { "" + "" + "" + - "" + - "" + - "" + + "" + + "" + + "" + "" + ""; + private static final String XML_UNKNOWN_IMPL_WITH_INVALID_ATTRIBUTE = + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + ""; + + private XMLInputFactory inputFactory; private ExtensibleStAXArtifactProcessor staxProcessor; @@ -89,15 +101,14 @@ public class ReadWriteAnyElementTestCase { staxProcessor.write(composite, bos); // used for debug comparison - System.out.println(XML_RECURSIVE_EXTENDED_ELEMENT); - System.out.println(bos.toString()); + // System.out.println(XML_RECURSIVE_EXTENDED_ELEMENT); + // System.out.println(bos.toString()); assertEquals(XML_RECURSIVE_EXTENDED_ELEMENT, bos.toString()); bos.close(); } - // @Test - @Ignore() + @Test public void testReadWriteUnknwonImpl() throws Exception { XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(XML_UNKNOWN_IMPL)); Composite composite = (Composite)staxProcessor.read(reader); @@ -115,4 +126,22 @@ public class ReadWriteAnyElementTestCase { bos.close(); } -} + // @Test + @Ignore() + public void testReadWriteInvalidAttribute() throws Exception { + XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(XML_UNKNOWN_IMPL_WITH_INVALID_ATTRIBUTE)); + Composite composite = (Composite)staxProcessor.read(reader); + assertNotNull(composite); + reader.close(); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + staxProcessor.write(composite, bos); + + // used for debug comparison + // System.out.println(XML_UNKNOWN_IMPL); + // System.out.println(bos.toString()); + + assertEquals(XML_UNKNOWN_IMPL, bos.toString()); + bos.close(); + } +} \ No newline at end of file -- cgit v1.2.3