summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.3.3/modules
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-02-02 18:48:17 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-02-02 18:48:17 +0000
commitf88e761381f08219607fb696fb29f5393e6901b4 (patch)
tree43f565b725597cf403e28358e57ba8fe09529226 /branches/sca-java-1.3.3/modules
parent0a5bb6103fe49e39da50165555f6def27aa10d7b (diff)
TUSCANY-2463 - Merging testcase that exercises extended attributes in bindings
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@740075 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.3.3/modules')
-rw-r--r--branches/sca-java-1.3.3/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/branches/sca-java-1.3.3/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java b/branches/sca-java-1.3.3/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java
index fa4eb42d13..feab7cf0f7 100644
--- a/branches/sca-java-1.3.3/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java
+++ b/branches/sca-java-1.3.3/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java
@@ -58,6 +58,26 @@ public class ReadWriteAnyAttributeTestCase {
"</component>"+
"</composite>";
+ private static final String XML_WITH_EXTENDED_ATTRIBUTES_IN_BINDINGS =
+ "<?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=\"myComposite\">" +
+ "<service name=\"service\">" +
+ "<interface.java interface=\"com.ibm.MyInterface\" xmlns:myPrefix=\"http://myPrefix\" myPrefix:myJavaInterfaceAnyAttribute=\"Java Interface Value\" />" +
+ "<binding.ws xmlns:myPrefix=\"http://myPrefix\" myPrefix:myWSAnyAttribute=\"WS Value\" />" +
+ "<binding.ejb xmlns:myPrefix=\"http://myPrefix\" myPrefix:myEJBAnyAttribute=\"EJB Value\" />" +
+ "<binding.sca xmlns:myPrefix=\"http://myPrefix\" myPrefix:mySCAAnyAttribute=\"SCA Value\" />" +
+ "</service>" +
+ "<component name=\"component\">" +
+ "<implementation.java class=\"com.ibm.test.MyClass\" xmlns:myPrefix=\"http://myPrefix\" myPrefix:myJavaImplAnyAttribute=\"Java Impl Value\" />" +
+ "</component>" +
+ "<component name=\"component1\">" +
+ "<implementation.composite xmlns:ns2=\"http://temp\" name=\"ns2:myComposite\" xmlns:myPrefix=\"http://myPrefix\" myPrefix:myCompositeImplAnyAttribute=\"Composite Impl Value\" />" +
+ "</component>" +
+ "<reference name=\"reference\">" +
+ "<interface.wsdl interface=\"http://www.example.org/SpaceWarGame/#wsdl.interface(SpaceWarGame)\" xmlns:myPrefix=\"http://myPrefix\" myPrefix:myWSDLInterfaceAnyAttribute=\"WSDL Interface Value\" />" +
+ "</reference>" +
+ "</composite>";
+
private XMLInputFactory inputFactory;
private ExtensibleStAXArtifactProcessor staxProcessor;
@@ -129,4 +149,26 @@ public class ReadWriteAnyAttributeTestCase {
assertEquals(XML, bos.toString());
}
+
+
+ @Test
+ //@Ignore()
+ public void testReadWriteCompositeWithBindings() throws Exception {
+ init(null);
+
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(XML_WITH_EXTENDED_ATTRIBUTES_IN_BINDINGS));
+ 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_WITH_EXTENDED_ATTRIBUTES_IN_BINDINGS);
+ // System.out.println(bos.toString());
+
+ assertEquals(XML_WITH_EXTENDED_ATTRIBUTES_IN_BINDINGS, bos.toString());
+ bos.close();
+ }
}