Dear All,

I'am new to junit. Can anyone suggest me what's wrong with this code
to test a web service using ant?

My Web Service is as follows:(I'am using Weblogic to build WebService)

public class SampleWs implements com.bea.jws.WebService
{
    static final long serialVersionUID = 1L;
   

    /**
     * @common:operation
     */
    public String hello()
    {
        return "V";
    }
}

This is the file to test Web Service:

import java.io.IOException;
import junit.framework.TestCase;
import weblogic.jws.proxies.SampleWs;
import weblogic.jws.proxies.SampleWs_Impl;

public class TestSampleWs extends TestCase
{
    private SampleWs proxy;

    protected void setUp() throws Exception  {
        proxy =  new SampleWs_Impl();

    }

    public void test() throws Exception   {
        String temp = proxy.getSampleWsSoap().hello();
        assertEquals(temp, "V");
    }
}

and build.xml is as follows:

<project default="all">

  <property name="tst-dir" location="test" />
  <property name="TALK" value="true" /> 
 
  <path id="classpath.base">
  </path>
 
  <path id="classpath.test">
    <pathelement location="C:/users/junit/junit.jar" />
    <pathelement location="C:/AntFiles/SampleWs/"/>
    <path refid="classpath.base" />
 
  </path>
 
  <target name="compile-test">
   
    <javac srcdir="C:/AntFiles/SampleWs/"
           verbose="${TALK}"
           >
      <classpath refid="classpath.test"/>
     
    </javac>
   
  </target>
 
  <target name="clean-compile-test">
    <delete verbose="${TALK}">
      <fileset dir="C:/AntFiles/SampleWs/" includes="**/*.class" />
    </delete>
  </target>
 
  <target name="test" depends="compile-test">
   <junit>
      <classpath refid="classpath.test" />
      <formatter type="brief" usefile="false" />
      <test name="TestExample" />
    </junit>
  </target>
 
  <target name="all" depends="test" />
  <target name="clean" depends="clean-compile-test" />
</project>

when i say "ant test" from the directory it is showing error

Kindly help me.

Thanks & Regards,
RC Vemuri.








Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to