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 he...@apache.org on 2004/06/22 11:14:50 UTC
cvs commit: ws-axis/contrib/ews/test/testData testBuildfile.xml
hemapani 2004/06/22 02:14:50
Modified: contrib/ews/test/org/apache/geronimo/ews/ws4j2ee
GenerateWithoutWSDLTest.java JaxRpcMappingTest.java
WSDLTest.java
contrib/ews/test/testData testBuildfile.xml
Added: contrib/ews/test/org/apache/geronimo/ews/ws4j2ee
PackageModuleTest.java
Log:
add the testcase to test WAR and EAR input files
Revision Changes Path
1.6 +8 -0 ws-axis/contrib/ews/test/org/apache/geronimo/ews/ws4j2ee/GenerateWithoutWSDLTest.java
Index: GenerateWithoutWSDLTest.java
===================================================================
RCS file: /home/cvs/ws-axis/contrib/ews/test/org/apache/geronimo/ews/ws4j2ee/GenerateWithoutWSDLTest.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- GenerateWithoutWSDLTest.java 14 Jun 2004 08:20:31 -0000 1.5
+++ GenerateWithoutWSDLTest.java 22 Jun 2004 09:14:50 -0000 1.6
@@ -112,4 +112,12 @@
String[] args2 = new String[]{"target/generated/samples/zip.jar","-o"+outDir+"withoutWSDL/zip-jar/"};
Ws4J2EEwithoutWSDL.main(args2);
}
+ public void testBookSampleWar() throws Exception{
+ String[] args2 = new String[]{"target/generated/samples/simple.war","-o"+outDir+"withoutWSDL/bookquote-war/"};
+ Ws4J2EEwithoutWSDL.main(args2);
+ }
+ public void testBookSampleEar() throws Exception{
+ String[] args2 = new String[]{"target/generated/samples/bookquote.ear","-o"+outDir+"withoutWSDL/bookquote-ear/"};
+ Ws4J2EEwithoutWSDL.main(args2);
+ }
}
1.4 +7 -0 ws-axis/contrib/ews/test/org/apache/geronimo/ews/ws4j2ee/JaxRpcMappingTest.java
Index: JaxRpcMappingTest.java
===================================================================
RCS file: /home/cvs/ws-axis/contrib/ews/test/org/apache/geronimo/ews/ws4j2ee/JaxRpcMappingTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JaxRpcMappingTest.java 14 Jun 2004 08:20:31 -0000 1.3
+++ JaxRpcMappingTest.java 22 Jun 2004 09:14:50 -0000 1.4
@@ -70,6 +70,7 @@
import org.apache.geronimo.ews.jaxrpcmapping.J2eeEmitter;
import org.apache.geronimo.ews.jaxrpcmapping.JaxRpcMapper;
import org.apache.geronimo.ews.ws4j2ee.context.ContextFactory;
+import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
import org.apache.geronimo.ews.ws4j2ee.context.JaxRpcMapperContext;
import org.apache.geronimo.ews.ws4j2ee.context.wsdl.WSDLContext;
@@ -86,6 +87,8 @@
public void testGoogleTypeMapping() throws Exception{
try {
+ J2EEWebServiceContext context = ContextFactory.getJ2EEWsContext(true);
+ context.setMiscInfo(ContextFactory.createMiscInfo());
String mappingfile = sampleDir +"mapper/google/GoogleSearch.xml";
String wsdlfile = sampleDir +"mapper/google/GoogleSearch.wsdl";
J2eeEmitter j2ee = new J2eeEmitter();
@@ -97,11 +100,13 @@
System.out.println();
j2ee.runServerSide(wsdlfile);
WSDLContext wscontext = ContextFactory.createWSDLContext(j2ee.getSymbolTable());
+ context.setWSDLContext(wscontext);
PortEntry port = wscontext.getPort(new QName("GoogleSearchPort"));
BindingEntry be = wscontext.getBinding(new QName("urn:GoogleSearch","GoogleSearchBinding"));
PortTypeEntry pe = wscontext.getPortType(new QName("urn:GoogleSearch","GoogleSearchPort"));
JaxRpcMapper mapper = j2ee.getJaxRpcMapper();
JaxRpcMapperContext mc =ContextFactory.createJaxRpcMapperContext(new Object[]{mapper,j2ee});
+ context.setJAXRPCMappingContext(mc);
Assert.assertNotNull(port);
Assert.assertNotNull(be);
Assert.assertNotNull(pe);
@@ -114,6 +119,8 @@
}
public void testBookTypeMapping() throws Exception{
try {
+ J2EEWebServiceContext context = ContextFactory.getJ2EEWsContext(true);
+ context.setMiscInfo(ContextFactory.createMiscInfo());
String mappingfile = sampleDir +"jaxrpc/book/BookQuote.xml";
String wsdlfile = sampleDir +"jaxrpc/book/BookQuote.wsdl";
J2eeEmitter j2ee = new J2eeEmitter();
1.4 +29 -22 ws-axis/contrib/ews/test/org/apache/geronimo/ews/ws4j2ee/WSDLTest.java
Index: WSDLTest.java
===================================================================
RCS file: /home/cvs/ws-axis/contrib/ews/test/org/apache/geronimo/ews/ws4j2ee/WSDLTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- WSDLTest.java 14 Jun 2004 08:20:31 -0000 1.3
+++ WSDLTest.java 22 Jun 2004 09:14:50 -0000 1.4
@@ -63,12 +63,13 @@
import org.apache.geronimo.ews.AbstractTestCase;
import org.apache.geronimo.ews.jaxrpcmapping.J2eeEmitter;
import org.apache.geronimo.ews.ws4j2ee.context.ContextFactory;
+import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
import org.apache.geronimo.ews.ws4j2ee.context.wsdl.WSDLContext;
/**
* @author hemapani
*/
-public class WSDLTest extends AbstractTestCase{
+public class WSDLTest extends AbstractTestCase {
/**
* @param testName
*/
@@ -76,25 +77,31 @@
super(testName);
}
- public void testGoogleWSDL() throws Exception{
- String mappingfile = sampleDir +"mapper/google/GoogleSearch.xml";
- String wsdlfile = sampleDir + "mapper/google/GoogleSearch.wsdl";
- J2eeEmitter j2ee = new J2eeEmitter();
- j2ee.setMappingFilePath(mappingfile);
- j2ee.setOutputDir(outDir);
- j2ee.setServerSide(true);
- j2ee.setVerbose(false);
- j2ee.setHelperWanted(true);
- System.out.println();
- j2ee.runServerSide(wsdlfile);
- WSDLContext wscontext = ContextFactory.createWSDLContext(j2ee.getSymbolTable());
- PortEntry port = wscontext.getPort(new QName("GoogleSearchPort"));
- BindingEntry be = wscontext.getBinding(new QName("urn:GoogleSearch","GoogleSearchBinding"));
-
- Assert.assertEquals(wscontext.getTargetNSURI(),"urn:GoogleSearch");
- Assert.assertNotNull(port);
- Assert.assertNotNull(be);
- Assert.assertNotNull(wscontext.getService(
- new QName("urn:GoogleSearch","GoogleSearchService")));
- }
+ public void testGoogleWSDL() throws Exception {
+ J2EEWebServiceContext context = ContextFactory.getJ2EEWsContext(true);
+ context.setMiscInfo(ContextFactory.createMiscInfo());
+ String mappingfile = sampleDir + "mapper/google/GoogleSearch.xml";
+ String wsdlfile = sampleDir + "mapper/google/GoogleSearch.wsdl";
+ J2eeEmitter j2ee = new J2eeEmitter();
+ j2ee.setMappingFilePath(mappingfile);
+ j2ee.setOutputDir(outDir);
+ j2ee.setServerSide(true);
+ j2ee.setVerbose(false);
+ j2ee.setHelperWanted(true);
+ System.out.println();
+ j2ee.runServerSide(wsdlfile);
+ WSDLContext wscontext =
+ ContextFactory.createWSDLContext(j2ee.getSymbolTable());
+ PortEntry port = wscontext.getPort(new QName("GoogleSearchPort"));
+ BindingEntry be =
+ wscontext.getBinding(
+ new QName("urn:GoogleSearch", "GoogleSearchBinding"));
+
+ Assert.assertEquals(wscontext.getTargetNSURI(), "urn:GoogleSearch");
+ Assert.assertNotNull(port);
+ Assert.assertNotNull(be);
+ Assert.assertNotNull(
+ wscontext.getService(
+ new QName("urn:GoogleSearch", "GoogleSearchService")));
+ }
}
1.1 ws-axis/contrib/ews/test/org/apache/geronimo/ews/ws4j2ee/PackageModuleTest.java
Index: PackageModuleTest.java
===================================================================
/*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.geronimo.ews.ws4j2ee;
import org.apache.geronimo.ews.AbstractTestCase;
import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
import org.apache.geronimo.ews.ws4j2ee.utils.packager.load.PackageModule;
import org.apache.geronimo.ews.ws4j2ee.utils.packager.load.PackageModuleFactory;
/**
* @author Srinath Perera(hemapani@opensource.lk)
*/
public class PackageModuleTest extends AbstractTestCase {
/**
* @param testName
*/
public PackageModuleTest(String testName) {
super(testName);
}
public void testLoadWarFile()
throws GenerationFault, ClassNotFoundException {
PackageModule wmod =
PackageModuleFactory.createPackageModule(
"target/generated/samples/simple.war",
true);
ClassLoader cl = wmod.getClassLoaderWithPackageLoaded();
cl.loadClass("com.jwsbook.jaxrpc.BookQuote");
}
public void testLoadEarFile()
throws GenerationFault, ClassNotFoundException {
PackageModule wmod =
PackageModuleFactory.createPackageModule(
"target/generated/samples/bookquote.ear",
true);
ClassLoader cl = wmod.getClassLoaderWithPackageLoaded();
cl.loadClass("com.jwsbook.jaxrpc.BookQuote");
}
}
1.2 +2 -5 ws-axis/contrib/ews/test/testData/testBuildfile.xml
Index: testBuildfile.xml
===================================================================
RCS file: /home/cvs/ws-axis/contrib/ews/test/testData/testBuildfile.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- testBuildfile.xml 14 Jun 2004 06:24:23 -0000 1.1
+++ testBuildfile.xml 22 Jun 2004 09:14:50 -0000 1.2
@@ -1,14 +1,11 @@
<project basedir="." default="compile">
<path id="classpath">
<pathelement location="../../lib/junit-3.8.1.jar"/>
- <pathelement location="H:/j2sdk1.4.1_01/lib/tools.jar"/>
+ <pathelement location="C:/j2sdk1.4.2_02/lib/tools.jar"/>
</path>
<target name="compile">
- <echo ref="classpath"/>
<mkdir dir="../../target/generated/samples/buildfileTest"/>
-
- <javac destdir="../../target/generated/samples/buildfileTest" debug="on"
- executable="H:/j2sdk1.4.1_01/bin/javac">
+ <javac destdir="../../target/generated/samples/buildfileTest" debug="on">
<classpath refid="classpath" />
<src path=".."/>
<include name="testData/BuildTestSample*"/>