tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r740075 - /tuscany/branches/sca-java-1.3.3/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java
Date Mon, 02 Feb 2009 18:48:18 GMT
Author: lresende
Date: Mon Feb  2 18:48:17 2009
New Revision: 740075

URL: http://svn.apache.org/viewvc?rev=740075&view=rev
Log:
TUSCANY-2463 - Merging testcase that exercises extended attributes in bindings

Modified:
    tuscany/branches/sca-java-1.3.3/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java

Modified: tuscany/branches/sca-java-1.3.3/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3.3/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java?rev=740075&r1=740074&r2=740075&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.3.3/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java
(original)
+++ tuscany/branches/sca-java-1.3.3/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java
Mon Feb  2 18:48:17 2009
@@ -58,6 +58,26 @@
  	 	 	    "</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 @@
 
     	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();
+    }    
 }



Mime
View raw message