axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hemap...@apache.org
Subject cvs commit: ws-axis/contrib/ews/test/org/apache/geronimo/ews/ws4j2ee WebApplicationTest.java
Date Thu, 28 Oct 2004 05:21:21 GMT
hemapani    2004/10/27 22:21:20

  Modified:    contrib/ews project.xml
               contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/parsers
                        WebDDParser.java
               contrib/ews/samples/servlet/echo/WEB-INF web.xml
               contrib/ews/test/org/apache/geronimo/ews/ws4j2ee
                        WebApplicationTest.java
  Log:
  fix the WebApplication working ..
  yet some problems runing it in the maven so excludes the test
  
  Revision  Changes    Path
  1.19      +37 -146   ws-axis/contrib/ews/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/ews/project.xml,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- project.xml	27 Oct 2004 15:15:14 -0000	1.18
  +++ project.xml	28 Oct 2004 05:21:20 -0000	1.19
  @@ -175,13 +175,17 @@
   	 </sourceModifications>
   
       <unitTestSourceDirectory>test</unitTestSourceDirectory>
  +    
  +    
   
       <unitTest>
  -      <includes>
  -        <include>**/*Test.java</include>
  -		<exclude>**/*WebApplicationTest.java</exclude> 
  -		<exclude>**/*MapperTest.java</exclude> 
  -      </includes>
  +	  <includes>
  +	    <include>**/*Test.java</include>
  +	  </includes>
  +	    <excludes>
  +			<exclude>**/WebApplicationTest.java</exclude> 
  +			<exclude>**/*MapperTest.java</exclude> 
  +		</excludes>
       </unitTest>
   
       <resources>
  @@ -215,91 +219,6 @@
       <!-- ============ -->
   
       <dependencies>
  -		<!-- 	
  -        <dependency>
  -            <groupId>jaxb-ri</groupId>
  -            <artifactId>jaxb-api</artifactId>
  -            <version>SNAPSHOT</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -        <dependency>
  -            <groupId>jaxb-ri</groupId>
  -            <artifactId>jaxb-impl</artifactId>
  -            <version>SNAPSHOT</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -        <dependency>
  -            <groupId>jaxb-ri</groupId>
  -            <artifactId>jaxb-libs</artifactId>
  -            <version>SNAPSHOT</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -        <dependency>
  -            <groupId>jaxb-ri</groupId>
  -            <artifactId>jaxb-xjc</artifactId>
  -            <version>SNAPSHOT</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -        <dependency>
  -            <groupId>jaxb-ri</groupId>
  -            <artifactId>namespace</artifactId>
  -            <version>SNAPSHOT</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -        <dependency>
  -            <groupId>jaxb-ri</groupId>
  -            <artifactId>relaxngDatatype</artifactId>
  -            <version>SNAPSHOT</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -        <dependency>
  -            <groupId>jaxb-ri</groupId>
  -            <artifactId>xsdlib</artifactId>
  -            <version>SNAPSHOT</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -        -->
  -		<!--
  -        <dependency>
  -            <groupId>sec</groupId>
  -            <artifactId>wss4j</artifactId>
  -            <version>SNAPSHOT</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -		
  -        <dependency>
  -            <groupId>sec</groupId>
  -            <artifactId>xmlsec</artifactId>
  -            <version>SNAPSHOT</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -        <dependency>
  -            <groupId>sec</groupId>
  -            <artifactId>opensaml</artifactId>
  -            <version>DEV</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -		-->
           <dependency>
               <groupId>geronimo-spec</groupId>
               <artifactId>geronimo-spec-ejb</artifactId>
  @@ -316,56 +235,6 @@
                   <module>true</module>
               </properties>
           </dependency>
  -<!--                
  -		<dependency>
  -            <groupId>geronimo</groupId>
  -            <artifactId>geronimo-core</artifactId>
  -            <version>1.0-M1</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -        <dependency>
  -            <groupId>geronimo</groupId>
  -            <artifactId>geronimo-kernel</artifactId>
  -            <version>1.0-M1</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -        <dependency>
  -            <groupId>geronimo</groupId>
  -            <artifactId>geronimo-deployment</artifactId>
  -            <version>1.0-M1</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -        <dependency>
  -            <groupId>dom4j</groupId>
  -            <artifactId>dom4j</artifactId>
  -            <version>1.4</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -        <dependency>
  -            <groupId>xerces</groupId>
  -            <artifactId>xercesImpl</artifactId>
  -            <version>2.6.0</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -        <dependency>
  -            <groupId>xerces</groupId>
  -            <artifactId>xmlParserAPIs</artifactId>
  -            <version>2.2.1</version>
  -            <properties>
  -                <module>true</module>
  -            </properties>
  -        </dependency>
  -        -->
           <!-- Module Dependencies -->
           <dependency>
               <groupId>axis</groupId>
  @@ -424,24 +293,46 @@
                   <module>true</module>
               </properties>
           </dependency>
  -<!--
  +
  +        <dependency>
  +            <groupId>xmlbeans</groupId>
  +            <artifactId>xbean-apache-1.0</artifactId>
  +            <version>DEV</version>
  +            <properties>
  +                <module>true</module>
  +            </properties>
  +        </dependency>
  +        
  +        <!-- Uncomment to enable the security -->
  +		<!-- 
  +		
  +        <dependency>
  +            <groupId>sec</groupId>
  +            <artifactId>wss4j</artifactId>
  +            <version>SNAPSHOT</version>
  +            <properties>
  +                <module>true</module>
  +            </properties>
  +        </dependency>
  +		
           <dependency>
  -            <groupId>openejb</groupId>
  -            <artifactId>openejb-core-2.0</artifactId>
  +            <groupId>sec</groupId>
  +            <artifactId>xmlsec</artifactId>
               <version>SNAPSHOT</version>
               <properties>
                   <module>true</module>
               </properties>
           </dependency>
  --->        
           <dependency>
  -            <groupId>xmlbeans</groupId>
  -            <artifactId>xbean-apache-1.0</artifactId>
  +            <groupId>sec</groupId>
  +            <artifactId>opensaml</artifactId>
               <version>DEV</version>
               <properties>
                   <module>true</module>
               </properties>
           </dependency>
  +		-->
  +        
   
       </dependencies>
   </project>
  
  
  
  1.12      +3 -1      ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/parsers/WebDDParser.java
  
  Index: WebDDParser.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/ews/src/org/apache/geronimo/ews/ws4j2ee/parsers/WebDDParser.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- WebDDParser.java	27 Oct 2004 14:59:39 -0000	1.11
  +++ WebDDParser.java	28 Oct 2004 05:21:20 -0000	1.12
  @@ -58,11 +58,13 @@
           Document doc = EWSUtils.createDocument(inputStream);
           Element root = doc.getDocumentElement();
           NodeList sevlele = root.getElementsByTagName("servlet");
  +        
  +        String j2eeLink = j2eewscontext.getMiscInfo().getJ2eeComponetLink();
           int count = 0;
           while (count < sevlele.getLength()) {
               Element serv = (Element) sevlele.item(count);
               servletName = Utils.getElementValue(serv.getElementsByTagName("servlet-name"));
  -            if (servletName.equals(j2eewscontext.getMiscInfo().getJ2eeComponetLink()))
{
  +            if (servletName.equals(j2eeLink)) {
                   servletClass = Utils.getElementValue(serv.getElementsByTagName("servlet-class"));
                   context = new WebDDContextImpl(servletClass, servletName);
                   return;
  
  
  
  1.2       +1 -1      ws-axis/contrib/ews/samples/servlet/echo/WEB-INF/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/ews/samples/servlet/echo/WEB-INF/web.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- web.xml	12 Oct 2004 10:56:57 -0000	1.1
  +++ web.xml	28 Oct 2004 05:21:20 -0000	1.2
  @@ -4,7 +4,7 @@
            xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
            version="2.4">
     <servlet>
  -    <servlet-name>simple</servlet-name>
  +    <servlet-name>echo</servlet-name>
       <servlet-class>org.apache.ws.echosample.EchoBean</servlet-class>
       <load-on-startup>1</load-on-startup>
     </servlet>
  
  
  
  1.4       +67 -62    ws-axis/contrib/ews/test/org/apache/geronimo/ews/ws4j2ee/WebApplicationTest.java
  
  Index: WebApplicationTest.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/contrib/ews/test/org/apache/geronimo/ews/ws4j2ee/WebApplicationTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WebApplicationTest.java	27 Oct 2004 10:16:23 -0000	1.3
  +++ WebApplicationTest.java	28 Oct 2004 05:21:20 -0000	1.4
  @@ -46,73 +46,78 @@
       }
       protected void setUp() throws Exception {
   //        File wsddFile = new File(getTestFile("target/server-config.wsdd"));
  -//        if(!wsddFile.exists()){
  -//            wsddFile.createNewFile();
  -//            OutputStream out = new FileOutputStream(wsddFile);
  -//            
  -//            InputStream in = Thread.currentThread().getContextClassLoader()
  -//                .getResourceAsStream("org/apache/axis/server/server-config.wsdd");
  -//            getTestFile("target/server-config.wsdd");
  -//            byte[] buf = new byte[1024];
  -//            int read = in.read(buf);
  -//        
  -//            while(read > 0){
  -//                out.write(buf,0,read);
  -//                read = in.read(buf);
  -//            }
  -//            in.close();
  -//            out.close();
  +//        wsddFile.delete();
  +//        wsddFile.createNewFile();
  +//        OutputStream out = new FileOutputStream(wsddFile);
  +        
  +        InputStream in = Thread.currentThread().getContextClassLoader()
  +            .getResourceAsStream("org/apache/axis/server/server-config.wsdd");
  +        
  +//        byte[] buf = new byte[1024];
  +//        int read = in.read(buf);
  +//    
  +//        while(read > 0){
  +//            out.write(buf,0,read);
  +//            read = in.read(buf);
   //        }
  -//
  -//        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
  -//        dbf.setNamespaceAware(true);
  -//        DocumentBuilder db = dbf.newDocumentBuilder();
  -//        WSDDDocument wsdddoc = new WSDDDocument(db.parse(wsddFile));
  -//        SimpleAxisServer sas = new SimpleAxisServer();
  -//        sas.setServerSocket(new ServerSocket(5555));
  -//        sas.setMyConfig(wsdddoc.getDeployment());
  -//        sas.start();
  -//        
  +//        in.close();
  +//        out.close();
  +                        
  +
  +        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
  +        dbf.setNamespaceAware(true);
  +        DocumentBuilder db = dbf.newDocumentBuilder();
  +        WSDDDocument wsdddoc = new WSDDDocument(db.parse(in));
  +        SimpleAxisServer sas = new SimpleAxisServer();
  +        sas.setServerSocket(new ServerSocket(5555));
  +        sas.setMyConfig(wsdddoc.getDeployment());
  +        sas.start();
  +        
       }
       
       
       public void testEcho()throws Exception{
  -//        String[] args2 = new String[]{
  -//                getTestFile("target/generated/samples/echo.war"),"-o",
  -//                outDir+"withoutWSDL/echo-war/"};
  -//        Ws4J2ee.main(args2);
  -//
  -//        File jarFile = new File("target/generated/samples/withoutWSDL/echo-war/");
  -//        
  -//        URLClassLoader cl = new URLClassLoader(new URL[]{jarFile.toURL()});
  -//        InputStream deplydd = cl.getResourceAsStream("deploy.wsdd");
  -//        assertNotNull(deplydd);
  -//
  -//        ClassLoader parentClassLoder = ClassUtils.getDefaultClassLoader();
  -//        ClassUtils.setDefaultClassLoader(cl);
  -//        AdminClient adminClient = new AdminClient();
  -//
  -//        URL requestUrl = new URL("http://localhost:5555/axis/services/AdminService");
  -//        Call call = adminClient.getCall();
  -//        call.setTargetEndpointAddress(requestUrl);
  -//        String result = adminClient.process(null, deplydd);
  -//        System.out.println(result);
  -//
  -//        Class echoLoacaterClass = ClassUtils.forName("org.apache.ws.echosample.EchoServiceLocator");
  -//        Class structClass = ClassUtils.forName("org.apache.ws.echosample.EchoStruct");
  -//
  -//        Object echoLoacater = echoLoacaterClass.newInstance();
  -//        Method getportMethod = echoLoacaterClass.getMethod("getechoPort", new Class[]{URL.class});
  -//
  -//        URL serviceURL = new URL("http://localhost:5555/axis/services/echoPort");
  -//        Object echoPort = getportMethod.invoke(echoLoacater, new Object[]{serviceURL});
  -//        Class echoClass = echoPort.getClass();
  -//
  -//        Method echostuctMethod = echoClass.getMethod("echoStruct", new Class[]{structClass});
  -//        Object structval = structClass.newInstance();
  -//
  -//        Object structret = echostuctMethod.invoke(echoPort, new Object[]{null});
  -//        System.out.println("Sucssessful");
  +        String[] args2 = new String[]{
  +               getTestFile("target/generated/samples/echo.war"),"-o",
  +                outDir+"withoutWSDL/echo-war/"};
  +        Ws4J2ee.main(args2);
  +
  +        File jarFile = new File("target/generated/samples/withoutWSDL/echo-war/echo-ewsimpl.jar");
  +        
  +        URLClassLoader cl = new URLClassLoader(new URL[]{jarFile.toURL()});
  +        InputStream deplydd = cl.getResourceAsStream("deploy.wsdd");
  +        assertNotNull(deplydd);
  +
  +        ClassLoader parentClassLoder = ClassUtils.getDefaultClassLoader();
  +        ClassUtils.setDefaultClassLoader(cl);
  +        AdminClient adminClient = new AdminClient();
  +
  +        URL requestUrl = new URL("http://localhost:5555/axis/services/AdminService");
  +        Call call = adminClient.getCall();
  +        call.setTargetEndpointAddress(requestUrl);
  +        String result = adminClient.process(null, deplydd);
  +        System.out.println(result);
  +
  +        Class echoLoacaterClass = ClassUtils.forName("org.apache.ws.echosample.EchoServiceLocator");
  +        Class structClass = ClassUtils.forName("org.apache.ws.echosample.EchoStruct");
  +
  +        Object echoLoacater = echoLoacaterClass.newInstance();
  +        Method getportMethod = echoLoacaterClass.getMethod("getechoPort", new Class[]{URL.class});
  +
  +        URL serviceURL = new URL("http://localhost:5555/axis/services/echoPort");
  +        Object echoPort = getportMethod.invoke(echoLoacater, new Object[]{serviceURL});
  +        Class echoClass = echoPort.getClass();
  +
  +        Method echoStringMethod = echoClass.getMethod("echoString", new Class[]{String.class});
  +        String in = "Hello";
  +        assertEquals(in,echoStringMethod.invoke(echoPort, new Object[]{in}));
  +
  +        
  +        Method echostuctMethod = echoClass.getMethod("echoStruct", new Class[]{structClass});
  +        Object structval = structClass.newInstance();
  +        Object structret = echostuctMethod.invoke(echoPort, new Object[]{structval});
  +        
  +        System.out.println("Sucssessful");
           
       }
       protected void tearDown() throws Exception {
  
  
  

Mime
View raw message