ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r582107 - in /webservices/axis2/trunk/java/modules/adb-codegen: test-resources/testsuite/ test/org/apache/axis2/schema/base64binary/ test/org/apache/axis2/schema/populate/simple/
Date Fri, 05 Oct 2007 07:46:27 GMT
Author: amilas
Date: Fri Oct  5 00:46:26 2007
New Revision: 582107

URL: http://svn.apache.org/viewvc?rev=582107&view=rev
Log:
change the date serialization format

Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/base64binary.xsd
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/base64binary/Base64BinaryTest.java
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDatePopulateTest.java

Modified: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/base64binary.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/base64binary.xsd?rev=582107&r1=582106&r2=582107&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/base64binary.xsd
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/base64binary.xsd
Fri Oct  5 00:46:26 2007
@@ -45,4 +45,14 @@
         <xs:element name="TestHexBinary" type="xmime:hexBinary"></xs:element>
         <xs:element name="ByteArray" nillable="true" type="xs:base64Binary"/>
 
+        <xs:element name="TestBase64MultiElement">
+            <xs:complexType>
+                <xs:sequence>
+                    <xs:element name="param1" type="xs:base64Binary"/>
+                    <xs:element name="param2" type="xs:string"/>
+                    <xs:element name="param3" type="xs:int"/>
+                </xs:sequence>
+            </xs:complexType>
+        </xs:element>
+
 </xs:schema>

Modified: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/base64binary/Base64BinaryTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/base64binary/Base64BinaryTest.java?rev=582107&r1=582106&r2=582107&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/base64binary/Base64BinaryTest.java
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/base64binary/Base64BinaryTest.java
Fri Oct  5 00:46:26 2007
@@ -25,6 +25,7 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axis2.databinding.types.*;
+import org.apache.axis2.databinding.ADBException;
 
 import javax.activation.DataHandler;
 import javax.xml.stream.XMLStreamException;
@@ -98,6 +99,36 @@
             TestHexBinary result = TestHexBinary.Factory.parse(xmlReader);
             assertEquals(result.getTestHexBinary().getHexBinary().toString(),testString);
             assertEquals(result.getTestHexBinary().getContentType().getContentType_type0(),"test
content type");
+        } catch (XMLStreamException e) {
+            fail();
+        } catch (Exception e) {
+            fail();
+        }
+    }
+
+    public void testBase64MultiElement(){
+
+        TestBase64MultiElement testBase64MultiElement = new TestBase64MultiElement();
+        String testString = "testing base 64 elements";
+        DataHandler dataHandler = new DataHandler(new ByteArrayDataSource(testString.getBytes()));
+        testBase64MultiElement.setParam1(dataHandler);
+        testBase64MultiElement.setParam2("test string");
+        testBase64MultiElement.setParam3(5);
+
+        try {
+            OMElement omElement = testBase64MultiElement.getOMElement(TestBase64MultiElement.MY_QNAME,
+                    OMAbstractFactory.getOMFactory());
+            String omElementString = omElement.toStringWithConsume();
+            System.out.println("OM Element ==> " + omElementString);
+            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
+            TestBase64MultiElement result = TestBase64MultiElement.Factory.parse(xmlReader);
+            DataHandler resultDataHandler = result.getParam1();
+            byte[] buffer = new byte[128];
+            int length = resultDataHandler.getInputStream().read(buffer);
+            String resultString = new String(buffer,0,length);
+            assertEquals(testString,resultString);
+        } catch (ADBException e) {
+            fail();
         } catch (XMLStreamException e) {
             fail();
         } catch (Exception e) {

Modified: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDatePopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDatePopulateTest.java?rev=582107&r1=582106&r2=582107&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDatePopulateTest.java
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDatePopulateTest.java
Fri Oct  5 00:46:26 2007
@@ -31,9 +31,12 @@
                 "2002-02-28Z"
     } ;
     private String xmlString[] = {
-            "<dateParam xmlns=\"http://soapinterop.org/xsd\">"+values[0]+"</dateParam>",
-            "<dateParam xmlns=\"http://soapinterop.org/xsd\">"+values[1]+"</dateParam>",
-            "<dateParam xmlns=\"http://soapinterop.org/xsd\">"+values[2]+"</dateParam>"
+            "<dateParam xmlns=\"http://soapinterop.org/xsd\">"+
+                    ConverterUtil.convertToString(ConverterUtil.convertToDate(values[0]))
+"</dateParam>",
+            "<dateParam xmlns=\"http://soapinterop.org/xsd\">"+
+                    ConverterUtil.convertToString(ConverterUtil.convertToDate(values[1]))+"</dateParam>",
+            "<dateParam xmlns=\"http://soapinterop.org/xsd\">"+
+                    ConverterUtil.convertToString(ConverterUtil.convertToDate(values[2]))+"</dateParam>"
     };
 
     protected void setUp() throws Exception {
@@ -44,8 +47,7 @@
     // force others to implement this method
     public void testPopulate() throws Exception {
 
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'Z'");
-        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-ddZ");
         Date date = null;
 
         for (int i = 0; i < values.length; i++) {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message