You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by am...@apache.org on 2007/02/02 06:23:43 UTC

svn commit: r502504 [3/3] - in /webservices/axis2/trunk/java/modules/adb-codegen: ./ src/org/apache/axis2/schema/ src/org/apache/axis2/schema/template/ src/org/apache/axis2/schema/writer/ test-resources/testsuite/ test/org/apache/axis2/schema/extension...

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/XSD2Java.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/XSD2Java.java?view=diff&rev=502504&r1=502503&r2=502504
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/XSD2Java.java (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/XSD2Java.java Thu Feb  1 21:23:38 2007
@@ -72,6 +72,7 @@
 
             CompilerOptions compilerOptions = new CompilerOptions();
             compilerOptions.setOutputLocation(outputFolder);
+            compilerOptions.setGenerateAll(true);
 
             //todo - this should come from the users preferences
              compilerOptions.setWrapClasses(false);

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl?view=diff&rev=502504&r1=502503&r2=502504
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl Thu Feb  1 21:23:38 2007
@@ -232,95 +232,95 @@
                         <xsl:if test="enumFacet">
                             private static java.util.HashMap _table_ = new java.util.HashMap();
 
-                        // Constructor
-                        <xsl:if test="not(@inherited)">
-                            protected <xsl:value-of select="$name"/>(<xsl:value-of select="$propertyType"/> value, boolean isRegisterValue) {
-                                <xsl:value-of select="$varName" /> = value;
-                                if (isRegisterValue){
-                                    <xsl:choose>
-                                       <xsl:when test="@primitive">
-                                         _table_.put(<xsl:value-of select="$varName" /> + "", this);
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                           _table_.put(<xsl:value-of select="$varName" />, this);
-                                       </xsl:otherwise>
-                                    </xsl:choose>
-                                }
+                            // Constructor
+                            <xsl:if test="not(@inherited)">
+                                protected <xsl:value-of select="$name"/>(<xsl:value-of select="$propertyType"/> value, boolean isRegisterValue) {
+                                    <xsl:value-of select="$varName" /> = value;
+                                    if (isRegisterValue){
+                                        <xsl:choose>
+                                           <xsl:when test="@primitive">
+                                             _table_.put(<xsl:value-of select="$varName" /> + "", this);
+                                           </xsl:when>
+                                           <xsl:otherwise>
+                                               _table_.put(<xsl:value-of select="$varName" />, this);
+                                           </xsl:otherwise>
+                                        </xsl:choose>
+                                    }
 
-                            }
-                        </xsl:if>
-                        <xsl:if test="@inherited">
-                            protected <xsl:value-of select="$name"/>(<xsl:value-of select="$propertyType"/> value, boolean isRegisterValue) {
-                                super(value,false);
-                                if (isRegisterValue){
-                                    <xsl:choose>
-                                       <xsl:when test="@primitive">
-                                         _table_.put(<xsl:value-of select="$varName" /> + "", this);
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                           _table_.put(<xsl:value-of select="$varName" />, this);
-                                       </xsl:otherwise>
-                                    </xsl:choose>
                                 }
-                            }
-                        </xsl:if>
-                        <xsl:if test="not(@inherited)">
+                            </xsl:if>
+                            <xsl:if test="@inherited">
+                                protected <xsl:value-of select="$name"/>(<xsl:value-of select="$propertyType"/> value, boolean isRegisterValue) {
+                                    super(value,false);
+                                    if (isRegisterValue){
+                                        <xsl:choose>
+                                           <xsl:when test="@primitive">
+                                             _table_.put(<xsl:value-of select="$varName" /> + "", this);
+                                           </xsl:when>
+                                           <xsl:otherwise>
+                                               _table_.put(<xsl:value-of select="$varName" />, this);
+                                           </xsl:otherwise>
+                                        </xsl:choose>
+                                    }
+                                }
+                            </xsl:if>
+                            <xsl:if test="not(@inherited)">
+                                <xsl:for-each select="enumFacet">
+                                    public static final <xsl:value-of select="$propertyType"/> _<xsl:value-of select="@id"/> =
+                                        org.apache.axis2.databinding.utils.ConverterUtil.convertTo<xsl:value-of select="$shortTypeName"/>("<xsl:value-of select="@value"/>");
+                                </xsl:for-each>
+                            </xsl:if>
+
                             <xsl:for-each select="enumFacet">
-                                public static final <xsl:value-of select="$propertyType"/> _<xsl:value-of select="@id"/> =
-                                    org.apache.axis2.databinding.utils.ConverterUtil.convertTo<xsl:value-of select="$shortTypeName"/>("<xsl:value-of select="@value"/>");
+                                public static final <xsl:value-of select="$name"/><xsl:text> </xsl:text><xsl:value-of select="@id"/> =
+                                    new <xsl:value-of select="$name"/>(_<xsl:value-of select="@id"/>,true);
                             </xsl:for-each>
-                        </xsl:if>
 
-                        <xsl:for-each select="enumFacet">
-                            public static final <xsl:value-of select="$name"/><xsl:text> </xsl:text><xsl:value-of select="@id"/> =
-                                new <xsl:value-of select="$name"/>(_<xsl:value-of select="@id"/>,true);
-                        </xsl:for-each>
-
-                            public <xsl:value-of select="$propertyType"/> getValue() { return <xsl:value-of select="$varName" />;}
-                            public static <xsl:value-of select="$name"/> fromValue(<xsl:value-of select="$propertyType"/> value)
-                                  throws java.lang.IllegalArgumentException {
-                                <xsl:value-of select="$name"/> enumeration = (<xsl:value-of select="$name"/>)
-                            <xsl:choose>
-                                       <xsl:when test="@primitive">
-                                         _table_.get(value + "");
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                           _table_.get(value);
-                                       </xsl:otherwise>
-                                   </xsl:choose>
+                                public <xsl:value-of select="$propertyType"/> getValue() { return <xsl:value-of select="$varName" />;}
+                                public static <xsl:value-of select="$name"/> fromValue(<xsl:value-of select="$propertyType"/> value)
+                                      throws java.lang.IllegalArgumentException {
+                                    <xsl:value-of select="$name"/> enumeration = (<xsl:value-of select="$name"/>)
+                                <xsl:choose>
+                                           <xsl:when test="@primitive">
+                                             _table_.get(value + "");
+                                           </xsl:when>
+                                           <xsl:otherwise>
+                                               _table_.get(value);
+                                           </xsl:otherwise>
+                                       </xsl:choose>
 
-                                if (enumeration==null) throw new java.lang.IllegalArgumentException();
-                                return enumeration;
-                            }
-                            public static <xsl:value-of select="$name"/> fromString(java.lang.String value)
-                                  throws java.lang.IllegalArgumentException {
-                                try {
-                                   <xsl:choose>
-                                       <xsl:when test="@primitive">
-                                         return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertTo<xsl:value-of select="$shortTypeName"/>(value));
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                           return fromValue(new <xsl:value-of select="$propertyType"/>(value));
-                                       </xsl:otherwise>
-                                   </xsl:choose>
+                                    if (enumeration==null) throw new java.lang.IllegalArgumentException();
+                                    return enumeration;
+                                }
+                                public static <xsl:value-of select="$name"/> fromString(java.lang.String value)
+                                      throws java.lang.IllegalArgumentException {
+                                    try {
+                                       <xsl:choose>
+                                           <xsl:when test="@primitive">
+                                             return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertTo<xsl:value-of select="$shortTypeName"/>(value));
+                                           </xsl:when>
+                                           <xsl:otherwise>
+                                               return fromValue(new <xsl:value-of select="$propertyType"/>(value));
+                                           </xsl:otherwise>
+                                       </xsl:choose>
 
-                                } catch (java.lang.Exception e) {
-                                    throw new java.lang.IllegalArgumentException();
+                                    } catch (java.lang.Exception e) {
+                                        throw new java.lang.IllegalArgumentException();
+                                    }
                                 }
-                            }
-                            public boolean equals(java.lang.Object obj) {return (obj == this);}
-                            public int hashCode() { return toString().hashCode();}
-                            public java.lang.String toString() {
-                            <xsl:choose>
-                                <xsl:when test="@primitive">
-                                    return <xsl:value-of select="$varName"/> + "";
-                                </xsl:when>
-                                <xsl:otherwise>
-                                    return <xsl:value-of select="$varName"/>.toString();
-                                </xsl:otherwise>
-                            </xsl:choose>
+                                public boolean equals(java.lang.Object obj) {return (obj == this);}
+                                public int hashCode() { return toString().hashCode();}
+                                public java.lang.String toString() {
+                                <xsl:choose>
+                                    <xsl:when test="@primitive">
+                                        return <xsl:value-of select="$varName"/> + "";
+                                    </xsl:when>
+                                    <xsl:otherwise>
+                                        return <xsl:value-of select="$varName"/>.toString();
+                                    </xsl:otherwise>
+                                </xsl:choose>
 
-                            }
+                                }
 
                         </xsl:if>
                         <xsl:if test="not(enumFacet)">
@@ -483,57 +483,79 @@
                             </xsl:if>
 
                                <xsl:choose>
-                            <xsl:when test="(@restrictionBaseType)">
-                               <xsl:choose>
-                                <xsl:when test="(@patternFacet)">
-                                    if ( param.matches( "<xsl:value-of select="$patternFacet"/>" )) {
-                                        this.<xsl:value-of select="$varName"/>=param;
-                                    }
-                                    else {
-                                        throw new java.lang.RuntimeException();
-                                    }
-                                </xsl:when>
-                                <xsl:when test="(@lenFacet)">
-                                    if ( param.length() == <xsl:value-of select="@lenFacet"/> ) {
-                                        this.<xsl:value-of select="$varName"/>=param;
-                                    }
-                                    else {
-                                        throw new java.lang.RuntimeException();
-                                    }
-                                </xsl:when>
-                                <xsl:when test="(@maxLenFacet) or (@minLenFacet)">
-                                    if ( <xsl:if test="(@minLenFacet)"> <xsl:value-of select="$minLenFacet"/> &lt; </xsl:if> param.length() <xsl:if test="(@maxLenFacet)"> &gt; <xsl:value-of select="$maxLenFacet"/> = </xsl:if> ) {
-                                        this.<xsl:value-of select="$varName"/>=param;
-                                    }
-                                    else {
-                                        throw new java.lang.RuntimeException();
-                                    }
-                                </xsl:when>
-                                <xsl:when test="(@maxExFacet) or (@minExFacet) or (@maxInFacet) or (@minInFacet)">
-                                    if ( <xsl:if test="(@minExFacet)"> <xsl:value-of select="$minExFacet"/> &lt; </xsl:if> <xsl:if test="(@minInFacet)"> <xsl:value-of select="$minInFacet"/> &lt;= </xsl:if> param <xsl:if test="(@maxExFacet)"> &gt; <xsl:value-of select="$maxExFacet"/> </xsl:if> <xsl:if test="(@maxInFacet)"> &gt;= <xsl:value-of select="$maxInFacet"/> </xsl:if> ) {
+                                    <xsl:when test="(@restrictionBaseType)">
+                                       <xsl:choose>
+                                        <xsl:when test="(@patternFacet)">
+                                            if (param.matches("<xsl:value-of select="$patternFacet"/>")) {
+                                                this.<xsl:value-of select="$varName"/>=param;
+                                            }
+                                            else {
+                                                throw new java.lang.RuntimeException();
+                                            }
+                                        </xsl:when>
+                                        <xsl:when test="(@lenFacet)">
+                                            if ( param.length() == <xsl:value-of select="@lenFacet"/> ) {
+                                                this.<xsl:value-of select="$varName"/>=param;
+                                            }
+                                            else {
+                                                throw new java.lang.RuntimeException();
+                                            }
+                                        </xsl:when>
+                                        <xsl:when test="(@maxLenFacet) or (@minLenFacet)">
+                                            if ( <xsl:if test="(@minLenFacet)"> <xsl:value-of select="$minLenFacet"/> &lt; </xsl:if> param.length() <xsl:if test="(@maxLenFacet)"> &gt; <xsl:value-of select="$maxLenFacet"/> = </xsl:if> ) {
+                                                this.<xsl:value-of select="$varName"/>=param;
+                                            }
+                                            else {
+                                                throw new java.lang.RuntimeException();
+                                            }
+                                        </xsl:when>
+                                        <xsl:when test="(@maxExFacet) or (@minExFacet) or (@maxInFacet) or (@minInFacet)">
+                                            if ( <xsl:if test="(@minExFacet)"> <xsl:value-of select="$minExFacet"/> &lt; </xsl:if> <xsl:if test="(@minInFacet)"> <xsl:value-of select="$minInFacet"/> &lt;= </xsl:if> param <xsl:if test="(@maxExFacet)"> &gt; <xsl:value-of select="$maxExFacet"/> </xsl:if> <xsl:if test="(@maxInFacet)"> &gt;= <xsl:value-of select="$maxInFacet"/> </xsl:if> ) {
 
-                                        this.<xsl:value-of select="$varName"/>=param;
-                                    }
-                                    else {
-                                        throw new java.lang.RuntimeException();
-                                    }
-                                </xsl:when>
-                                <xsl:otherwise>
-                                     this.<xsl:value-of select="$varName"/>=param;
-                                </xsl:otherwise>
-                            </xsl:choose>
-                            </xsl:when>
+                                                this.<xsl:value-of select="$varName"/>=param;
+                                            }
+                                            else {
+                                                throw new java.lang.RuntimeException();
+                                            }
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                             this.<xsl:value-of select="$varName"/>=param;
+                                        </xsl:otherwise>
+                                    </xsl:choose>
+                                    </xsl:when>
 
-                            <xsl:otherwise>
-                                    this.<xsl:value-of select="$varName"/>=param;
-                            </xsl:otherwise>
-                            </xsl:choose>
+                                    <xsl:otherwise>
+                                            this.<xsl:value-of select="$varName"/>=param;
+                                    </xsl:otherwise>
+                                </xsl:choose>
 
                                }
                             </xsl:otherwise>
                         </xsl:choose>
                         </xsl:if>
 
+                         <!-- generate from string and to string methods for
+                          simple types to be ued in attribute handling -->
+                        <xsl:if test="$simple and not(@attribute) and not(enumFacet)">
+                            public static <xsl:value-of select="$name"/> fromString(String value){
+                                <xsl:value-of select="$name"/> returnValue = new  <xsl:value-of select="$name"/>();
+                                returnValue.set<xsl:value-of select="$javaName"/>(
+                                org.apache.axis2.databinding.utils.ConverterUtil.convertTo<xsl:value-of select="$shortTypeName"/>(value));
+                                return returnValue;
+                            }
+
+                            public String toString(){
+                                <xsl:choose>
+                                    <xsl:when test="@primitive">
+                                        return <xsl:value-of select="$varName"/> + "";
+                                    </xsl:when>
+                                    <xsl:otherwise>
+                                        return <xsl:value-of select="$varName"/>.toString();
+                                    </xsl:otherwise>
+                                </xsl:choose>
+                            }
+                        </xsl:if>
+
                       </xsl:otherwise>
                    </xsl:choose>
 
@@ -656,20 +678,40 @@
                         <!-- there can never be attribute arrays in the normal case-->
                         <xsl:when test="@optional">
                              // optional attribute <xsl:value-of select="$propertyName"/>
-                             try {
-                                writeAttribute("<xsl:value-of select="$namespace"/>",
+                            try {
+                                <xsl:choose>
+                                    <xsl:when test="@ours">
+                                        <!--  this can only be a simple type -->
+                                        writeAttribute("<xsl:value-of select="$namespace"/>",
+                                               "<xsl:value-of select="$propertyName"/>",
+                                               <xsl:value-of select="$varName"/>.toString(), xmlWriter);
+                                    </xsl:when>
+                                    <xsl:otherwise>
+                                         writeAttribute("<xsl:value-of select="$namespace"/>",
                                                "<xsl:value-of select="$propertyName"/>",
                                                org.apache.axis2.databinding.utils.ConverterUtil.convertToString(<xsl:value-of select="$varName"/>), xmlWriter);
+                                    </xsl:otherwise>
+                                </xsl:choose>
+
                             } catch (NullPointerException e) {
                                 // If <xsl:value-of select="$varName"/> was null
                                 // it can not be serialized.
                             }
                         </xsl:when>
                         <xsl:otherwise>
-                             writeAttribute("<xsl:value-of select="$namespace"/>",
-                                                     "<xsl:value-of select="$propertyName"/>",
-                                                      org.apache.axis2.databinding.utils.ConverterUtil.convertToString(<xsl:value-of select="$varName"/>),
-                            xmlWriter);
+                             <xsl:choose>
+                                <xsl:when test="@ours">
+                                    <!--  this can only be a simple type -->
+                                    writeAttribute("<xsl:value-of select="$namespace"/>",
+                                           "<xsl:value-of select="$propertyName"/>",
+                                           <xsl:value-of select="$varName"/>.toString(), xmlWriter);
+                                </xsl:when>
+                                <xsl:otherwise>
+                                     writeAttribute("<xsl:value-of select="$namespace"/>",
+                                           "<xsl:value-of select="$propertyName"/>",
+                                           org.apache.axis2.databinding.utils.ConverterUtil.convertToString(<xsl:value-of select="$varName"/>), xmlWriter);
+                                </xsl:otherwise>
+                            </xsl:choose>
                         </xsl:otherwise>
                     </xsl:choose>
                 </xsl:for-each>
@@ -1627,8 +1669,14 @@
                         <xsl:otherwise>
                             attribList.add(
                             new javax.xml.namespace.QName("<xsl:value-of select="$namespace"/>","<xsl:value-of select="$propertyName"/>"));
-                            attribList.add(
-                            org.apache.axis2.databinding.utils.ConverterUtil.convertToString(<xsl:value-of select="$varName"/>));
+                            <xsl:choose>
+                                <xsl:when test="@ours">
+                                      attribList.add(<xsl:value-of select="$varName"/>.toString());
+                                </xsl:when>
+                                <xsl:otherwise>
+                                      attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(<xsl:value-of select="$varName"/>));
+                                </xsl:otherwise>
+                            </xsl:choose>
                         </xsl:otherwise>
                     </xsl:choose>
                 </xsl:for-each>
@@ -1807,8 +1855,16 @@
                                           org.apache.axis2.databinding.utils.ConverterUtil.convertTo<xsl:value-of select="$shortTypeName"/>(<xsl:value-of select="$attribName"/>));
                                     </xsl:when>
                                     <xsl:otherwise>
-                                        object.set<xsl:value-of select="$javaName"/>(
-                                              org.apache.axis2.databinding.utils.ConverterUtil.convertTo<xsl:value-of select="$shortTypeName"/>(<xsl:value-of select="$attribName"/>));
+                                        <xsl:choose>
+                                            <xsl:when test="@ours">
+                                                 object.set<xsl:value-of select="$javaName"/>(
+                                                  <xsl:value-of select="@type"/>.fromString(<xsl:value-of select="$attribName"/>));
+                                            </xsl:when>
+                                            <xsl:otherwise>
+                                                 object.set<xsl:value-of select="$javaName"/>(
+                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertTo<xsl:value-of select="$shortTypeName"/>(<xsl:value-of select="$attribName"/>));
+                                            </xsl:otherwise>
+                                        </xsl:choose>
                                     </xsl:otherwise>
                                 </xsl:choose>
                              </xsl:otherwise>

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java?view=diff&rev=502504&r1=502503&r2=502504
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java Thu Feb  1 21:23:38 2007
@@ -25,6 +25,7 @@
 import java.io.*;
 import java.util.*;
 
+import com.ibm.wsdl.util.xml.DOM2Writer;
 
 /*
 * Copyright 2004,2005 The Apache Software Foundation.

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/extensions.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/extensions.xsd?view=auto&rev=502504
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/extensions.xsd (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/extensions.xsd Thu Feb  1 21:23:38 2007
@@ -0,0 +1,56 @@
+<schema elementFormDefault="qualified"
+        xmlns:xs="http://www.w3.org/2001/XMLSchema"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="org.apache.axis2.test"
+        targetNamespace="org.apache.axis2.test">
+
+    <xs:complexType name="type">
+        <xs:sequence>
+            <xs:element name="first" type="xs:string"/>
+            <xs:element name="middle" type="xs:string"/>
+            <xs:element name="last" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:simpleType name="simpleType">
+        <xs:restriction base="xs:string">
+            <xs:pattern value="[A-Z]*"></xs:pattern>
+        </xs:restriction>
+    </xs:simpleType>
+
+    <xs:simpleType name="baseType">
+        <xs:restriction base="xs:string">
+            <xs:enumeration value="s1"></xs:enumeration>
+            <xs:enumeration value="s2"></xs:enumeration>
+            <xs:enumeration value="s3"></xs:enumeration>
+            <xs:enumeration value="s4"></xs:enumeration>
+        </xs:restriction>
+    </xs:simpleType>
+
+    <xs:element name="fullName">
+        <xs:complexType>
+            <xs:simpleContent>
+                <xs:extension base="tns:type">
+                    <xs:attribute name="language" type="xs:language"/>
+                    <xs:attribute name="attribute1" type="tns:baseType"/>
+                    <xs:attribute name="attribute2" type="tns:simpleType"/>
+                </xs:extension>
+            </xs:simpleContent>
+        </xs:complexType>
+    </xs:element>
+
+    <xs:complexType name="ExtendedComplexType">
+        <xs:complexContent>
+            <xs:extension base="tns:type">
+                  <xs:sequence>
+                      <xs:element name="parentElement1" type="xs:string"></xs:element>
+                      <xs:element name="parentElement2" type="xs:string"></xs:element>
+                  </xs:sequence>
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+
+    <xs:element name="TestComplexElement" type="tns:ExtendedComplexType">
+
+    </xs:element>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/restrictions.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/restrictions.xsd?view=auto&rev=502504
==============================================================================
    (empty)

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/extension/ComplexExtenstionTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/extension/ComplexExtenstionTest.java?view=auto&rev=502504
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/extension/ComplexExtenstionTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/extension/ComplexExtenstionTest.java Thu Feb  1 21:23:38 2007
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.schema.extension;
+
+import junit.framework.TestCase;
+
+public class ComplexExtenstionTest extends TestCase {
+    public void testComplexExtension(){
+        
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/extension/SimpleExtensionTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/extension/SimpleExtensionTest.java?view=auto&rev=502504
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/extension/SimpleExtensionTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/extension/SimpleExtensionTest.java Thu Feb  1 21:23:38 2007
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.schema.extension;
+
+import junit.framework.TestCase;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axis2.databinding.types.Language;
+import test.axis2.apache.org.FullName;
+import test.axis2.apache.org.BaseType;
+import test.axis2.apache.org.SimpleType;
+
+import javax.xml.stream.XMLStreamReader;
+import java.io.ByteArrayInputStream;
+
+public class SimpleExtensionTest extends TestCase {
+
+    public void testSimpleTypeComplexExtension() {
+        FullName fullName = new FullName();
+        fullName.setFirst("amila");
+        fullName.setMiddle("chinthaka");
+        fullName.setLast("suriarachchi");
+        fullName.setLanguage(new Language("singhala"));
+        fullName.setAttribute1(BaseType.fromString(BaseType._s1));
+
+        fullName.setAttribute2(SimpleType.fromString("ATTRIBUTE"));
+
+        OMElement omElement = fullName.getOMElement(FullName.MY_QNAME, OMAbstractFactory.getSOAP11Factory());
+        try {
+            String omElementString = omElement.toStringWithConsume();
+            System.out.println("OM String ==> " + omElementString);
+            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
+            FullName newFullName = FullName.Factory.parse(xmlReader);
+            assertEquals(newFullName.getFirst(),"amila");
+            assertEquals(newFullName.getMiddle(),"chinthaka");
+            assertEquals(newFullName.getLast(),"suriarachchi");
+            assertEquals(newFullName.getLanguage().toString(),"singhala");
+            assertEquals(newFullName.getAttribute1().toString(),BaseType._s1);
+            assertEquals(newFullName.getAttribute2().toString(),"ATTRIBUTE");
+        } catch (Exception e) {
+            assertFalse(true);
+        }
+    }
+
+
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/restriction/ComplexRestrictionTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/restriction/ComplexRestrictionTest.java?view=auto&rev=502504
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/restriction/ComplexRestrictionTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/restriction/ComplexRestrictionTest.java Thu Feb  1 21:23:38 2007
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.schema.restriction;
+
+import junit.framework.TestCase;
+
+public class ComplexRestrictionTest extends TestCase {
+    public void testComplexRestriction(){
+        
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/restriction/SimpleRestrictionTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/restriction/SimpleRestrictionTest.java?view=auto&rev=502504
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/restriction/SimpleRestrictionTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/restriction/SimpleRestrictionTest.java Thu Feb  1 21:23:38 2007
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.schema.restriction;
+
+import junit.framework.TestCase;
+
+public class SimpleRestrictionTest extends TestCase {
+    public void testSimpleRestriction(){
+        
+    }
+
+}



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