You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ni...@apache.org on 2011/02/10 08:28:00 UTC

svn commit: r1069249 - in /cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring: AbstractSimpleFrontendSpringTest.java ClientServerTest.java SpringBeansTest.java

Author: ningjiang
Date: Thu Feb 10 07:28:00 2011
New Revision: 1069249

URL: http://svn.apache.org/viewvc?rev=1069249&view=rev
Log:
CXF-3326 fixed the test error of RountripTest

Added:
    cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/AbstractSimpleFrontendSpringTest.java   (with props)
Modified:
    cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/ClientServerTest.java
    cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java

Added: cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/AbstractSimpleFrontendSpringTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/AbstractSimpleFrontendSpringTest.java?rev=1069249&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/AbstractSimpleFrontendSpringTest.java (added)
+++ cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/AbstractSimpleFrontendSpringTest.java Thu Feb 10 07:28:00 2011
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.cxf.frontend.spring;
+
+import org.apache.cxf.BusFactory;
+import org.junit.After;
+import org.junit.Assert;
+import org.springframework.context.support.AbstractApplicationContext;
+
+public class AbstractSimpleFrontendSpringTest extends Assert {
+    protected AbstractApplicationContext ctx;
+
+    @After
+    public void tearDown() throws Exception {
+        if (ctx != null) {
+            ctx.close();
+            ctx = null;
+        }
+        BusFactory.setDefaultBus(null);
+    }
+
+}

Propchange: cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/AbstractSimpleFrontendSpringTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/AbstractSimpleFrontendSpringTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/ClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/ClientServerTest.java?rev=1069249&r1=1069248&r2=1069249&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/ClientServerTest.java (original)
+++ cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/ClientServerTest.java Thu Feb 10 07:28:00 2011
@@ -19,8 +19,6 @@
 package org.apache.cxf.frontend.spring;
 import java.util.Arrays;
 
-import junit.framework.Assert;
-
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.frontend.ClientProxy;
@@ -34,13 +32,15 @@ import org.junit.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 
+
+
 // set up the client and server with spring bean configuration
 
-public class ClientServerTest extends Assert {
+public class ClientServerTest extends AbstractSimpleFrontendSpringTest {
+    
     @Test
     public void testClientServer() {
-        BusFactory.setDefaultBus(null);
-        ClassPathXmlApplicationContext ctx = 
+        ctx = 
             new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/frontend/spring/rountrip.xml"});
         
         HelloService greeter = (HelloService) ctx.getBean("client");
@@ -62,6 +62,8 @@ public class ClientServerTest extends As
         result = greeter.sayHello();
         assertTrue(out.wasCalled());
         assertTrue(in.wasCalled());
+        ctx.close();
+        BusFactory.setDefaultBus(null);
     }
     
     private class TestInterceptor extends AbstractPhaseInterceptor<Message> {

Modified: cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java?rev=1069249&r1=1069248&r2=1069249&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java (original)
+++ cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java Thu Feb 10 07:28:00 2011
@@ -19,7 +19,6 @@
 package org.apache.cxf.frontend.spring;
 
 import java.util.List;
-import junit.framework.Assert;
 
 import org.apache.cxf.binding.BindingConfiguration;
 import org.apache.cxf.binding.soap.Soap12;
@@ -44,11 +43,11 @@ import org.junit.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 
-public class SpringBeansTest extends Assert {
+public class SpringBeansTest extends AbstractSimpleFrontendSpringTest {
 
     @Test
     public void testServers() throws Exception {
-        ClassPathXmlApplicationContext ctx =
+        ctx =
             new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/frontend/spring/servers.xml"});
 
         ServerFactoryBean bean = (ServerFactoryBean) ctx.getBean("simple");
@@ -86,7 +85,7 @@ public class SpringBeansTest extends Ass
     @Test
     public void testClients() throws Exception {
         AbstractFactoryBeanDefinitionParser.setFactoriesAreAbstract(false);
-        ClassPathXmlApplicationContext ctx =
+        ctx =
             new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/frontend/spring/clients.xml"});
 
         Object bean = ctx.getBean("client1.proxyFactory");