cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1341642 - in /cxf/branches/2.5.x-fixes: common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java
Date Tue, 22 May 2012 21:26:56 GMT
Author: dkulp
Date: Tue May 22 21:26:56 2012
New Revision: 1341642

URL: http://svn.apache.org/viewvc?rev=1341642&view=rev
Log:
Fix compile failures

Modified:
    cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
    cxf/branches/2.5.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java

Modified: cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=1341642&r1=1341641&r2=1341642&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
(original)
+++ cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
Tue May 22 21:26:56 2012
@@ -143,6 +143,13 @@ public final class StaxUtils {
     
     private StaxUtils() {
     }
+    
+    public static void setInnerElementLevelThreshold(int i) {
+        innerElementLevelThreshold = i;
+    }
+    public static void setInnerElementCountThreshold(int i) {
+        innerElementCountThreshold = i;
+    }
 
     /**
      * CXF works with multiple STaX parsers. When we can't find any other way to work 

Modified: cxf/branches/2.5.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java?rev=1341642&r1=1341641&r2=1341642&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java
Tue May 22 21:26:56 2012
@@ -43,6 +43,8 @@ import org.apache.cxf.testutil.common.Ab
 import org.apache.cxf.testutil.common.TestUtil;
 import org.apache.hello_world_soap_http.GreeterImpl;
 import org.apache.hello_world_soap_http.SOAPService;
+
+import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -57,15 +59,19 @@ public class DispatchClientServerWithHug
         TestUtil.getPortNumber(DispatchClientServerWithHugeResponseTest.class); 
     
     public static class Server extends AbstractBusTestServerBase {        
-
+        Endpoint ep;
+        
         protected void run() {
             Object implementor = new GreeterImpl();
             String address = "http://localhost:"
                 + TestUtil.getPortNumber(DispatchClientServerWithHugeResponseTest.class)
                 + "/SOAPDispatchService/SoapDispatchPort";
-            Endpoint.publish(address, implementor);
+            ep = Endpoint.publish(address, implementor);
+        }
+        @Override
+        public void tearDown() {
+            ep.stop();
         }
-
         public static void main(String[] args) {
             try {
                 Server s = new Server();
@@ -81,28 +87,30 @@ public class DispatchClientServerWithHug
 
     @BeforeClass
     public static void startServers() throws Exception {
-        assertTrue("server did not launch correctly", launchServer(Server.class));
+        //must be out of process so the system properties aren't in effect
+        assertTrue("server did not launch correctly", launchServer(Server.class, false));
     }
     
     @org.junit.Before
-    public void setUp() {
+    public void setUp() throws Exception {
         StaxUtils.setInnerElementCountThreshold(12);
         StaxUtils.setInnerElementLevelThreshold(12);
-        BusFactory.getDefaultBus().getOutInterceptors().add(new LoggingOutInterceptor());
-        BusFactory.getDefaultBus().getInInterceptors().add(new LoggingInInterceptor());
+        createBus();
+        getBus().getOutInterceptors().add(new LoggingOutInterceptor());
+        getBus().getInInterceptors().add(new LoggingInInterceptor());
     }
     
     @AfterClass
     public static void cleanup() throws Exception {
         StaxUtils.setInnerElementCountThreshold(-1);
         StaxUtils.setInnerElementLevelThreshold(-1);
-    }   
-   
+    }
+    
     @Test
     public void testStackOverflowErrorForSOAPMessageWithHugeResponse() throws Exception {
         HugeResponseInterceptor hugeResponseInterceptor = 
             new HugeResponseInterceptor(ResponseInterceptorType.overflow);
-        BusFactory.getDefaultBus().getInInterceptors().add(hugeResponseInterceptor);
+        getBus().getInInterceptors().add(hugeResponseInterceptor);
         URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
         assertNotNull(wsdl);
 
@@ -130,7 +138,7 @@ public class DispatchClientServerWithHug
         } catch (Throwable e) {
             assertTrue(e.getCause() instanceof StackOverflowError);
         } finally {
-            BusFactory.getDefaultBus().getInInterceptors().remove(hugeResponseInterceptor);
+            getBus().getInInterceptors().remove(hugeResponseInterceptor);
         }
         
     }
@@ -139,7 +147,7 @@ public class DispatchClientServerWithHug
     public void testThresholdfForSOAPMessageWithHugeResponse() throws Exception {
         HugeResponseInterceptor hugeResponseInterceptor = 
             new HugeResponseInterceptor(ResponseInterceptorType.ElementLevelThreshold);
-        BusFactory.getDefaultBus().getInInterceptors().add(hugeResponseInterceptor);
+        getBus().getInInterceptors().add(hugeResponseInterceptor);
         URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
         assertNotNull(wsdl);
 
@@ -167,7 +175,7 @@ public class DispatchClientServerWithHug
         } catch (Throwable e) {
             assertTrue(e.getCause().getMessage().startsWith("reach the innerElementLevelThreshold"));
         } finally {
-            BusFactory.getDefaultBus().getInInterceptors().remove(hugeResponseInterceptor);
+            getBus().getInInterceptors().remove(hugeResponseInterceptor);
         }
         
     }
@@ -176,7 +184,7 @@ public class DispatchClientServerWithHug
     public void testElementCountThresholdfForSOAPMessageWithHugeResponse() throws Throwable
{
         HugeResponseInterceptor hugeResponseInterceptor = 
             new HugeResponseInterceptor(ResponseInterceptorType.ElementCountThreshold);
-        BusFactory.getDefaultBus().getInInterceptors().add(hugeResponseInterceptor);
+        getBus().getInInterceptors().add(hugeResponseInterceptor);
         URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
         assertNotNull(wsdl);
 
@@ -211,7 +219,7 @@ public class DispatchClientServerWithHug
             }
             assertTrue(e.getCause().getMessage().startsWith("reach the innerElementCountThreshold"));
         } finally {
-            BusFactory.getDefaultBus().getInInterceptors().remove(hugeResponseInterceptor);
+            getBus().getInInterceptors().remove(hugeResponseInterceptor);
         }
         
     }



Mime
View raw message