camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1025864 - in /camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz: CronScheduledRoutePolicyTest.java SimpleScheduledRoutePolicyTest.java SpringScheduledRoutePolicyTest.java
Date Thu, 21 Oct 2010 07:28:44 GMT
Author: ningjiang
Date: Thu Oct 21 07:28:43 2010
New Revision: 1025864

URL: http://svn.apache.org/viewvc?rev=1025864&view=rev
Log:
clean up the Eclipse warnings of camel-quartz

Modified:
    camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicyTest.java
    camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicyTest.java
    camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringScheduledRoutePolicyTest.java

Modified: camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicyTest.java?rev=1025864&r1=1025863&r2=1025864&view=diff
==============================================================================
--- camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicyTest.java
(original)
+++ camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicyTest.java
Thu Oct 21 07:28:43 2010
@@ -74,7 +74,7 @@ public class CronScheduledRoutePolicyTes
         context.start();
         context.stopRoute("test", 0, TimeUnit.MILLISECONDS);
         
-        Thread.currentThread().sleep(4000);
+        Thread.sleep(4000);
         assertTrue(context.getRouteStatus("test") == ServiceStatus.Started);
         template.sendBody("direct:start", "Ready or not, Here, I come");
 
@@ -85,8 +85,6 @@ public class CronScheduledRoutePolicyTes
     @Test
     public void testScheduledStopRoutePolicy() throws Exception {
         boolean consumerStopped = false;
-  
-        MockEndpoint unreachable = (MockEndpoint) context.getEndpoint("mock:unreachable");
       
         
         context.getComponent("quartz", QuartzComponent.class).setPropertiesFile("org/apache/camel/routepolicy/quartz/myquartz.properties");
         context.getComponent("quartz", QuartzComponent.class).start();
@@ -105,7 +103,7 @@ public class CronScheduledRoutePolicyTes
         });
         context.start();
         
-        Thread.currentThread().sleep(4000);
+        Thread.sleep(4000);
 
         assertTrue(context.getRouteStatus("test") == ServiceStatus.Stopped);
         
@@ -122,8 +120,6 @@ public class CronScheduledRoutePolicyTes
     public void testScheduledSuspendRoutePolicy() throws Exception {
         boolean consumerSuspended = false;
   
-        MockEndpoint unreachable = (MockEndpoint) context.getEndpoint("mock:unreachable");
       
-        
         context.getComponent("quartz", QuartzComponent.class).setPropertiesFile("org/apache/camel/routepolicy/quartz/myquartz.properties");
         context.getComponent("quartz", QuartzComponent.class).start();
         context.addRoutes(new RouteBuilder() {
@@ -139,7 +135,7 @@ public class CronScheduledRoutePolicyTes
         });
         context.start();
         
-        Thread.currentThread().sleep(4000);
+        Thread.sleep(4000);
         try {
             template.sendBody("direct:start", "Ready or not, Here, I come");
         } catch (CamelExecutionException e) {
@@ -177,7 +173,7 @@ public class CronScheduledRoutePolicyTes
             LOG.debug("Consumer successfully suspended");
         } 
         
-        Thread.currentThread().sleep(4000);
+        Thread.sleep(4000);
         template.sendBody("direct:start", "Ready or not, Here, I come");
         
         context.getComponent("quartz", QuartzComponent.class).stop();

Modified: camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicyTest.java?rev=1025864&r1=1025863&r2=1025864&view=diff
==============================================================================
--- camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicyTest.java
(original)
+++ camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicyTest.java
Thu Oct 21 07:28:43 2010
@@ -77,7 +77,7 @@ public class SimpleScheduledRoutePolicyT
         context.start();
         context.stopRoute("test", 0, TimeUnit.MILLISECONDS);
         
-        Thread.currentThread().sleep(5000);
+        Thread.sleep(5000);
         assertTrue(context.getRouteStatus("test") == ServiceStatus.Started);
         template.sendBody("direct:start", "Ready or not, Here, I come");
 
@@ -89,8 +89,6 @@ public class SimpleScheduledRoutePolicyT
     public void testScheduledStopRoutePolicy() throws Exception {
         boolean consumerStopped = false;
   
-        MockEndpoint unreachable = (MockEndpoint) context.getEndpoint("mock:unreachable");
-        
         context.getComponent("quartz", QuartzComponent.class).setPropertiesFile("org/apache/camel/routepolicy/quartz/myquartz.properties");
         context.getComponent("quartz", QuartzComponent.class).start();
         context.addRoutes(new RouteBuilder() {
@@ -109,7 +107,7 @@ public class SimpleScheduledRoutePolicyT
         });
         context.start();
         
-        Thread.currentThread().sleep(4000);
+        Thread.sleep(4000);
 
         assertTrue(context.getRouteStatus("test") == ServiceStatus.Stopped);
         
@@ -125,9 +123,7 @@ public class SimpleScheduledRoutePolicyT
     @Test
     public void testScheduledSuspendRoutePolicy() throws Exception {
         boolean consumerSuspended = false;
-  
-        MockEndpoint unreachable = (MockEndpoint) context.getEndpoint("mock:unreachable");
       
-        
+       
         context.getComponent("quartz", QuartzComponent.class).setPropertiesFile("org/apache/camel/routepolicy/quartz/myquartz.properties");
         context.getComponent("quartz", QuartzComponent.class).start();
         context.addRoutes(new RouteBuilder() {
@@ -146,7 +142,7 @@ public class SimpleScheduledRoutePolicyT
         });
         context.start();
         
-        Thread.currentThread().sleep(4000);
+        Thread.sleep(4000);
         try {
             template.sendBody("direct:start", "Ready or not, Here, I come");
         } catch (CamelExecutionException e) {
@@ -187,7 +183,7 @@ public class SimpleScheduledRoutePolicyT
             LOG.debug("Consumer successfully suspended");
         } 
         
-        Thread.currentThread().sleep(4000);
+        Thread.sleep(4000);
         template.sendBody("direct:start", "Ready or not, Here, I come");
         
         context.getComponent("quartz", QuartzComponent.class).stop();

Modified: camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringScheduledRoutePolicyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringScheduledRoutePolicyTest.java?rev=1025864&r1=1025863&r2=1025864&view=diff
==============================================================================
--- camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringScheduledRoutePolicyTest.java
(original)
+++ camel/trunk/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringScheduledRoutePolicyTest.java
Thu Oct 21 07:28:43 2010
@@ -47,7 +47,7 @@ public abstract class SpringScheduledRou
         
         context.stopRoute("testRoute", 0, TimeUnit.MILLISECONDS);
         
-        Thread.currentThread().sleep(4000);
+        Thread.sleep(4000);
         assertTrue(context.getRouteStatus("testRoute") == ServiceStatus.Started);
         context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here, I
come");
 
@@ -61,7 +61,7 @@ public abstract class SpringScheduledRou
         
         CamelContext context = startRouteWithPolicy("stopPolicy");
         
-        Thread.currentThread().sleep(4000);
+        Thread.sleep(4000);
         assertTrue(context.getRouteStatus("testRoute") == ServiceStatus.Stopped);
         try {
             context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here,
I come");
@@ -78,7 +78,7 @@ public abstract class SpringScheduledRou
 
         CamelContext context = startRouteWithPolicy("suspendPolicy");
         
-        Thread.currentThread().sleep(4000);
+        Thread.sleep(4000);
         try {
             context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here,
I come");
         } catch (CamelExecutionException e) {
@@ -97,13 +97,14 @@ public abstract class SpringScheduledRou
 
         ServiceHelper.suspendService(context.getRoute("testRoute").getConsumer());
         
-        Thread.currentThread().sleep(4000);
+        Thread.sleep(4000);
         context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here, I
come");
         
         context.stop();
         mock.assertIsSatisfied();
     }
     
+    @SuppressWarnings("unchecked")
     private CamelContext startRouteWithPolicy(String policyBeanName) throws Exception {
         CamelContext context = new DefaultCamelContext();
         ArrayList<RouteDefinition> routes = (ArrayList<RouteDefinition>) applicationContext.getBean("testRouteContext");



Mime
View raw message