axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r410497 [6/6] - in /webservices/axis2/trunk/java/modules: adb-codegen/ adb-codegen/src/ adb-codegen/src/org/ adb-codegen/src/org/apache/ adb-codegen/src/org/apache/axis2/ adb-codegen/src/org/apache/axis2/schema/ adb-codegen/src/org/apache/a...
Date Wed, 31 May 2006 11:35:36 GMT
Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateMixedMinoccurs0Test.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateMixedMinoccurs0Test.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateMixedMinoccurs0Test.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateMixedMinoccurs0Test.java Wed May 31 04:35:30 2006
@@ -0,0 +1,137 @@
+package org.apache.axis2.schema.populate.other;
+
+import junit.framework.TestCase;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLInputFactory;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.beans.IntrospectionException;
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.io.ByteArrayInputStream;
+
+import org.apache.axiom.om.util.StAXUtils;
+/*
+ * 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.
+ */
+
+public class PopulateMixedMinoccurs0Test extends TestCase {
+
+    /*
+
+    <xsd:element name="stringListResponseElement" type="tns:StringListResponseType"/>
+    <xsd:complexType name="StringListResponseType">
+        <xsd:choice>
+            <xsd:element name="stringList" type="tns:StringList"/>
+            <xsd:element name="exception" type="tns:ExceptionType"/>
+        </xsd:choice>
+    </xsd:complexType>
+    <xsd:complexType name="StringList">
+        <xsd:sequence>
+            <xsd:element name="s" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+   */
+
+
+    private String xmlString1 = "<stringListResponseElement " +
+            "xmlns=\"http://recursion1.org\">" +
+            "<stringList>" +
+            "<s>item1</s>" +
+            "<s>item2</s>" +
+            "<s>item3</s>" +
+            "</stringList>" +
+            "</stringListResponseElement>";
+
+    private String xmlString2 = "<stringListResponseElement " +
+            "xmlns=\"http://recursion1.org\">" +
+            "<stringList>" +
+            "</stringList>" +
+            "</stringListResponseElement>";
+
+
+    public void testPopulate1() throws Exception {
+        populateAndAssert(xmlString1,3);
+    }
+
+    public void testPopulate2() throws Exception {
+        populateAndAssert(xmlString2,0);
+    }
+
+
+    private void populateAndAssert(String s,int count) throws XMLStreamException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, IntrospectionException {
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(s.getBytes()));
+        Class clazz = Class.forName("org.recursion1.StringListResponseElement");
+        Class innerClazz = clazz.getDeclaredClasses()[0];
+        Method parseMethod = innerClazz.getMethod("parse", new Class[]{XMLStreamReader.class});
+        Object obj = parseMethod.invoke(null, new Object[]{reader});
+
+        assertNotNull(obj);
+
+        Object stringListResponseElement = null;
+        BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass());
+        PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
+        Method readMethod;
+
+        for (int i = 0; i < propertyDescriptors.length; i++) {
+            PropertyDescriptor propertyDescriptor = propertyDescriptors[i];
+            String displayName = propertyDescriptor.getDisplayName();
+            if ("stringListResponseElement".equals(displayName)) {
+                readMethod = propertyDescriptor.getReadMethod();
+                stringListResponseElement = readMethod.invoke(obj, null);
+                break;
+            }
+        }
+
+        assertNotNull(stringListResponseElement);
+
+        beanInfo = Introspector.getBeanInfo(stringListResponseElement.getClass());
+        propertyDescriptors = beanInfo.getPropertyDescriptors();
+        Object stringArray = null;
+        for (int i = 0; i < propertyDescriptors.length; i++) {
+            PropertyDescriptor propertyDescriptor = propertyDescriptors[i];
+            String displayName = propertyDescriptor.getDisplayName();
+            if ("stringList".equals(displayName)) {
+                readMethod = propertyDescriptor.getReadMethod();
+                stringArray = readMethod.invoke(stringListResponseElement, null);
+                break;
+            }
+        }
+
+        assertNotNull(stringArray);
+
+        beanInfo = Introspector.getBeanInfo(stringArray.getClass());
+        propertyDescriptors = beanInfo.getPropertyDescriptors();
+        Object sArray = null;
+        for (int i = 0; i < propertyDescriptors.length; i++) {
+            PropertyDescriptor propertyDescriptor = propertyDescriptors[i];
+            String displayName = propertyDescriptor.getDisplayName();
+            if ("stringList".equals(displayName)) {
+                readMethod = propertyDescriptor.getReadMethod();
+                sArray = readMethod.invoke(stringArray, null);
+                break;
+            }
+        }
+        if (sArray!=null){
+            Object[] array = (Object[])sArray;
+            assertEquals(count,array.length);
+        }
+
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateParticleAllTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateParticleAllTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateParticleAllTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateParticleAllTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,82 @@
+package org.apache.axis2.schema.populate.other;
+
+import junit.framework.TestCase;
+
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLInputFactory;
+import java.io.ByteArrayInputStream;
+import java.lang.reflect.Method;
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+
+import org.apache.axiom.om.util.StAXUtils;
+/*
+ * 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.
+ */
+
+public class PopulateParticleAllTest extends TestCase {
+    private String xmlString = "<myParticleAllElement xmlns=\"http://soapinterop.org/types\">" +
+            "<varFloat>3.3</varFloat>" +
+            "<varString>foo</varString>" +
+            "</myParticleAllElement>";
+
+    public void testPopulate() throws Exception{
+
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(xmlString.getBytes()));
+        Class clazz = Class.forName("org.soapinterop.types.MyParticleAllElement");
+        Class innerClazz = clazz.getDeclaredClasses()[0];
+        Method parseMethod = innerClazz.getMethod("parse",new Class[]{XMLStreamReader.class});
+        Object obj = parseMethod.invoke(null,new Object[]{reader});
+
+        Object myParticleAllElement = null;
+        BeanInfo beanInfo =  Introspector.getBeanInfo(obj.getClass());
+        PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
+        Method readMethod;
+        for (int i = 0; i < propertyDescriptors.length; i++) {
+            PropertyDescriptor propertyDescriptor = propertyDescriptors[i];
+            if ("myParticleAllElement".equals(propertyDescriptor.getDisplayName())){
+                readMethod = propertyDescriptor.getReadMethod();
+                myParticleAllElement = readMethod.invoke(obj, (Object[]) null);
+                break;
+            }
+        }
+        assertNotNull(myParticleAllElement);
+
+        BeanInfo structBeanInfo =  Introspector.getBeanInfo(myParticleAllElement.getClass());
+        PropertyDescriptor[] structPropertyDescriptors = structBeanInfo.getPropertyDescriptors();
+        for (int i = 0; i < structPropertyDescriptors.length; i++) {
+            PropertyDescriptor propertyDescriptor = structPropertyDescriptors[i];
+            if ("varFloat".equals(propertyDescriptor.getDisplayName())){
+                readMethod = propertyDescriptor.getReadMethod();
+                assertEquals("varFloat is not properly set",new Float(3.3),
+                        readMethod.invoke(myParticleAllElement, (Object[]) null));
+
+            }else if ("varString".equals(propertyDescriptor.getDisplayName())){
+                readMethod = propertyDescriptor.getReadMethod();
+                //this should not be set ! - it should return zero
+                assertEquals("varString is not properly set","foo",
+                        readMethod.invoke(myParticleAllElement, (Object[]) null));
+
+            }else if ("varInt".equals(propertyDescriptor.getDisplayName())){
+                readMethod = propertyDescriptor.getReadMethod();
+                //this should not be set ! - it should return zero
+                assertEquals("varInt is not properly set",new Integer(0),
+                        readMethod.invoke(myParticleAllElement, (Object[]) null));
+            }
+
+        }
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateRecursiveTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateRecursiveTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateRecursiveTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/other/PopulateRecursiveTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,78 @@
+package org.apache.axis2.schema.populate.other;
+
+import junit.framework.TestCase;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.beans.IntrospectionException;
+import java.beans.PropertyDescriptor;
+import java.beans.Introspector;
+import java.beans.BeanInfo;
+import java.io.ByteArrayInputStream;
+
+import org.apache.axiom.om.util.StAXUtils;
+/*
+ * 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.
+ */
+
+public class PopulateRecursiveTest extends TestCase {
+
+// all are present
+    private String xmlString1 = "<E xmlns=\"http://recursion.org\">" +
+            "<E>test</E>" +
+            "</E>";
+
+
+
+
+    public void testPopulate1() throws Exception {
+        populateAndAssert(xmlString1);
+    }
+
+
+    private void populateAndAssert(String s
+    ) throws XMLStreamException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, IntrospectionException {
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(s.getBytes()));
+        Class clazz = Class.forName("org.recursion.E");
+        Class innerClazz = clazz.getDeclaredClasses()[0];
+        Method parseMethod = innerClazz.getMethod("parse", new Class[]{XMLStreamReader.class});
+        Object obj = parseMethod.invoke(null, new Object[]{reader});
+
+        assertNotNull(obj);
+
+        Object eObject = null;
+        BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass());
+        PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
+        Method readMethod;
+
+        for (int i = 0; i < propertyDescriptors.length; i++) {
+            PropertyDescriptor propertyDescriptor = propertyDescriptors[i];
+            if ("e".equals(propertyDescriptor.getDisplayName())) {
+                readMethod = propertyDescriptor.getReadMethod();
+                eObject = readMethod.invoke(obj, null);
+
+                assertNotNull(eObject);
+
+                assertTrue(eObject.getClass().equals(Class.forName("org.recursion.TypeE")) );
+            }
+        }
+    }
+
+
+
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/AbstractSimplePopulater.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/AbstractSimplePopulater.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/AbstractSimplePopulater.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/AbstractSimplePopulater.java Wed May 31 04:35:30 2006
@@ -0,0 +1,76 @@
+package org.apache.axis2.schema.populate.simple;
+
+import junit.framework.TestCase;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.io.ByteArrayInputStream;
+import java.lang.reflect.Method;
+
+import org.apache.axiom.om.util.StAXUtils;
+/*
+ * 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.
+ */
+
+public abstract class AbstractSimplePopulater extends TestCase {
+
+    // force others to implement this method
+    public abstract void testPopulate() throws Exception;
+    protected  String className= null;
+    protected Class propertyClass = null;
+
+    // Simple reusable method to make object instances via reflection
+    protected Object process(String testString,String className) throws Exception{
+        XMLStreamReader reader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(testString.getBytes()));
+        Class clazz = Class.forName(className);
+        Class[] declaredClasse = clazz.getDeclaredClasses();
+        //ideally this should be 1
+        Class innerClazz = declaredClasse[0];
+        Method parseMethod = innerClazz.getMethod("parse",new Class[]{XMLStreamReader.class});
+        Object obj = parseMethod.invoke(null,new Object[]{reader});
+        assertNotNull(obj);
+
+        return obj;
+
+    }
+
+    protected void checkValue(String xmlToSet, String value) throws Exception {
+        Object o = process(xmlToSet, className);
+        Class beanClass = Class.forName(className);
+        BeanInfo info = Introspector.getBeanInfo(beanClass);
+        PropertyDescriptor[] propDescs = info.getPropertyDescriptors();
+        for (int i = 0; i < propDescs.length; i++) {
+            PropertyDescriptor propDesc = propDescs[i];
+            if  (propDesc.getPropertyType().equals(propertyClass)){
+                String s = convertToString(propDesc.getReadMethod().invoke(o,
+                        (Object[]) null));
+                compare(value,s);
+            }
+
+        }
+
+    }
+
+    protected void compare(String val1,String val2){
+         assertEquals(val1,val2);
+    }
+
+    protected String convertToString(Object o){
+        return o.toString();
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeAnyURIPopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeAnyURIPopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeAnyURIPopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeAnyURIPopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,44 @@
+package org.apache.axis2.schema.populate.simple;
+
+import org.apache.axis2.databinding.types.URI;
+/*
+ * 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.
+ */
+
+public class SimpleTypeAnyURIPopulateTest extends AbstractSimplePopulater{
+    private String values[] = {"http://www.wisc.edu/grad/education/mas/229.html",
+            "ftp://grad/education/mas/229.html",
+            "http://mail.google.com/mail/?auth=DQAAAHEAAAC041"};
+    private String xmlString[] = {
+            "<anyURIParam xmlns=\"http://soapinterop.org/xsd\">" + values[0]+"</anyURIParam>",
+            "<anyURIParam xmlns=\"http://soapinterop.org/xsd\">" + values[1]+"</anyURIParam>",
+            "<anyURIParam xmlns=\"http://soapinterop.org/xsd\">" + values[2]+"</anyURIParam>"
+    };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.xsd.AnyURIParam";
+        propertyClass = URI.class;
+    }
+
+
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+        for (int i = 0; i < values.length; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeBase64BinPopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeBase64BinPopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeBase64BinPopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeBase64BinPopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,34 @@
+package org.apache.axis2.schema.populate.simple;
+
+/*
+ * 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.
+ */
+
+public class SimpleTypeBase64BinPopulateTest extends AbstractSimplePopulater{
+    private String xmlString[] = {
+            "<base64BinParam xmlns=\"http://soapinterop.org/xsd\">abcdABCD</base64BinParam>",
+            "<base64BinParam xmlns=\"http://soapinterop.org/xsd\">abcdABCD09rT</base64BinParam>",
+    };
+
+     protected void setUp() throws Exception {
+        className = "org.soapinterop.xsd.Base64BinParam";
+        propertyClass = byte[].class;
+    }
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+        process(xmlString[0],"org.soapinterop.xsd.Base64BinParam");
+        process(xmlString[1],"org.soapinterop.xsd.Base64BinParam");
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeBooleanPopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeBooleanPopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeBooleanPopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeBooleanPopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,43 @@
+package org.apache.axis2.schema.populate.simple;
+
+/*
+ * 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.
+ */
+
+public class SimpleTypeBooleanPopulateTest extends AbstractSimplePopulater{
+    private String values[]= {
+            "true",
+            "false"
+    };
+
+    private String xmlString[] = {
+            "<booleanParam xmlns=\"http://soapinterop.org/xsd\">"+ values[0] +"</booleanParam>",
+            "<booleanParam xmlns=\"http://soapinterop.org/xsd\">"+ values[1] +"</booleanParam>",
+    };
+
+    protected void setUp() throws Exception {
+        className ="org.soapinterop.xsd.BooleanParam";
+        propertyClass = boolean.class;
+    }
+
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+        for (int i = 0; i < values.length; i++) {
+             checkValue(xmlString[i],values[i]);
+        }
+    }
+
+
+}

Added: 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=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDatePopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDatePopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,50 @@
+package org.apache.axis2.schema.populate.simple;
+
+import org.apache.axis2.databinding.utils.ConverterUtil;
+
+import java.util.Date;
+/*
+ * 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.
+ */
+
+public class SimpleTypeDatePopulateTest extends AbstractSimplePopulater{
+    private String values[]={
+                "2002-10-10",
+                "2000-12-31",
+                "2002-02-28"
+    } ;
+    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>"
+    };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.xsd.DateParam";
+        propertyClass = java.util.Date.class;
+    }
+
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+        for (int i = 0; i < values.length; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected String convertToString(Object o) {
+        String s = ConverterUtil.convertToString((Date) o);
+        return s;
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDateTimePopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDateTimePopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDateTimePopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDateTimePopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,52 @@
+package org.apache.axis2.schema.populate.simple;
+
+import org.apache.axis2.databinding.utils.ConverterUtil;
+
+import java.util.Calendar;
+/*
+ * 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.
+ */
+
+public class SimpleTypeDateTimePopulateTest extends AbstractSimplePopulater{
+    private String values[] ={"2002-10-10T12:00:00+05:00",
+            "2000-12-31T11:59:59-05:00",
+            "2002-10-10T07:00:00Z"
+    };
+    private String xmlString[] = {
+            "<dateTimeParam xmlns=\"http://soapinterop.org/xsd\">"+values[0]+"</dateTimeParam>",
+            "<dateTimeParam xmlns=\"http://soapinterop.org/xsd\">"+values[1]+"</dateTimeParam>",
+            "<dateTimeParam xmlns=\"http://soapinterop.org/xsd\">"+values[2]+"</dateTimeParam>"
+    };
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+         for (int i = 0; i < values.length; i++) {
+             checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.xsd.DateTimeParam";
+        propertyClass = Calendar.class;
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((Calendar) o);
+    }
+
+    protected void compare(String val1, String val2) {
+        //do nothing for this comparison. We dont know how to compare these yet
+        //todo Fix this comparison
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDayPopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDayPopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDayPopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDayPopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,49 @@
+package org.apache.axis2.schema.populate.simple;
+
+import org.apache.axis2.databinding.types.Day;
+import org.apache.axis2.databinding.utils.ConverterUtil;
+/*
+ * 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.
+ */
+
+public class SimpleTypeDayPopulateTest extends AbstractSimplePopulater{
+    private String values[] = {
+                        "---05",
+                        "---06",
+                        "---12"
+    };
+    private String xmlString[] = {
+            "<dayParam xmlns=\"http://soapinterop.org/xsd\">"+values[0]+"</dayParam>",
+            "<dayParam xmlns=\"http://soapinterop.org/xsd\">"+values[1]+"</dayParam>",
+            "<dayParam xmlns=\"http://soapinterop.org/xsd\">"+values[2]+"</dayParam>"
+    };
+
+    protected void setUp() throws Exception {
+        className ="org.soapinterop.xsd.DayParam";
+        propertyClass = Day.class;
+    }
+
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+         for (int i = 0; i < values.length; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((Day)o);
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDoublePopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDoublePopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDoublePopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDoublePopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,47 @@
+package org.apache.axis2.schema.populate.simple;
+
+import org.apache.axis2.databinding.utils.ConverterUtil;
+/*
+ * 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.
+ */
+
+public class SimpleTypeDoublePopulateTest extends AbstractSimplePopulater{
+    private String values[]= {
+            "20300.00554433422",
+            "203045534234",
+            "66733.0060604343"
+    };
+    private String xmlString[] = {
+            "<doubleParam xmlns=\"http://soapinterop.org/xsd\">"+values[0]+"</doubleParam>",
+            "<doubleParam xmlns=\"http://soapinterop.org/xsd\">"+values[1]+"</doubleParam>",
+            "<doubleParam xmlns=\"http://soapinterop.org/xsd\">"+values[2]+"</doubleParam>"
+    };
+
+    protected void setUp() throws Exception {
+       className = "org.soapinterop.xsd.DoubleParam";
+       propertyClass = float.class;
+    }
+
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+         for (int i = 0; i < values.length; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return  ConverterUtil.convertToString((Double)o) ;
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDurationPopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDurationPopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDurationPopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDurationPopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,53 @@
+package org.apache.axis2.schema.populate.simple;
+
+import org.apache.axis2.databinding.types.Duration;
+import org.apache.axis2.databinding.utils.ConverterUtil;
+/*
+ * 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.
+ */
+
+public class SimpleTypeDurationPopulateTest extends AbstractSimplePopulater{
+    private String values[]= {
+            "P1Y2MT2H",
+            "P1347M",
+            "P0Y1347M0D"
+    };
+
+    private String xmlString[] = {
+            "<durationParam xmlns=\"http://soapinterop.org/xsd\">"+values[0]+"</durationParam>",
+            "<durationParam xmlns=\"http://soapinterop.org/xsd\">"+values[1]+"</durationParam>",
+            "<durationParam xmlns=\"http://soapinterop.org/xsd\">"+values[2]+"</durationParam>"
+    };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.xsd.DurationParam";
+        propertyClass = Duration.class;
+    }
+
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+        for (int i = 0; i < values.length; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected void compare(String val1, String val2) {
+        assertTrue(new  Duration(val1).equals(new Duration(val2)));
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((Duration)o);
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeFloatPopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeFloatPopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeFloatPopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeFloatPopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,60 @@
+package org.apache.axis2.schema.populate.simple;
+
+import org.apache.axis2.databinding.utils.ConverterUtil;
+/*
+ * 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.
+ */
+
+public class SimpleTypeFloatPopulateTest extends AbstractSimplePopulater{
+
+     private String values[]={
+             "20300.005",
+             "3045534234",
+             "66733.88"
+
+    };
+
+
+    private String xmlString[] = {
+            "<floatParam xmlns=\"http://soapinterop.org/xsd\">"+values[0]+"</floatParam>",
+            "<floatParam xmlns=\"http://soapinterop.org/xsd\">"+values[1]+"</floatParam>",
+            "<floatParam xmlns=\"http://soapinterop.org/xsd\">"+values[2]+"</floatParam>"
+    };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.xsd.FloatParam";
+        propertyClass = float.class;
+    }
+
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+         for (int i = 0; i < values.length; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected void compare(String val1, String val2) {
+        //we need to rethink a way to compare these values since their precision
+        //differs
+        //check for null for now
+        assertNotNull(val1);
+        assertNotNull(val2);
+        // super.compare(val1, val2);
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((Float)o);
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeHexBinaryPopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeHexBinaryPopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeHexBinaryPopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeHexBinaryPopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,53 @@
+package org.apache.axis2.schema.populate.simple;
+
+import org.apache.axis2.databinding.types.HexBinary;
+import org.apache.axis2.databinding.utils.ConverterUtil;
+/*
+ * 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.
+ */
+
+public class SimpleTypeHexBinaryPopulateTest extends AbstractSimplePopulater{
+
+    private String values[]= {
+            "0FB7",
+            "FFFFFFFF",
+            "1978"
+    };
+    private String xmlString[] = {
+            "<hexBinParam xmlns=\"http://soapinterop.org/xsd\">"+values[0]+"</hexBinParam>",
+            "<hexBinParam xmlns=\"http://soapinterop.org/xsd\">"+values[1]+"</hexBinParam>",
+            "<hexBinParam xmlns=\"http://soapinterop.org/xsd\">"+values[2]+"</hexBinParam>"
+    };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.xsd.HexBinParam";
+        propertyClass = HexBinary.class;
+    }
+
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+        for (int i = 0; i < 2; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((HexBinary)o);
+    }
+
+    protected void compare(String val1, String val2) {
+       assertTrue(val1.equalsIgnoreCase(val2));
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeMonthDayPopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeMonthDayPopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeMonthDayPopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeMonthDayPopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,50 @@
+package org.apache.axis2.schema.populate.simple;
+
+import org.apache.axis2.databinding.types.MonthDay;
+import org.apache.axis2.databinding.utils.ConverterUtil;
+/*
+ * 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.
+ */
+
+public class SimpleTypeMonthDayPopulateTest extends AbstractSimplePopulater{
+
+    private String values[]= {
+            "--05-12",
+            "--06-30",
+            "--12-31"
+    };
+    private String xmlString[] = {
+            "<monthDayParam xmlns=\"http://soapinterop.org/xsd\">"+values[0]+"</monthDayParam>",
+            "<monthDayParam xmlns=\"http://soapinterop.org/xsd\">"+values[1]+"</monthDayParam>",
+            "<monthDayParam xmlns=\"http://soapinterop.org/xsd\">"+values[2]+"</monthDayParam>"
+    };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.xsd.MonthDayParam";
+        propertyClass = MonthDay.class;
+    }
+
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+        for (int i = 0; i < 2; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((MonthDay)o);
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeQNamePopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeQNamePopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeQNamePopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeQNamePopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,30 @@
+package org.apache.axis2.schema.populate.simple;
+/*
+ * 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.
+ */
+
+public class SimpleTypeQNamePopulateTest extends AbstractSimplePopulater{
+    private String xmlString[] = {
+            "<qNameParam xmlns=\"http://soapinterop.org/xsd\">university</qNameParam>",
+            "<qNameParam xmlns=\"http://soapinterop.org/xsd\" xmlns:ns1=\"http://ws.apache.org/axis2\">ns1:axis2</qNameParam>"
+            //"<qNameParam>http://mail.google.com/mail/?auth=DQAAAHEAAAC041</qNameParam>"
+    };
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+        process(xmlString[0],"org.soapinterop.xsd.QNameParam");
+        process(xmlString[1],"org.soapinterop.xsd.QNameParam");
+       // process(xmlString[2],"org.soapinterop.qNameParam");
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeTimePopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeTimePopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeTimePopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeTimePopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,56 @@
+package org.apache.axis2.schema.populate.simple;
+
+import org.apache.axis2.databinding.types.Time;
+import org.apache.axis2.databinding.utils.ConverterUtil;
+/*
+ * 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.
+ */
+
+public class SimpleTypeTimePopulateTest extends AbstractSimplePopulater{
+    private String values[]= {
+            "13:20:00",
+            "23:59:59"
+    };
+    private String xmlString[] = {
+            "<timeParam xmlns=\"http://soapinterop.org/xsd\">"+values[0]+"</timeParam>",
+            "<timeParam xmlns=\"http://soapinterop.org/xsd\">"+values[1]+"</timeParam>",
+    };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.xsd.TimeParam";
+        propertyClass = Time.class;
+    }
+
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+        for (int i = 0; i < 2; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((Time)o);
+    }
+
+    protected void compare(String val1, String val2) {
+        //todo - Find a propr way to compare these time strings
+        //check for null for now
+        assertNotNull(val1);
+        assertNotNull(val2);
+        //assertTrue(new Time(val1).equals(new Time(val2)));
+
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegMonthPopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegMonthPopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegMonthPopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegMonthPopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,54 @@
+package org.apache.axis2.schema.populate.simple;
+
+import org.apache.axis2.databinding.types.Month;
+import org.apache.axis2.databinding.utils.ConverterUtil;
+/*
+ * 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.
+ */
+
+public class SimpleTypegMonthPopulateTest  extends AbstractSimplePopulater {
+     private String values[]={
+             "--01--",
+             "--12--",
+             "--03--"
+
+    };
+
+
+    private String xmlString[] = {
+            "<monthParam xmlns=\"http://soapinterop.org/xsd\">"+values[0]+"</monthParam>",
+            "<monthParam xmlns=\"http://soapinterop.org/xsd\">"+values[1]+"</monthParam>",
+            "<monthParam xmlns=\"http://soapinterop.org/xsd\">"+values[2]+"</monthParam>"
+    };
+
+
+     protected void setUp() throws Exception {
+        className = "org.soapinterop.xsd.MonthParam";
+        propertyClass = Month.class;
+    }
+
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+         for (int i = 0; i < values.length; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((Month)o);
+    }
+
+
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegYearMonthPopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegYearMonthPopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegYearMonthPopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegYearMonthPopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,57 @@
+package org.apache.axis2.schema.populate.simple;
+
+import org.apache.axis2.databinding.types.YearMonth;
+import org.apache.axis2.databinding.utils.ConverterUtil;
+/*
+ * 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.
+ */
+
+public class SimpleTypegYearMonthPopulateTest extends AbstractSimplePopulater{
+    private String values[]= {
+            "0001-05",
+            "-0234-09",
+            "1978-01",
+            "1978-01-GMT"
+    };
+    private String xmlString[] = {
+            "<yearMonthParam xmlns=\"http://soapinterop.org/xsd\">"+values[0]+"</yearMonthParam>",
+            "<yearMonthParam xmlns=\"http://soapinterop.org/xsd\">"+values[1]+"</yearMonthParam>",
+            "<yearMonthParam xmlns=\"http://soapinterop.org/xsd\">"+values[2]+"</yearMonthParam>"
+    };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.xsd.YearMonthParam";
+        propertyClass = YearMonth.class;
+    }
+
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+        for (int i = 0; i < 2; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+
+        try {
+            process(xmlString[3],"org.soapinterop.yearMonthParam");
+            fail();
+        } catch (Exception e) {
+
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((YearMonth)o);
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegYearPopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegYearPopulateTest.java?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegYearPopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypegYearPopulateTest.java Wed May 31 04:35:30 2006
@@ -0,0 +1,49 @@
+package org.apache.axis2.schema.populate.simple;
+
+import org.apache.axis2.databinding.types.Year;
+import org.apache.axis2.databinding.utils.ConverterUtil;
+/*
+ * 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.
+ */
+
+public class SimpleTypegYearPopulateTest extends AbstractSimplePopulater{
+
+    private String values[]= {
+            "0001",
+            "-0234",
+            "1978"
+    };
+    private String xmlString[] = {
+            "<yearParam xmlns=\"http://soapinterop.org/xsd\">"+values[0]+"</yearParam>",
+            "<yearParam xmlns=\"http://soapinterop.org/xsd\">"+values[1]+"</yearParam>",
+            "<yearParam xmlns=\"http://soapinterop.org/xsd\">"+values[2]+"</yearParam>"
+    };
+
+    protected void setUp() throws Exception {
+        className = "org.soapinterop.xsd.YearParam";
+        propertyClass = Year.class;
+    }
+
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+        for (int i = 0; i < 2; i++) {
+            checkValue(xmlString[i],values[i]);
+        }
+    }
+
+    protected String convertToString(Object o) {
+        return ConverterUtil.convertToString((Year)o);
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/package.html
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/package.html?rev=410497&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/package.html (added)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/package.html Wed May 31 04:35:30 2006
@@ -0,0 +1,26 @@
+<html>
+<body>
+   This package contains the following tests
+   
+        3.2.1 string
+        3.2.2 boolean
+        3.2.3 decimal
+        3.2.4 float
+        3.2.5 double
+        3.2.6 duration
+        3.2.7 dateTime
+        3.2.8 time
+        3.2.9 date
+        3.2.10 gYearMonth
+        3.2.11 gYear
+        3.2.12 gMonthDay
+        3.2.13 gDay
+        3.2.14 gMonth
+        3.2.15 hexBinary
+        3.2.16 base64Binary
+        3.2.17 anyURI
+        3.2.18 QName
+        3.2.19 NOTATION  &lt;= Not completely tested
+
+</body>
+</html>
\ No newline at end of file

Modified: webservices/axis2/trunk/java/modules/codegen/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/maven.xml?rev=410497&r1=410496&r2=410497&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/codegen/maven.xml Wed May 31 04:35:30 2006
@@ -28,143 +28,4 @@
         </j:if>
     </preGoal>
 
-    <!-- run the schema compiler -->
-    <postGoal name="test:compile">
-        <!--<j:if test="context.getVariable('maven.test.skip') != 'true'}">-->
-
-        <j:set var="compiled.classes.dir" value="target/classes"/>
-        <!-- Theres got to be a better way to do this -->
-        <j:set var="schema.source.dir" value="test-resources/xsd"/>
-        <j:set var="schema.output.base.dir" value="target/schema"/>
-        <j:set var="schema.generated.src.dir" value="${schema.output.base.dir}/src"/>
-        <j:set var="schema.generated.classes.dir" value="${schema.output.base.dir}/classes"/>
-        <!-- make the dirs -->
-        <mkdir dir="${schema.output.base.dir}"/>
-        <mkdir dir="${schema.generated.src.dir}"/>
-        <mkdir dir="${schema.generated.classes.dir}"/>
-        <!-- Run schema compiler with designated schemas -->
-        <ant:echo>Compiling simple_maxOccurs2.xsd</ant:echo>
-        <!-- simple max occurs 2 xsd -->
-        <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-            <jvmarg line="${maven.junit.jvmargs}"/>
-            <classpath refid="maven.dependency.classpath"/>
-            <classpath location="${compiled.classes.dir}"/>
-            <arg file="${schema.source.dir}/simple_maxOccurs2.xsd"/>
-            <arg file="${schema.generated.src.dir}"/>
-        </java>
-        <ant:echo>Compiling anonymous_complexType.xsd</ant:echo>
-        <!-- anon complex type xsd -->
-        <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-            <jvmarg line="${maven.junit.jvmargs}"/>
-            <classpath refid="maven.dependency.classpath"/>
-            <classpath location="${compiled.classes.dir}"/>
-            <arg file="${schema.source.dir}/anonymous_complexType.xsd"/>
-            <arg file="${schema.generated.src.dir}"/>
-        </java>
-          <!-- anon choice xsd -->
-        <ant:echo>Compiling simple_choice.xsd</ant:echo>
-        <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-            <jvmarg line="${maven.junit.jvmargs}"/>
-            <classpath refid="maven.dependency.classpath"/>
-            <classpath location="${compiled.classes.dir}"/>
-            <arg file="${schema.source.dir}/simple_choice.xsd"/>
-            <arg file="${schema.generated.src.dir}"/>
-        </java>
-        <!-- anon particle all xsd -->
-        <ant:echo>Compiling simple_particle_all.xsd</ant:echo>
-        <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-            <jvmarg line="${maven.junit.jvmargs}"/>
-            <classpath refid="maven.dependency.classpath"/>
-            <classpath location="${compiled.classes.dir}"/>
-            <arg file="${schema.source.dir}/simple_particle_all.xsd"/>
-            <arg file="${schema.generated.src.dir}"/>
-        </java>
-        <!-- simple max occurs xsd -->
-        <ant:echo>Compiling simple_maxOccurs.xsd</ant:echo>
-        <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-            <jvmarg line="${maven.junit.jvmargs}"/>
-            <classpath refid="maven.dependency.classpath"/>
-            <classpath location="${compiled.classes.dir}"/>
-            <arg file="${schema.source.dir}/simple_maxOccurs.xsd"/>
-            <arg file="${schema.generated.src.dir}"/>
-        </java>
-
-        <!-- simple any type xsd -->
-        <ant:echo>Compiling simple_anytype.xsd</ant:echo>
-        <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-            <jvmarg line="${maven.junit.jvmargs}"/>
-            <classpath refid="maven.dependency.classpath"/>
-            <classpath location="${compiled.classes.dir}"/>
-            <arg file="${schema.source.dir}/simple_anytype.xsd"/>
-            <arg file="${schema.generated.src.dir}"/>
-        </java>
-
-
-        <!-- min occurs 0 xsd -->
-        <ant:echo>Compiling simple-minoccurs0.xsd</ant:echo>
-        <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-            <jvmarg line="${maven.junit.jvmargs}"/>
-            <classpath refid="maven.dependency.classpath"/>
-            <classpath location="${compiled.classes.dir}"/>
-            <arg file="${schema.source.dir}/simple-minoccurs0.xsd"/>
-            <arg file="${schema.generated.src.dir}"/>
-        </java>
-
-          <!-- complex min occurs 0 xsd -->
-        <ant:echo>Compiling complex-minoccurs0.xsd</ant:echo>
-        <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-            <jvmarg line="${maven.junit.jvmargs}"/>
-            <classpath refid="maven.dependency.classpath"/>
-            <classpath location="${compiled.classes.dir}"/>
-            <arg file="${schema.source.dir}/complex-minoccurs0.xsd"/>
-            <arg file="${schema.generated.src.dir}"/>
-        </java>
-
-        <ant:echo>Compiling simple-recursive-datatypes.xsd</ant:echo>
-        <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-            <jvmarg line="${maven.junit.jvmargs}"/>
-            <classpath refid="maven.dependency.classpath"/>
-            <classpath location="${compiled.classes.dir}"/>
-            <arg file="${schema.source.dir}/simple-recursive-datatypes.xsd"/>
-            <arg file="${schema.generated.src.dir}"/>
-        </java>
-
-          <ant:echo>Compiling mixed_minoccus0.xsd</ant:echo>
-        <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-            <jvmarg line="${maven.junit.jvmargs}"/>
-            <classpath refid="maven.dependency.classpath"/>
-            <classpath location="${compiled.classes.dir}"/>
-            <arg file="${schema.source.dir}/mixed_minoccus0.xsd"/>
-            <arg file="${schema.generated.src.dir}"/>
-        </java>
-        <!-- ################################################################### -->
-        <!-- All simple primitive types xsd -->
-        <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-            <jvmarg line="${maven.junit.jvmargs}"/>
-            <classpath refid="maven.dependency.classpath"/>
-            <classpath location="${compiled.classes.dir}"/>
-            <arg file="${schema.source.dir}/simple/simpleType-All.xsd"/>
-            <arg file="${schema.generated.src.dir}"/>
-        </java>
-
-        <!-- All simple derived types xsd -->
-        <java classname="org.apache.axis2.schema.XSD2Java" fork="true">
-            <jvmarg line="${maven.junit.jvmargs}"/>
-            <classpath refid="maven.dependency.classpath"/>
-            <classpath location="${compiled.classes.dir}"/>
-            <arg file="${schema.source.dir}/derived/derivedType-All.xsd"/>
-            <arg file="${schema.generated.src.dir}"/>
-        </java>
-        <!-- ################################################################### -->
-        <!-- Compile the generated classes -->
-        <javac destdir="${schema.generated.classes.dir}" srcdir="${schema.generated.src.dir}">
-            <classpath refid="maven.dependency.classpath"></classpath>
-            <classpath location="${compiled.classes.dir}"></classpath>
-        </javac>
-
-        <ant:path id="schema.generated.classes.dir" location="${schema.generated.classes.dir}"/>
-        <maven:addPath id="maven.dependency.classpath" refid="schema.generated.classes.dir"/>
-        <!--</j:if>-->
-    </postGoal>
-
 </project>

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java?rev=410497&r1=410496&r2=410497&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java Wed May 31 04:35:30 2006
@@ -16,25 +16,20 @@
 
 package org.apache.axis2.wsdl.codegen.extension;
 
-import org.apache.axis2.schema.CompilerOptions;
-import org.apache.axis2.schema.SchemaCompiler;
-import org.apache.axis2.schema.SchemaConstants;
-import org.apache.axis2.wsdl.databinding.DefaultTypeMapper;
-import org.apache.axis2.wsdl.databinding.JavaTypeMapper;
-import org.apache.axis2.wsdl.util.XSLTConstants;
-
-import javax.xml.namespace.QName;
-import java.io.File;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
+
+import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
+
+import java.lang.reflect.Method;
 
 /**
  * Extension for simple data binding.
  */
 public class SimpleDBExtension extends AbstractDBProcessingExtension {
 
+    private static final String ADB_INVOKE_CLASS_NAME =
+            "org.apache.axis2.schema.ExtensionUtility";
+    private static final String INVOKE_METHOD_NAME = "invoke";
+
     /**
      * 
      */
@@ -45,73 +40,13 @@
         }
         try {
 
-            List schemaList = configuration.getAxisService().getSchema();
-            if (schemaList == null || schemaList.isEmpty()) {
-                //there are no types to be code generated
-                //However if the type mapper is left empty it will be a problem for the other
-                //processes. Hence the default type mapper is set to the configuration
-                this.configuration.setTypeMapper(new DefaultTypeMapper());
-                return;
-            }
-
-            //call the schema compiler
-            CompilerOptions options = new CompilerOptions();
-
-            //set the default options
-            populateDefaultOptions(options);
-
-            //set the user parameters. the user parameters get the preference over
-            //the default ones. But the user better know what he's doing if he
-            //used module specific parameters
-            populateUserparameters(options);
-
-            SchemaCompiler schemaCompiler = new SchemaCompiler(options);
-            // run the schema compiler
-            schemaCompiler.compile(schemaList);
-
-            //create the type mapper
-            JavaTypeMapper mapper = new JavaTypeMapper();
-
-            if (options.isWriteOutput()){
-                //get the processed element map and transfer it to the type mapper
-                Map processedMap = schemaCompiler.getProcessedElementMap();
-                Iterator processedkeys = processedMap.keySet().iterator();
-                QName qNameKey;
-                while (processedkeys.hasNext()) {
-                    qNameKey = (QName) processedkeys.next();
-                    mapper.addTypeMappingName(qNameKey, processedMap.get(qNameKey).toString());
-                }
-
-            }else{
-                //get the processed model map and transfer it to the type mapper
-                //since the options mentiond that its not writable, it should have
-                //populated the model map
-                Map processedModelMap = schemaCompiler.getProcessedModelMap();
-                Iterator processedkeys = processedModelMap.keySet().iterator();
-                QName qNameKey;
-                while (processedkeys.hasNext()) {
-                    qNameKey = (QName) processedkeys.next();
-                    mapper.addTypeMappingObject(qNameKey, processedModelMap.get(qNameKey));
-                }
-
-                Map processedMap = schemaCompiler.getProcessedElementMap();
-                processedkeys = processedMap.keySet().iterator();
-                while (processedkeys.hasNext()) {
-                    qNameKey = (QName) processedkeys.next();
-                    mapper.addTypeMappingName(qNameKey, processedMap.get(qNameKey).toString());
-                }
-
-                //get the ADB template from the schema compilers property bag and set the
-                //template
-                configuration.putProperty(XSLTConstants.EXTERNAL_TEMPLATE_PROPERTY_KEY,
-                        schemaCompiler.getCompilerProperties().getProperty(
-                                SchemaConstants.SchemaPropertyNames.BEAN_WRITER_TEMPLATE_KEY));
-
-            }
-
-            //set the type mapper to the config
-            configuration.setTypeMapper(mapper);
-
+            //invoke the adb codegen by reflection
+            Class adbGeneratorClass = Class.
+                    forName(ADB_INVOKE_CLASS_NAME);
+            Method invokeMethod = adbGeneratorClass.getMethod(
+                    INVOKE_METHOD_NAME,
+                    new Class[]{CodeGenConfiguration.class});
+            invokeMethod.invoke(null,new Object[]{configuration});
 
         } catch (Exception e) {
             throw new RuntimeException(e);
@@ -119,105 +54,4 @@
 
     }
 
-//    /**
-//     *  populates the unwrapped Qnames from the messagereference
-//     */
-//
-//    private void populateUnwrappedElements(List unwrappedElementQNames) {
-//        Map wsdlInterfaces = configuration.getWom().getWsdlInterfaces();
-//        Iterator interaceIterator = wsdlInterfaces.values().iterator();
-//        WSDLInterface wsdlInterface;
-//        while (interaceIterator.hasNext()) {
-//            wsdlInterface =  (WSDLInterface)interaceIterator.next();
-//            HashMap allOperations = wsdlInterface.getAllOperations();
-//            Iterator operationsIterator = allOperations.values().iterator();
-//            while (operationsIterator.hasNext()) {
-//                WSDLOperation operation =  (WSDLOperation)operationsIterator.next();
-//                MessageReference inputMessage = operation.getInputMessage();
-//                if (inputMessage!= null){
-//                    Map metadataBag = inputMessage.getMetadataBag();
-//                    Iterator qNameIterator = metadataBag.keySet().iterator();
-//                    while (qNameIterator.hasNext()) {
-//                        unwrappedElementQNames.add(qNameIterator.next());
-//                    }
-//                }
-//
-//                //at this point we should add the output messages as well
-//                MessageReference outputMessage = operation.getOutputMessage();
-//                if (outputMessage!=null){
-//                    unwrappedElementQNames.add(outputMessage.getElementQName());
-//                }
-//            }
-//        }
-//    }
-
-    /**
-     *
-     * @param options
-     */
-    private void populateUserparameters(CompilerOptions options){
-        Map propertyMap = configuration.getProperties();
-        if (propertyMap.containsKey(SchemaConstants.SchemaCompilerArguments.WRAP_SCHEMA_CLASSES)){
-            if (Boolean.valueOf(
-                    propertyMap.get(SchemaConstants.SchemaCompilerArguments.WRAP_SCHEMA_CLASSES).toString()).
-                    booleanValue()) {
-                options.setWrapClasses(true);
-            }else{
-                options.setWrapClasses(false);
-            }
-        }
-
-        if (propertyMap.containsKey(SchemaConstants.SchemaCompilerArguments.WRITE_SCHEMA_CLASSES)){
-            if (Boolean.valueOf(
-                    propertyMap.get(SchemaConstants.SchemaCompilerArguments.WRITE_SCHEMA_CLASSES).toString()).
-                    booleanValue()) {
-                options.setWriteOutput(true);
-            }else{
-                options.setWriteOutput(false);
-            }
-        }
-
-        // add the custom package name
-        if (propertyMap.containsKey(SchemaConstants.SchemaCompilerArguments.PACKAGE)){
-            String packageName = (String)propertyMap.get(SchemaConstants.SchemaCompilerArguments.PACKAGE);
-            if (packageName!=null || !"".equals(packageName)){
-                options.setPackageName(packageName);
-            }
-
-        }
-    }
-
-
-    /**
-     *
-     * @param options
-     */
-    private void populateDefaultOptions(CompilerOptions options) {
-        //create the output directory
-        File outputDir = new File(configuration.getOutputLocation(), "src");
-        if(!outputDir.exists()) {
-            outputDir.mkdirs();
-        }
-
-        /// these options need to be taken from the command line
-        options.setOutputLocation(outputDir);
-        options.setNs2PackageMap(configuration.getUri2PackageNameMap()==null?
-                new HashMap():
-                configuration.getUri2PackageNameMap());
-
-        //default setting is to set the wrap status depending on whether it's
-        //the server side or the client side
-        if (configuration.isServerSide()){
-            //for the serverside we generate unwrapped  by default
-            options.setWrapClasses(false);
-            //for the serverside we write the output by default
-            options.setWriteOutput(true);
-        }else{
-            // for the client let the users preference be the word here
-            options.setWrapClasses(configuration.isPackClasses());
-            //for the client side the default setting is not to write the
-            //output
-            options.setWriteOutput(!configuration.isPackClasses());
-        }
-    }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/ClassWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/ClassWriter.java?rev=410497&r1=410496&r2=410497&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/ClassWriter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/ClassWriter.java Wed May 31 04:35:30 2006
@@ -19,6 +19,7 @@
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.util.FileWriter;
 import org.apache.axis2.util.XSLTTemplateProcessor;
+import org.apache.axis2.util.PrettyPrinter;
 import org.apache.axis2.wsdl.codegen.CodeGenerationException;
 import org.apache.axis2.wsdl.i18n.CodegenMessages;
 import org.apache.axis2.wsdl.util.ConfigPropertyFileLoader;

Copied: webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/util/PrettyPrinter.java (from r410213, webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/PrettyPrinter.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/util/PrettyPrinter.java?p2=webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/util/PrettyPrinter.java&p1=webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/PrettyPrinter.java&r1=410213&r2=410497&rev=410497&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/PrettyPrinter.java (original)
+++ webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/util/PrettyPrinter.java Wed May 31 04:35:30 2006
@@ -14,7 +14,7 @@
 * limitations under the License.
 */
 
-package org.apache.axis2.wsdl.codegen.writer;
+package org.apache.axis2.util;
 
 import org.apache.axis2.util.Loader;
 import org.apache.commons.logging.Log;

Modified: webservices/axis2/trunk/java/modules/integration/project.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/project.xml?rev=410497&r1=410496&r2=410497&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/project.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/project.xml Wed May 31 04:35:30 2006
@@ -42,7 +42,11 @@
             <artifactId>axis2-java2wsdl</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
-
+          <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-adb-codegen</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
 
         <dependency>
             <groupId>axis2</groupId>



---------------------------------------------------------------------
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