summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/assembly-xml
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-01-17 01:35:01 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-01-17 01:35:01 +0000
commit6b0cf15e75164724b31bc7194b1663daa6d3268a (patch)
treed91f78331b4b5ea2a5a903bf3a9745b27f59453e /branches/sca-java-1.x/modules/assembly-xml
parent4ea77c3a9c209b62595429f82533255f86e739a8 (diff)
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
Diffstat (limited to 'branches/sca-java-1.x/modules/assembly-xml')
-rw-r--r--branches/sca-java-1.x/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyElementTestCase.java45
1 files changed, 37 insertions, 8 deletions
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 {
"<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns1=\"http://www.osoa.org/xmlns/sca/1.0\" targetNamespace=\"http://temp\" name=\"aaaa\" autowire=\"false\">" +
"<component name=\"unknownImpl\">" +
"<implementation.unknown class=\"raymond\" />" +
- "<service name= \"service\" requires=\"\">" +
- "<binding.ws unknownAttribute=\"unknown\" />" +
- "</service>" +
+ "<service name=\"service\">" +
+ "<binding.ws />" +
+ "</service>" +
"</component>" +
"</composite>";
+ private static final String XML_UNKNOWN_IMPL_WITH_INVALID_ATTRIBUTE =
+ "<?xml version='1.0' encoding='UTF-8'?>" +
+ "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns1=\"http://www.osoa.org/xmlns/sca/1.0\" targetNamespace=\"http://temp\" name=\"aaaa\" autowire=\"false\">" +
+ "<component name=\"unknownImpl\">" +
+ "<implementation.unknown class=\"raymond\" />" +
+ "<service name=\"service\" requires=\"\">" +
+ "<binding.ws />" +
+ "</service>" +
+ "</component>" +
+ "</composite>";
+
+
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