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 Gayan Asanka <ga...@opensource.lk> on 2005/09/17 18:24:15 UTC

[Axis2] Doc/Lit interop with codegen/databinding, problem with implementing the build.xml

Hi All, 

 

I am working on interop testing in doc/Lit type with (WSDL2Java) code
generation. Currently I am trying to write the build.xml for that which used
to do the code generation, compile and run each test. 

 

I hope to place the build.xml inside Integration folder. And my doc/Lit
WSDLs inside itest-resources/WSDLs. I use new folder called doclit-interop
to place my generated src code inside doclit-interop/src1,
doclit-interop/src2,. and classes to doclit-interop/classes1, classes2,.

 

 And test cases will be placed inside doclit-interop/clients and class files
will be generated to relevant classes folder i.e. one of the above classes1,
classes2, etc.

 

I build it to run it for two wsdls by now (build.xml is attached). But it
throws following exception in dos command prompt. Could someone please help
me to shoot this trouble? 

 

 

    [junit] java.util.zip.ZipException: error in opening zip file

    [junit]     at java.util.zip.ZipFile.open(Native Method)

    [junit]     at java.util.zip.ZipFile.<init>(ZipFile.java:112)

    [junit]     at java.util.zip.ZipFile.<init>(ZipFile.java:128)

    [junit]     at
org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLo

ader.java:902)

    [junit]     at
org.apache.tools.ant.AntClassLoader.getResource(AntClassLoade

r.java:831)

    [junit]     at
org.apache.log4j.helpers.Loader.getResource(Loader.java:78)

    [junit]     at org.apache.log4j.LogManager.<clinit>(LogManager.java:94)

    [junit]     at org.apache.log4j.Logger.getLogger(Logger.java:85)

    [junit]     at
org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogge

r.java:102)

    [junit]     at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native

 Method)

    [junit]     at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeC

onstructorAccessorImpl.java:39)

    [junit]     at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Del

egatingConstructorAccessorImpl.java:27)

    [junit]     at
java.lang.reflect.Constructor.newInstance(Constructor.java:27

4)

    [junit]     at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(Lo

gFactoryImpl.java:525)

    [junit]     at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(Lo

gFactoryImpl.java:272)

    [junit]     at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(Lo

gFactoryImpl.java:246)

    [junit]     at
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:

395)

    [junit]     at org.apache.axis2.engine.Phase.<init>(Phase.java:47)

    [junit]     at
org.apache.axis2.description.OperationDescription.<init>(Oper

ationDescription.java:50)

    [junit]     at codegen.SoapInteropCompound1PortTypeStub.<clinit>(Unknown
Sou

rce)

    [junit]     at WMRound3Compound1InteropTest.setUp(Unknown Source)

    [junit]     at junit.framework.TestCase.runBare(TestCase.java:125)

    [junit]     at junit.framework.TestResult$1.protect(TestResult.java:106)

    [junit]     at
junit.framework.TestResult.runProtected(TestResult.java:124)

    [junit]     at junit.framework.TestResult.run(TestResult.java:109)

    [junit]     at junit.framework.TestCase.run(TestCase.java:118)

    [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:208)

    [junit]     at junit.framework.TestSuite.run(TestSuite.java:203)

    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.

run(JUnitTestRunner.java:289)

    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut

eInVM(JUnitTask.java:1061)

    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut

e(JUnitTask.java:676)

    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut

eOrQueue(JUnitTask.java:1413)

    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut

e(JUnitTask.java:633)

    [junit]     at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja

va:275)

    [junit]     at org.apache.tools.ant.Task.perform(Task.java:364)

    [junit]     at org.apache.tools.ant.Target.execute(Target.java:341)

    [junit]     at org.apache.tools.ant.Target.performTasks(Target.java:369)

    [junit]     at
org.apache.tools.ant.Project.executeTarget(Project.java:1214)

 

    [junit]     at
org.apache.tools.ant.Project.executeTargets(Project.java:1062

)

    [junit]     at org.apache.tools.ant.Main.runBuild(Main.java:673)

    [junit]     at org.apache.tools.ant.Main.startAnt(Main.java:188)

    [junit]     at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)

    [junit]     at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)

    [junit] java.util.zip.ZipException: error in opening zip file

 

 

If I use fork = "yes" in junit, it shows the help as follows

 

run-1:

    [junit] Running WMRound3Compound1InteropTest

    [junit] Usage: java [-options] class [args...]

    [junit]            (to execute a class)

    [junit]    or  java [-options] -jar jarfile [args...]

    [junit]            (to execute a jar file)

 

    [junit] where options include:

    [junit]     -client   to select the "client" VM

    [junit]     -server   to select the "server" VM

    [junit]     -hotspot          is a synonym for the "client" VM
[deprecated]

 

    [junit]                   The default VM is client.

 

    [junit]     -cp <class search path of directories and zip/jar files>

    [junit]     -classpath <class search path of directories and zip/jar
files>

    [junit]                   A ; separated list of directories, JAR
archives,

    [junit]                   and ZIP archives to search for class files.

    [junit]     -D<name>=<value>

    [junit]                   set a system property

    [junit]     -verbose[:class|gc|jni]

    [junit]                   enable verbose output

    [junit]     -version      print product version and exit

    [junit]     -version:<value>

    [junit]                   require the specified version to run

    [junit]     -showversion  print product version and continue

    [junit]     -jre-restrict-search | -jre-no-restrict-search

    [junit]                   include/exclude user private JREs in the
version s

earch

    [junit]     -? -help      print this help message

    [junit]     -X            print help on non-standard options

    [junit]     -ea[:<packagename>...|:<classname>]

    [junit]     -enableassertions[:<packagename>...|:<classname>]

    [junit]                   enable assertions

    [junit]     -da[:<packagename>...|:<classname>]

    [junit]     -disableassertions[:<packagename>...|:<classname>]

    [junit]                   disable assertions

    [junit]     -esa | -enablesystemassertions

    [junit]                   enable system assertions

    [junit]     -dsa | -disablesystemassertions

    [junit]                   disable system assertions

    [junit] Test WMRound3Compound1InteropTest FAILED

 

Thanks

 

Gayan Asanka


Re: [Axis2] Doc/Lit interop with codegen/databinding, problem with implementing the build.xml

Posted by Saminda Abeyruwan <sa...@opensource.lk>.
Going through the build.xml, will give a hand. Attach the two wsdls to 
simulate the scenarios.

Saminda

Gayan Asanka wrote:

> Hi All,
>
> I am working on interop testing in doc/Lit type with (WSDL2Java) code 
> generation. Currently I am trying to write the build.xml for that 
> which used to do the code generation, compile and run each test.
>
> I hope to place the build.xml inside Integration folder. And my 
> doc/Lit WSDLs inside itest-resources/WSDLs. I use new folder called 
> doclit-interop to place my generated src code inside 
> doclit-interop/src1, doclit-interop/src2,… and classes to 
> doclit-interop/classes1, classes2,…
>
> And test cases will be placed inside doclit-interop/clients and class 
> files will be generated to relevant classes folder i.e. one of the 
> above classes1, classes2, etc.
>
> I build it to run it for two wsdls by now (build.xml is attached). But 
> it throws following exception in dos command prompt. Could someone 
> please help me to shoot this trouble?
>
> [junit] java.util.zip.ZipException: error in opening zip file
>
> [junit] at java.util.zip.ZipFile.open(Native Method)
>
> [junit] at java.util.zip.ZipFile.<init>(ZipFile.java:112)
>
> [junit] at java.util.zip.ZipFile.<init>(ZipFile.java:128)
>
> [junit] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLo
>
> ader.java:902)
>
> [junit] at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoade
>
> r.java:831)
>
> [junit] at org.apache.log4j.helpers.Loader.getResource(Loader.java:78)
>
> [junit] at org.apache.log4j.LogManager.<clinit>(LogManager.java:94)
>
> [junit] at org.apache.log4j.Logger.getLogger(Logger.java:85)
>
> [junit] at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogge
>
> r.java:102)
>
> [junit] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>
> Method)
>
> [junit] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeC
>
> onstructorAccessorImpl.java:39)
>
> [junit] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Del
>
> egatingConstructorAccessorImpl.java:27)
>
> [junit] at java.lang.reflect.Constructor.newInstance(Constructor.java:27
>
> 4)
>
> [junit] at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(Lo
>
> gFactoryImpl.java:525)
>
> [junit] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(Lo
>
> gFactoryImpl.java:272)
>
> [junit] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(Lo
>
> gFactoryImpl.java:246)
>
> [junit] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:
>
> 395)
>
> [junit] at org.apache.axis2.engine.Phase.<init>(Phase.java:47)
>
> [junit] at org.apache.axis2.description.OperationDescription.<init>(Oper
>
> ationDescription.java:50)
>
> [junit] at codegen.SoapInteropCompound1PortTypeStub.<clinit>(Unknown Sou
>
> rce)
>
> [junit] at WMRound3Compound1InteropTest.setUp(Unknown Source)
>
> [junit] at junit.framework.TestCase.runBare(TestCase.java:125)
>
> [junit] at junit.framework.TestResult$1.protect(TestResult.java:106)
>
> [junit] at junit.framework.TestResult.runProtected(TestResult.java:124)
>
> [junit] at junit.framework.TestResult.run(TestResult.java:109)
>
> [junit] at junit.framework.TestCase.run(TestCase.java:118)
>
> [junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
>
> [junit] at junit.framework.TestSuite.run(TestSuite.java:203)
>
> [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
>
> run(JUnitTestRunner.java:289)
>
> [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
>
> eInVM(JUnitTask.java:1061)
>
> [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
>
> e(JUnitTask.java:676)
>
> [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
>
> eOrQueue(JUnitTask.java:1413)
>
> [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
>
> e(JUnitTask.java:633)
>
> [junit] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
>
> va:275)
>
> [junit] at org.apache.tools.ant.Task.perform(Task.java:364)
>
> [junit] at org.apache.tools.ant.Target.execute(Target.java:341)
>
> [junit] at org.apache.tools.ant.Target.performTasks(Target.java:369)
>
> [junit] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
>
> [junit] at org.apache.tools.ant.Project.executeTargets(Project.java:1062
>
> )
>
> [junit] at org.apache.tools.ant.Main.runBuild(Main.java:673)
>
> [junit] at org.apache.tools.ant.Main.startAnt(Main.java:188)
>
> [junit] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
>
> [junit] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
>
> [junit] java.util.zip.ZipException: error in opening zip file
>
> If I use fork = “yes” in junit, it shows the help as follows
>
> run-1:
>
> [junit] Running WMRound3Compound1InteropTest
>
> [junit] Usage: java [-options] class [args...]
>
> [junit] (to execute a class)
>
> [junit] or java [-options] -jar jarfile [args...]
>
> [junit] (to execute a jar file)
>
> [junit] where options include:
>
> [junit] -client to select the "client" VM
>
> [junit] -server to select the "server" VM
>
> [junit] -hotspot is a synonym for the "client" VM [deprecated]
>
> [junit] The default VM is client.
>
> [junit] -cp <class search path of directories and zip/jar files>
>
> [junit] -classpath <class search path of directories and zip/jar files>
>
> [junit] A ; separated list of directories, JAR archives,
>
> [junit] and ZIP archives to search for class files.
>
> [junit] -D<name>=<value>
>
> [junit] set a system property
>
> [junit] -verbose[:class|gc|jni]
>
> [junit] enable verbose output
>
> [junit] -version print product version and exit
>
> [junit] -version:<value>
>
> [junit] require the specified version to run
>
> [junit] -showversion print product version and continue
>
> [junit] -jre-restrict-search | -jre-no-restrict-search
>
> [junit] include/exclude user private JREs in the version s
>
> earch
>
> [junit] -? -help print this help message
>
> [junit] -X print help on non-standard options
>
> [junit] -ea[:<packagename>...|:<classname>]
>
> [junit] -enableassertions[:<packagename>...|:<classname>]
>
> [junit] enable assertions
>
> [junit] -da[:<packagename>...|:<classname>]
>
> [junit] -disableassertions[:<packagename>...|:<classname>]
>
> [junit] disable assertions
>
> [junit] -esa | -enablesystemassertions
>
> [junit] enable system assertions
>
> [junit] -dsa | -disablesystemassertions
>
> [junit] disable system assertions
>
> [junit] Test WMRound3Compound1InteropTest FAILED
>
> Thanks
>
> Gayan Asanka
>
>------------------------------------------------------------------------
>
><?xml version="1.0"?>
>
><project name="interop-doclit" default="run" basedir=".">
>    <description>
>        Interop tests for doc-lit, code generated samples
>    </description>
>    <property name="dir.doclit" value="doclit-interop"/>
>    <property name="dir.src1" value="${dir.doclit}/src1"/>
>    <property name="dir.src2" value="${dir.doclit}/src2"/>
>    <property name="dir.clients" value="${dir.doclit}/clients"/>
>    <property name="dir.classes1" value="${dir.doclit}/classes1"/>
>    <property name="dir.classes2" value="${dir.doclit}/classes2"/>
>    <property environment="env"/>
>    <property name="dir.home" value="${user.home}"/>
>
>
>    <!-- preparing paths -->
>
>    <target name="prepare">
>        <mkdir dir="${dir.classes1}"/>
>        <mkdir dir="${dir.classes2}"/>
>        <mkdir dir="${dir.src1}"/>
>        <mkdir dir="${dir.src2}"/>
>    </target>
>
>    <path id="jarpath.axis2">
>         <fileset dir="${dir.home}/.maven/repository">
>             <include name="**/**/*.jar"/>
>         </fileset>
>     </path>
>
>    <path id="interop.path1">
>        <path refid="classpath.interop1"/>
>        <path refid="jarpath.axis2"/>
>    </path>
>    <path id="interop.path2">
>        <path refid="classpath.interop2"/>
>        <path refid="jarpath.axis2"/>
>    </path>
>
>    <target name="clean">
>        <delete dir="${dir.classes1}"/>
>        <delete dir="${dir.classes2}"/>
>        <delete dir="${dir.src1}"/>
>        <delete dir="${dir.src2}"/>
>    </target>
>
>    <target name="gen-1">
>        <!-- generating the first file -->
>        <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
>			<classpath refid="jarpath.axis2"/>
>			<arg value="-uri"/>
>			<arg file="./itest-resources/WSDLs/compound1.wsdl"/> <!-- place the file name-->
>			<arg value="-sd"/>
>			<arg value="-o"/>
>			<arg file="${dir.src1}"/>  <!--place the working dir -->
>			<!--<arg value="-p"/> -->
>			<!--<arg value="test.stub"/> --><!-- make this unique -->
>        </java>
>
>        <move todir="${dir.classes1}">
>            <fileset dir="${dir.src1}">
>                <include name="**/schema/**/*.class"/>
>                <include name="**/schema/**/*.xsb"/>
>            </fileset>
>        </move>
>        <!-- generating the second file-->
>        <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
>			<classpath refid="jarpath.axis2"/>
>			<arg value="-uri"/>
>			<arg file="./itest-resources/WSDLs/compound2.wsdl"/> <!-- place the file name-->
>			<arg value="-sd"/>
>			<arg value="-o"/>
>			<arg file="${dir.src2}"/>  <!--place the working dir -->
>			<!--<arg value="-p"/> -->
>			<!--<arg value="test.stub"/>  --> <!-- make this unique -->
>        </java>
>
>        <move todir="${dir.classes2}">
>            <fileset dir="${dir.src2}">
>                <include name="**/schema/**/*.class"/>
>                <include name="**/schema/**/*.xsb"/>
>            </fileset>
>        </move>
>    </target>
>    <!--adding the gen-1's schema folode to the class path -->
>
>    <path id="classpath.interop1">
>        <pathelement path="${dir.classes1}"/>
>        <fileset dir="${dir.classes1}">
>            <include name="**/*.*"/>
>        </fileset>
>    </path>
>    <path id="classpath.interop2">
>        <pathelement path="${dir.classes2}"/>
>        <fileset dir="${dir.classes2}">
>            <include name="**/*.*"/>
>        </fileset>
>    </path>
>
>    <!-- compiling the first source-->
>    <target name="compile-1" depends="prepare,gen-1">
>        <javac srcdir="${dir.src1}" destdir="${dir.classes1}">
>            <classpath refid="interop.path1"/>
>        </javac>
>    </target>
>    <target name="compile-2" depends="compile-1">
>        <javac srcdir="${dir.src2}" destdir="${dir.classes2}">
>            <classpath refid="interop.path2"/>
>        </javac>
>    </target>
>
>    <target name="compile-stub1">
>        <javac srcdir="${dir.clients}" destdir="${dir.classes1}">
>            <include name="**/WMRound3Compound1InteropTest.java"/>
>            <classpath refid="interop.path1"/>
>        </javac>
>    </target>
>    <target name="compile-stub2">
>        <javac srcdir="${dir.clients}"  destdir="${dir.classes2}">
>            <include name="**/WMRound3Compound2InteropTest.java"/>
>            <classpath refid="interop.path2"/>
>        </javac>
>    </target>
>     <!-- reusable -->
>    <target name="run-1" depends="compile-1,compile-stub1">
>        <junit printsummary="yes"  haltonfailure="false"
>            failureproperty="tests.failed" showoutput="true">
>            <classpath refid="interop.path1"/>
>            <formatter type="brief" usefile="false"/>
>            <batchtest>
>                <fileset dir="${dir.clients}">
>                    <include name="**/WMRound3Compound1InteropTest.java"/>
>                </fileset>
>            </batchtest>
>        </junit>
>       <!-- <fail if="tests.failed"/>-->
>    </target>
>
>    <target name="run-2" depends="compile-2,compile-stub2">
>        <junit printsummary="yes" haltonfailure="false"
>            failureproperty="tests.failed" showoutput="true">
>            <classpath refid="interop.path2"/>
>            <formatter type="brief" usefile="false"/>
>            <batchtest>
>                <fileset dir="${dir.clients}">
>                    <include name="**/WMRound3Compound2InteropTest.java"/>
>                </fileset>
>            </batchtest>
>        </junit>
>        <fail if="tests.failed"/>
>    </target>
>
>    <target name="run" depends="run-1, run-2,clean"/>
></project>
>
>  
>