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 de...@apache.org on 2005/08/17 12:15:30 UTC

svn commit: r233152 - in /webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mail: MailCharSetEncodingTest.java UtilsMailServer.java

Author: deepal
Date: Wed Aug 17 03:14:46 2005
New Revision: 233152

URL: http://svn.apache.org/viewcvs?rev=233152&view=rev
Log:
fixing mail transport test case 

Modified:
    webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java
    webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mail/UtilsMailServer.java

Modified: webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java?rev=233152&r1=233151&r2=233152&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java (original)
+++ webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java Wed Aug 17 03:14:46 2005
@@ -1,19 +1,19 @@
 /*
- * 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.
- * 
- */
+* 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.
+*
+*/
 
 package org.apache.axis2.mail;
 
@@ -76,6 +76,8 @@
 
     ServiceContext clientServiceContext;
 
+    ConfigurationContext clientConfigContext;
+
     public MailCharSetEncodingTest() {
         super(MailCharSetEncodingTest.class.getName());
     }
@@ -104,8 +106,11 @@
         envelope = null;
         String expected = value;
         try {
-            ConfigurationContext clientConfigContext = UtilsMailServer
-                    .createClientConfigurationContext();
+            if (clientConfigContext ==null) {
+                clientConfigContext = UtilsMailServer
+                        .createClientConfigurationContext();
+                engineRegistry = clientConfigContext.getAxisConfiguration();
+            }
             ServiceDescription clientService = new ServiceDescription(
                     serviceName);
             OperationDescription clientOperation = new OperationDescription(
@@ -115,11 +120,10 @@
                     envelope = messgeCtx.getEnvelope();
                 }
             });
+            engineRegistry.removeService(serviceName);
             clientService.addOperation(clientOperation);
-            clientConfigContext.getAxisConfiguration()
-                    .addService(clientService);
-            Utils.resolvePhases(clientConfigContext.getAxisConfiguration(),
-                    clientService);
+            engineRegistry.addService(clientService);
+            Utils.resolvePhases(engineRegistry, clientService);
             clientServiceContext = clientConfigContext
                     .createServiceContext(serviceName);
 
@@ -151,7 +155,7 @@
                             "Async response is taking too long[10s+]. Server is being shut down.");
                 }
             }
-            call.close();
+           // call.close();
             call = null;
             assertNotNull("Result is null", resultElem);
             String result = ((OMElement) resultElem.getFirstChild()

Modified: webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mail/UtilsMailServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mail/UtilsMailServer.java?rev=233152&r1=233151&r2=233152&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mail/UtilsMailServer.java (original)
+++ webservices/axis/trunk/java/modules/integration/test/org/apache/axis2/mail/UtilsMailServer.java Wed Aug 17 03:14:46 2005
@@ -1,20 +1,20 @@
 /*
- * 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.
- *
- *  Runtime state of the engine
- */
+* 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.
+*
+*  Runtime state of the engine
+*/
 package org.apache.axis2.mail;
 
 import junit.framework.TestCase;
@@ -29,7 +29,7 @@
 
 public class UtilsMailServer {
     private static final String MAIL_TRANSPORT_SERVER_ENABLED_REPO_PATH =
-        Constants.TESTING_PATH + "mail-transport-server-enabledRepository";
+            Constants.TESTING_PATH + "mail-transport-server-enabledRepository";
     private static final String MAIL_TRANSPORT_CLIENT_ENABLED_REPO_PATH =
             Constants.TESTING_PATH + "mail-transport-client-enabledRepository";
 
@@ -39,15 +39,15 @@
     private static int runningServerCount = 0;
 
     public synchronized static ConfigurationContext start() throws Exception {
-        
-        //start the mail server      
+
+        //start the mail server
         if (runningServerCount == 0) {
             SERVER_CONFIG_CONTEXT = createServerConfigurationContext();
             server =
-                new MailServer(
-            SERVER_CONFIG_CONTEXT,
-                    MailSrvConstants.POP_SERVER_PORT,
-                    MailSrvConstants.SMTP_SERVER_PORT);
+                    new MailServer(
+                            SERVER_CONFIG_CONTEXT,
+                            MailSrvConstants.POP_SERVER_PORT,
+                            MailSrvConstants.SMTP_SERVER_PORT);
         }
         runningServerCount++;
         return SERVER_CONFIG_CONTEXT;
@@ -56,24 +56,24 @@
         if(SERVER_CONFIG_CONTEXT == null){
             File file = new File(MAIL_TRANSPORT_SERVER_ENABLED_REPO_PATH);
             TestCase.assertTrue(
-                "Mail repository directory " + file.getAbsolutePath() + " does not exsist",
-                file.exists());
+                    "Mail repository directory " + file.getAbsolutePath() + " does not exsist",
+                    file.exists());
             ConfigurationContextFactory builder = new ConfigurationContextFactory();
             SERVER_CONFIG_CONTEXT =
-                builder.buildConfigurationContext(file.getAbsolutePath());
+                    builder.buildConfigurationContext(file.getAbsolutePath());
         }
         return SERVER_CONFIG_CONTEXT;
     }
-    
-    
+
+
     public static ConfigurationContext createClientConfigurationContext() throws Exception {
         if(CLIENT_CONFIG_CONTEXT == null){
-            File file = new File(MAIL_TRANSPORT_CLIENT_ENABLED_REPO_PATH);
-            TestCase.assertTrue(
+        File file = new File(MAIL_TRANSPORT_CLIENT_ENABLED_REPO_PATH);
+        TestCase.assertTrue(
                 "Mail repository directory " + file.getAbsolutePath() + " does not exsist",
                 file.exists());
-            ConfigurationContextFactory builder = new ConfigurationContextFactory();
-            CLIENT_CONFIG_CONTEXT =
+        ConfigurationContextFactory builder = new ConfigurationContextFactory();
+        CLIENT_CONFIG_CONTEXT =
                 builder.buildConfigurationContext(file.getAbsolutePath());
         }
         return CLIENT_CONFIG_CONTEXT;