camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r792468 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/camel/processor/interceptor/ camel-core/src/test/java/org/apache/camel/component/file/ camel-core/src/test/java/org/apache/camel/...
Date Thu, 09 Jul 2009 09:15:52 GMT
Author: davsclaus
Date: Thu Jul  9 09:15:47 2009
New Revision: 792468

URL: http://svn.apache.org/viewvc?rev=792468&view=rev
Log:
CAMEL-1815: removed debugger that was newer developed and useable. Use tracer instead.

Removed:
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Breakpoint.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/DebugInterceptor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/Debugger.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/ExceptionEvent.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DebugInterceptorTest.java
Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MainSupport.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/ToFileRouteTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateAsyncTest.java
    camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRemoteFileSorterTest.java
    camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
    camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
    camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MainSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MainSupport.java?rev=792468&r1=792467&r2=792468&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MainSupport.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MainSupport.java Thu Jul  9
09:15:47 2009
@@ -33,7 +33,6 @@
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.model.RouteDefinition;
-import org.apache.camel.processor.interceptor.Debugger;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.view.ModelFileGenerator;
 import org.apache.camel.view.RouteDotGenerator;
@@ -53,7 +52,6 @@
     private TimeUnit timeUnit = TimeUnit.MILLISECONDS;    
     private String routesOutputFile;
     private boolean aggregateDot;
-    private boolean debug;
     private boolean trace;
     private List<RouteBuilder> routeBuilders = new ArrayList<RouteBuilder>();
     private final List<CamelContext> camelContexts = new ArrayList<CamelContext>();
@@ -93,11 +91,6 @@
             }
         });
 
-        addOption(new Option("x", "debug", "Enables the debugger") {
-            protected void doProcess(String arg, LinkedList<String> remainingArgs)
{
-                enableDebug();
-            }
-        });
         addOption(new Option("t", "trace", "Enables tracing") {
             protected void doProcess(String arg, LinkedList<String> remainingArgs)
{
                 enableTrace();
@@ -223,20 +216,15 @@
         return aggregateDot;
     }
 
-    public boolean isDebug() {
-        return debug;
-    }
-
-    public void enableDebug() {
-        this.debug = true;
-    }
-
     public boolean isTrace() {
         return trace;
     }
 
     public void enableTrace() {
         this.trace = true;
+        for (CamelContext context : camelContexts) {
+            context.setTracing(true);
+        }
     }
 
     public void setRoutesOutputFile(String routesOutputFile) {
@@ -247,22 +235,6 @@
         return routesOutputFile;
     }
 
-    /**
-     * Returns the currently active debugger if one is enabled
-     *
-     * @return the current debugger or null if none is active
-     * @see #enableDebug()
-     */
-    public Debugger getDebugger() {
-        for (CamelContext camelContext : camelContexts) {
-            Debugger debugger = Debugger.getDebugger(camelContext);
-            if (debugger != null) {
-                return debugger;
-            }
-        }
-        return null;
-    }
-
     protected void doStop() throws Exception {
         LOG.info("Apache Camel " + getVersion() + " stopping");
         // call completed to properly stop as we count down the waiting latch

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/ToFileRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/ToFileRouteTest.java?rev=792468&r1=792467&r2=792468&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/ToFileRouteTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/ToFileRouteTest.java
Thu Jul  9 09:15:47 2009
@@ -34,7 +34,7 @@
         mock.expectedMessageCount(1);
         mock.expectedFileExists("target/test-reports/report.txt");
 
-        template.sendBody("seda:reports", "This is a great report");
+        template.sendBody("direct:reports", "This is a great report");
 
         assertMockEndpointsSatisfied();
     }
@@ -51,7 +51,7 @@
             public void configure() throws Exception {
                 // the reports from the seda queue is processed by our processor
                 // before they are written to files in the target/reports directory
-                from("seda:reports").processRef("processReport").to("file://target/test-reports",
"mock:result");
+                from("direct:reports").processRef("processReport").to("file://target/test-reports",
"mock:result");
             }
         };
     }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateAsyncTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateAsyncTest.java?rev=792468&r1=792467&r2=792468&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateAsyncTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/impl/DefaultProducerTemplateAsyncTest.java
Thu Jul  9 09:15:47 2009
@@ -51,8 +51,8 @@
         Exchange result = future.get();
 
         long delta = System.currentTimeMillis() - start;
-        assertTrue("Should take longer than: " + delta, delta > 250);
         assertEquals("Hello World", result.getOut().getBody());
+        assertTrue("Should take longer than: " + delta, delta > 250);
 
         assertMockEndpointsSatisfied();
     }
@@ -72,8 +72,8 @@
         Exchange result = future.get();
 
         long delta = System.currentTimeMillis() - start;
-        assertTrue("Should take longer than: " + delta, delta > 250);
         assertEquals("Hello World", result.getOut().getBody());
+        assertTrue("Should take longer than: " + delta, delta > 250);
     }
 
     public void testRequestAsyncBody() throws Exception {
@@ -88,8 +88,8 @@
         String result = template.extractFutureBody(future, String.class);
 
         long delta = System.currentTimeMillis() - start;
-        assertTrue("Should take longer than: " + delta, delta > 250);
         assertEquals("Hello World", result);
+        assertTrue("Should take longer than: " + delta, delta > 250);
     }
 
     public void testRequestAsyncBodyType() throws Exception {
@@ -104,8 +104,8 @@
         String result = future.get();
 
         long delta = System.currentTimeMillis() - start;
-        assertTrue("Should take longer than: " + delta, delta > 250);
         assertEquals("Hello World", result);
+        assertTrue("Should take longer than: " + delta, delta > 250);
     }
 
     public void testRequestAsyncBodyAndHeader() throws Exception {
@@ -126,8 +126,8 @@
         assertMockEndpointsSatisfied();
 
         long delta = System.currentTimeMillis() - start;
-        assertTrue("Should take longer than: " + delta, delta > 250);
         assertEquals("Hello World", result);
+        assertTrue("Should take longer than: " + delta, delta > 250);
     }
 
     public void testRequestAsyncBodyAndHeaderType() throws Exception {
@@ -148,8 +148,8 @@
         assertMockEndpointsSatisfied();
 
         long delta = System.currentTimeMillis() - start;
-        assertTrue("Should take longer than: " + delta, delta > 250);
         assertEquals("Hello World", result);
+        assertTrue("Should take longer than: " + delta, delta > 250);
     }
 
     public void testRequestAsyncBodyAndHeaders() throws Exception {
@@ -174,8 +174,8 @@
         assertMockEndpointsSatisfied();
 
         long delta = System.currentTimeMillis() - start;
-        assertTrue("Should take longer than: " + delta, delta > 250);
         assertEquals("Hello World", result);
+        assertTrue("Should take longer than: " + delta, delta > 250);
     }
 
     public void testRequestAsyncBodyAndHeadersType() throws Exception {
@@ -200,8 +200,8 @@
         assertMockEndpointsSatisfied();
 
         long delta = System.currentTimeMillis() - start;
-        assertTrue("Should take longer than: " + delta, delta > 250);
         assertEquals("Hello World", result);
+        assertTrue("Should take longer than: " + delta, delta > 250);
     }
 
     public void testRequestAsyncErrorWhenProcessing() throws Exception {
@@ -268,8 +268,8 @@
         assertMockEndpointsSatisfied();
 
         long delta = System.currentTimeMillis() - start;
-        assertTrue("Should take longer than: " + delta, delta > 250);
         assertEquals("Hello World", result);
+        assertTrue("Should take longer than: " + delta, delta > 250);
     }
 
     @Override
@@ -278,11 +278,11 @@
             @Override
             public void configure() throws Exception {
                 from("direct:start")
-                    .delay(250)
+                    .delay(400)
                     .transform(body().append(" World")).to("mock:result");
 
                 from("direct:error")
-                    .delay(250)
+                    .delay(400)
                     .process(new Processor() {
                         public void process(Exchange exchange) throws Exception {
                             throw new IllegalArgumentException("Damn forced by unit test");

Modified: camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRemoteFileSorterTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRemoteFileSorterTest.java?rev=792468&r1=792467&r2=792468&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRemoteFileSorterTest.java
(original)
+++ camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRemoteFileSorterTest.java
Thu Jul  9 09:15:47 2009
@@ -75,7 +75,7 @@
     public class MyRemoteFileSorter implements Comparator<RemoteFile> {
 
         public int compare(RemoteFile o1, RemoteFile o2) {
-            return o1.getFileName().compareTo(o2.getFileName());
+            return o1.getFileNameOnly().compareToIgnoreCase(o2.getFileNameOnly());
         }
     }
     // END SNIPPET: e1

Modified: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java?rev=792468&r1=792467&r2=792468&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
(original)
+++ camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
Thu Jul  9 09:15:47 2009
@@ -51,7 +51,6 @@
 import org.apache.camel.model.TransactedDefinition;
 import org.apache.camel.model.config.PropertiesDefinition;
 import org.apache.camel.model.dataformat.DataFormatsDefinition;
-import org.apache.camel.processor.interceptor.Debugger;
 import org.apache.camel.processor.interceptor.Delayer;
 import org.apache.camel.processor.interceptor.HandleFault;
 import org.apache.camel.processor.interceptor.TraceFormatter;
@@ -209,12 +208,6 @@
             getContext().setRegistry(registry);
         }
 
-        Debugger debugger = getBeanForType(Debugger.class);
-        if (debugger != null) {
-            LOG.info("Using custom Debugger: " + debugger);
-            getContext().addInterceptStrategy(debugger);
-        }
-
         Tracer tracer = getBeanForType(Tracer.class);
         if (tracer != null) {
             // use formatter if there is a TraceFormatter bean defined

Modified: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java?rev=792468&r1=792467&r2=792468&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java (original)
+++ camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java Thu
Jul  9 09:15:47 2009
@@ -115,18 +115,6 @@
         Runtime.getRuntime().addShutdownHook(interceptor);
     }
 
-    @Override
-    public void enableDebug() {
-        super.enableDebug();
-        setParentApplicationContextUri("/META-INF/services/org/apache/camel/spring/debug.xml");
-    }
-
-    @Override
-    public void enableTrace() {
-        super.enableTrace();
-        setParentApplicationContextUri("/META-INF/services/org/apache/camel/spring/trace.xml");
-    }
-
     // Properties
     // -------------------------------------------------------------------------
     public AbstractApplicationContext getApplicationContext() {
@@ -203,10 +191,10 @@
         if (names != null && names.length > 0) {
             return (ProducerTemplate) getApplicationContext().getBean(names[0], ProducerTemplate.class);
         }
-        for (CamelContext camelContext : getCamelContexts()) {
-            return camelContext.createProducerTemplate();
+        if (getCamelContexts().isEmpty()) {
+            throw new IllegalArgumentException("No CamelContexts are available so cannot
create a ProducerTemplate!");
         }
-        throw new IllegalArgumentException("No CamelContexts are available so cannot create
a ProducerTemplate!");
+        return getCamelContexts().get(0).createProducerTemplate();
     }
 
     protected AbstractApplicationContext createDefaultApplicationContext() {

Modified: camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java?rev=792468&r1=792467&r2=792468&view=diff
==============================================================================
--- camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
(original)
+++ camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
Thu Jul  9 09:15:47 2009
@@ -145,15 +145,6 @@
     private List pluginDependencies;
 
     /**
-     * Whether to enable the debugger or not
-     *
-     * @parameter expression="${camel.debug}"
-     *            default-value="false"
-     * @required
-     */
-    private boolean debug;
-
-    /**
      * Whether to enable the tracer or not
      *
      * @parameter expression="${camel.trace}"
@@ -356,9 +347,6 @@
             args.add("-o");
             args.add(dotDir);
         }
-        if (debug) {
-            args.add("-x");
-        }
         if (trace) {
             args.add("-t");
         }



Mime
View raw message