You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2012/11/12 10:16:45 UTC

svn commit: r1408199 - in /camel/branches/camel-2.10.x: ./ camel-core/src/test/java/org/apache/camel/processor/ components/camel-spring/src/test/java/org/apache/camel/spring/ components/camel-spring/src/test/resources/org/apache/camel/spring/

Author: davsclaus
Date: Mon Nov 12 09:16:44 2012
New Revision: 1408199

URL: http://svn.apache.org/viewvc?rev=1408199&view=rev
Log:
Fixed tests

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/SamplingThrottlerTest.java
    camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/DefaultJMXAgentTest.java
    camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentPropertiesTest.java
    camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentTest.java
    camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/LifecycleStrategyInjectionTest.java
    camel/branches/camel-2.10.x/components/camel-spring/src/test/resources/org/apache/camel/spring/jmx.properties
    camel/branches/camel-2.10.x/components/camel-spring/src/test/resources/org/apache/camel/spring/lifecycleStrategyInjection.xml

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1408193

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/SamplingThrottlerTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/SamplingThrottlerTest.java?rev=1408199&r1=1408198&r2=1408199&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/SamplingThrottlerTest.java (original)
+++ camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/SamplingThrottlerTest.java Mon Nov 12 09:16:44 2012
@@ -44,7 +44,7 @@ public class SamplingThrottlerTest exten
         sendExchangesThroughDroppingThrottler(sentExchanges, 15);
 
         mock.assertIsSatisfied();
-        validateDroppedExchanges(sentExchanges, 2);
+        validateDroppedExchanges(sentExchanges, mock.getReceivedCounter());
     }
 
     public void testBurstySampling() throws Exception {
@@ -62,7 +62,7 @@ public class SamplingThrottlerTest exten
         sendExchangesThroughDroppingThrottler(sentExchanges, 5);
 
         mock.assertIsSatisfied();
-        validateDroppedExchanges(sentExchanges, 2);
+        validateDroppedExchanges(sentExchanges, mock.getReceivedCounter());
     }
 
     public void testSendLotsOfMessagesSimultaneouslyButOnly3GetThrough() throws Exception {

Modified: camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/DefaultJMXAgentTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/DefaultJMXAgentTest.java?rev=1408199&r1=1408198&r2=1408199&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/DefaultJMXAgentTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/DefaultJMXAgentTest.java Mon Nov 12 09:16:44 2012
@@ -34,7 +34,7 @@ import org.springframework.context.suppo
 public class DefaultJMXAgentTest extends SpringTestSupport {
 
     protected MBeanServerConnection mbsc;
-    protected long sleepForConnection = 2000;
+    protected long sleepForConnection = 3000;
 
     @Override
     protected void setUp() throws Exception {
@@ -46,11 +46,14 @@ public class DefaultJMXAgentTest extends
 
     @Override
     protected void tearDown() throws Exception {
-        releaseMBeanServers();
-        mbsc = null;
-        super.tearDown();
+        try {
+            releaseMBeanServers();
+        } finally {
+            mbsc = null;
+            super.tearDown();
+        }
     }
-    
+
     protected void releaseMBeanServers() {
         List<MBeanServer> servers = MBeanServerFactory.findMBeanServer(null);
 
@@ -82,5 +85,5 @@ public class DefaultJMXAgentTest extends
         }
         return mbsc;
     }
-    
+
 }

Modified: camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentPropertiesTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentPropertiesTest.java?rev=1408199&r1=1408198&r2=1408199&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentPropertiesTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentPropertiesTest.java Mon Nov 12 09:16:44 2012
@@ -27,6 +27,11 @@ import org.springframework.context.suppo
 public class JMXAgentPropertiesTest extends JMXAgentTest {
 
     @Override
+    protected int getPort() {
+        return 20009;
+    }
+
+    @Override
     protected AbstractXmlApplicationContext createApplicationContext() {
         return new ClassPathXmlApplicationContext("org/apache/camel/spring/jmxConfigUsingProperties.xml");
     }

Modified: camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentTest.java?rev=1408199&r1=1408198&r2=1408199&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/JMXAgentTest.java Mon Nov 12 09:16:44 2012
@@ -31,13 +31,11 @@ import org.springframework.context.suppo
  */
 public class JMXAgentTest extends DefaultJMXAgentTest {
 
-    protected static final String JMXSERVICEURL = "service:jmx:rmi:///jndi/rmi://localhost:20008/jmxrmi/camel";
+    protected final String jmxServiceUrl = "service:jmx:rmi:///jndi/rmi://localhost:" + getPort() + "/jmxrmi/camel";
     protected JMXConnector clientConnector;
 
-    @Override
-    protected void setUp() throws Exception {
-        sleepForConnection = 2000;
-        super.setUp();
+    protected int getPort() {
+        return 20008;
     }
 
     @Override
@@ -62,7 +60,7 @@ public class JMXAgentTest extends Defaul
     protected MBeanServerConnection getMBeanConnection() throws Exception {
         if (mbsc == null) {
             if (clientConnector == null) {
-                clientConnector = JMXConnectorFactory.connect(new JMXServiceURL(JMXSERVICEURL), null);
+                clientConnector = JMXConnectorFactory.connect(new JMXServiceURL(jmxServiceUrl), null);
             }
             mbsc = clientConnector.getMBeanServerConnection();
         }

Modified: camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/LifecycleStrategyInjectionTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/LifecycleStrategyInjectionTest.java?rev=1408199&r1=1408198&r2=1408199&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/LifecycleStrategyInjectionTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-spring/src/test/java/org/apache/camel/spring/LifecycleStrategyInjectionTest.java Mon Nov 12 09:16:44 2012
@@ -30,7 +30,7 @@ public class LifecycleStrategyInjectionT
     protected AbstractXmlApplicationContext createApplicationContext() {
         return new ClassPathXmlApplicationContext("org/apache/camel/spring/lifecycleStrategyInjection.xml");
     }
-    
+
     public void testInjectedStrategy() throws Exception {
         assertEquals(2, context.getLifecycleStrategies().size());
         assertIsInstanceOf(DummyLifecycleStrategy.class, context.getLifecycleStrategies().get(1));

Modified: camel/branches/camel-2.10.x/components/camel-spring/src/test/resources/org/apache/camel/spring/jmx.properties
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-spring/src/test/resources/org/apache/camel/spring/jmx.properties?rev=1408199&r1=1408198&r2=1408199&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-spring/src/test/resources/org/apache/camel/spring/jmx.properties (original)
+++ camel/branches/camel-2.10.x/components/camel-spring/src/test/resources/org/apache/camel/spring/jmx.properties Mon Nov 12 09:16:44 2012
@@ -15,6 +15,6 @@
 ## limitations under the License.
 ## ------------------------------------------------------------------------
 
-myjmx.port=20008
+myjmx.port=20009
 myjmx.usePlatform=true
 myjmx.disabled=false

Modified: camel/branches/camel-2.10.x/components/camel-spring/src/test/resources/org/apache/camel/spring/lifecycleStrategyInjection.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-spring/src/test/resources/org/apache/camel/spring/lifecycleStrategyInjection.xml?rev=1408199&r1=1408198&r2=1408199&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-spring/src/test/resources/org/apache/camel/spring/lifecycleStrategyInjection.xml (original)
+++ camel/branches/camel-2.10.x/components/camel-spring/src/test/resources/org/apache/camel/spring/lifecycleStrategyInjection.xml Mon Nov 12 09:16:44 2012
@@ -17,19 +17,18 @@
 -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:camel="http://camel.apache.org/schema/spring"
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
-    
+
   <bean id="lifecycleStrategy" class="org.apache.camel.spring.DummyLifecycleStrategy"/>
-  
-  <camel:camelContext>
-    <camel:route>
-      <camel:from uri="seda:start"/>
-      <camel:to uri="mock:result"/>
-    </camel:route>
-  </camel:camelContext>
+
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+    <route>
+      <from uri="direct:start"/>
+      <to uri="mock:result"/>
+    </route>
+  </camelContext>
 
 </beans>