You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by js...@apache.org on 2007/05/01 12:00:49 UTC

svn commit: r533990 - in /activemq/camel/trunk: ./ camel-core/src/main/java/org/apache/camel/component/file/ camel-core/src/main/java/org/apache/camel/impl/ camel-jpa/src/main/java/org/apache/camel/component/jpa/ camel-mail/src/main/java/org/apache/cam...

Author: jstrachan
Date: Tue May  1 03:00:48 2007
New Revision: 533990

URL: http://svn.apache.org/viewvc?view=rev&rev=533990
Log:
cleaning up some of the code with respect to executor service to reduce clutter; also added more javadoc stuff for the file component

Added:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/package.html   (with props)
Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileComponent.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/PollingConsumer.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/PollingEndpoint.java
    activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
    activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java
    activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
    activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java
    activemq/camel/trunk/camel-mail/src/test/java/org/apache/camel/component/mail/MailComponentTest.java
    activemq/camel/trunk/pom.xml

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileComponent.java?view=diff&rev=533990&r1=533989&r2=533990
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileComponent.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileComponent.java Tue May  1 03:00:48 2007
@@ -25,6 +25,8 @@
 import java.util.Map;
 
 /**
+ * The <a href="http://activemq.apache.org/camel/file.html">File Component</a> for working with file systems
+ *
  * @version $Revision: 523772 $
  */
 public class FileComponent extends DefaultComponent<FileExchange> {

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java?view=diff&rev=533990&r1=533989&r2=533990
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java Tue May  1 03:00:48 2007
@@ -17,96 +17,101 @@
  */
 package org.apache.camel.component.file;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.nio.channels.FileChannel;
-import java.util.concurrent.ScheduledExecutorService;
 import org.apache.camel.Processor;
 import org.apache.camel.impl.PollingConsumer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import java.io.File;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.nio.channels.FileChannel;
+
 /**
  * @version $Revision: 523016 $
  */
-public class FileConsumer extends PollingConsumer<FileExchange>{
-    private static final transient Log log=LogFactory.getLog(FileConsumer.class);
-
+public class FileConsumer extends PollingConsumer<FileExchange> {
+    private static final transient Log log = LogFactory.getLog(FileConsumer.class);
     private final FileEndpoint endpoint;
-    private boolean recursive=true;
-    private boolean attemptFileLock=false;
-    private String regexPattern="";
-    private long lastPollTime=0l;
+    private boolean recursive = true;
+    private boolean attemptFileLock = false;
+    private String regexPattern = "";
+    private long lastPollTime = 0l;
 
-    public FileConsumer(final FileEndpoint endpoint,Processor<FileExchange> processor,ScheduledExecutorService executor){
-        super(endpoint,processor,executor);
-        this.endpoint=endpoint;
+    public FileConsumer(final FileEndpoint endpoint, Processor<FileExchange> processor) {
+        super(endpoint, processor);
+        this.endpoint = endpoint;
     }
 
-    protected void poll() throws Exception{
-        pollFileOrDirectory(endpoint.getFile(),isRecursive());
-        lastPollTime=System.currentTimeMillis();
+    protected void poll() throws Exception {
+        pollFileOrDirectory(endpoint.getFile(), isRecursive());
+        lastPollTime = System.currentTimeMillis();
     }
 
-    protected void pollFileOrDirectory(File fileOrDirectory,boolean processDir){
-        if(!fileOrDirectory.isDirectory()){
+    protected void pollFileOrDirectory(File fileOrDirectory, boolean processDir) {
+        if (!fileOrDirectory.isDirectory()) {
             pollFile(fileOrDirectory); // process the file
-        }else if(processDir){
-            log.debug("Polling directory "+fileOrDirectory);
-            File[] files=fileOrDirectory.listFiles();
-            for(int i=0;i<files.length;i++){
-                pollFileOrDirectory(files[i],isRecursive()); // self-recursion
+        }
+        else if (processDir) {
+            log.debug("Polling directory " + fileOrDirectory);
+            File[] files = fileOrDirectory.listFiles();
+            for (int i = 0; i < files.length; i++) {
+                pollFileOrDirectory(files[i], isRecursive()); // self-recursion
             }
-        }else{
-            log.debug("Skipping directory "+fileOrDirectory);
+        }
+        else {
+            log.debug("Skipping directory " + fileOrDirectory);
         }
     }
 
-    protected void pollFile(final File file){
-        if(file.exists()&&file.lastModified()>lastPollTime){
-            if(isValidFile(file)){
+    protected void pollFile(final File file) {
+        if (file.exists() && file.lastModified() > lastPollTime) {
+            if (isValidFile(file)) {
                 processFile(file);
             }
         }
     }
 
-    protected void processFile(File file){
+    protected void processFile(File file) {
         getProcessor().process(endpoint.createExchange(file));
     }
 
-    protected boolean isValidFile(File file){
-        boolean result=false;
-        if(file!=null&&file.exists()){
-            if(isMatched(file)){
-                if(isAttemptFileLock()){
-                    FileChannel fc=null;
-                    try{
-                        fc=new RandomAccessFile(file,"rw").getChannel();
+    protected boolean isValidFile(File file) {
+        boolean result = false;
+        if (file != null && file.exists()) {
+            if (isMatched(file)) {
+                if (isAttemptFileLock()) {
+                    FileChannel fc = null;
+                    try {
+                        fc = new RandomAccessFile(file, "rw").getChannel();
                         fc.lock();
-                        result=true;
-                    }catch(Throwable e){
-                        log.debug("Failed to get the lock on file: " + file,e);
-                    }finally{
-                        if(fc!=null){
-                            try{
+                        result = true;
+                    }
+                    catch (Throwable e) {
+                        log.debug("Failed to get the lock on file: " + file, e);
+                    }
+                    finally {
+                        if (fc != null) {
+                            try {
                                 fc.close();
-                            }catch(IOException e){
+                            }
+                            catch (IOException e) {
                             }
                         }
                     }
-                }else{
-                    result=true;
+                }
+                else {
+                    result = true;
                 }
             }
         }
         return result;
     }
 
-    protected boolean isMatched(File file){
-        boolean result=true;
-        if(regexPattern!=null&&regexPattern.length()>0){
-            result=file.getName().matches(getRegexPattern());
+    protected boolean isMatched(File file) {
+        boolean result = true;
+        if (regexPattern != null && regexPattern.length() > 0) {
+            result = file.getName().matches(getRegexPattern());
         }
         return result;
     }
@@ -114,42 +119,42 @@
     /**
      * @return the recursive
      */
-    public boolean isRecursive(){
+    public boolean isRecursive() {
         return this.recursive;
     }
 
     /**
      * @param recursive the recursive to set
      */
-    public void setRecursive(boolean recursive){
-        this.recursive=recursive;
+    public void setRecursive(boolean recursive) {
+        this.recursive = recursive;
     }
 
     /**
      * @return the attemptFileLock
      */
-    public boolean isAttemptFileLock(){
+    public boolean isAttemptFileLock() {
         return this.attemptFileLock;
     }
 
     /**
      * @param attemptFileLock the attemptFileLock to set
      */
-    public void setAttemptFileLock(boolean attemptFileLock){
-        this.attemptFileLock=attemptFileLock;
+    public void setAttemptFileLock(boolean attemptFileLock) {
+        this.attemptFileLock = attemptFileLock;
     }
 
     /**
      * @return the regexPattern
      */
-    public String getRegexPattern(){
+    public String getRegexPattern() {
         return this.regexPattern;
     }
 
     /**
      * @param regexPattern the regexPattern to set
      */
-    public void setRegexPattern(String regexPattern){
-        this.regexPattern=regexPattern;
+    public void setRegexPattern(String regexPattern) {
+        this.regexPattern = regexPattern;
     }
 }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java?view=diff&rev=533990&r1=533989&r2=533990
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java Tue May  1 03:00:48 2007
@@ -17,32 +17,26 @@
  */
 package org.apache.camel.component.file;
 
-import org.apache.camel.Component;
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.impl.PollingEndpoint;
-import org.apache.camel.util.IntrospectionSupport;
 
 import java.io.File;
-import java.util.Map;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
 
 /**
+ * A <a href="http://activemq.apache.org/camel/file.html">File Endpoint</a> for working with file systems
+ *
  * @version $Revision: 523016 $
  */
 public class FileEndpoint extends PollingEndpoint<FileExchange> {
     private File file;
-    private ScheduledExecutorService executor;
 
     protected FileEndpoint(File file, String endpointUri, FileComponent component) {
         super(endpointUri, component);
         this.file = file;
-        this.executor = component.getExecutorService();
     }
 
-
     /**
      * @return a Producer
      * @throws Exception
@@ -60,7 +54,7 @@
      * @see org.apache.camel.Endpoint#createConsumer(org.apache.camel.Processor)
      */
     public Consumer<FileExchange> createConsumer(Processor<FileExchange> file) throws Exception {
-        Consumer<FileExchange> result = new FileConsumer(this, file, getExecutor());
+        Consumer<FileExchange> result = new FileConsumer(this, file);
         configureConsumer(result);
         return startService(result);
     }
@@ -80,23 +74,6 @@
      */
     public FileExchange createExchange() {
         return createExchange(this.file);
-    }
-
-    /**
-     * @return the executor
-     */
-    public synchronized ScheduledExecutorService getExecutor() {
-        if (this.executor == null) {
-            this.executor = new ScheduledThreadPoolExecutor(10);
-        }
-        return executor;
-    }
-
-    /**
-     * @param executor the executor to set
-     */
-    public synchronized void setExecutor(ScheduledExecutorService executor) {
-        this.executor = executor;
     }
 
     public File getFile() {

Added: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/package.html
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/package.html?view=auto&rev=533990
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/package.html (added)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/package.html Tue May  1 03:00:48 2007
@@ -0,0 +1,25 @@
+<!--
+    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.
+-->
+<html>
+<head>
+</head>
+<body>
+
+The <a href="http://activemq.apache.org/camel/file.html">File Component</a> for working with file systems.
+
+</body>
+</html>

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java?view=diff&rev=533990&r1=533989&r2=533990
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java Tue May  1 03:00:48 2007
@@ -16,9 +16,6 @@
  */
 package org.apache.camel.impl;
 
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.atomic.AtomicBoolean;
-
 import org.apache.camel.CamelContext;
 import org.apache.camel.Component;
 import org.apache.camel.Endpoint;
@@ -27,15 +24,19 @@
 import org.apache.camel.Service;
 import org.apache.camel.util.ObjectHelper;
 
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+
 /**
  * A default endpoint useful for implementation inheritance
- * 
+ *
  * @version $Revision$
  */
 public abstract class DefaultEndpoint<E extends Exchange> implements Endpoint<E> {
     private String endpointUri;
     private final Component component;
     private CamelContext context;
+    private ScheduledExecutorService executorService;
 
     protected DefaultEndpoint(String endpointUri, Component component) {
         this.endpointUri = endpointUri;
@@ -73,13 +74,28 @@
         return component;
     }
 
-    public ScheduledExecutorService getExecutorService() {
-    	Component c = getComponent();
-    	if( c!=null && c instanceof DefaultComponent ) {
-    		DefaultComponent dc = (DefaultComponent) c;
-    		return dc.getExecutorService();
-    	}
-		return null;
+    /**
+     * @return the executor
+     */
+    public synchronized ScheduledExecutorService getExecutorService() {
+        if (executorService == null) {
+            Component c = getComponent();
+            if (c != null && c instanceof DefaultComponent) {
+                DefaultComponent dc = (DefaultComponent) c;
+                executorService = dc.getExecutorService();
+            }
+            if (executorService == null) {
+                executorService = createExecutorService();
+            }
+        }
+        return executorService;
+    }
+
+    /**
+     * @param executorService the executor to set
+     */
+    public synchronized void setExecutorService(ScheduledExecutorService executorService) {
+        this.executorService = executorService;
     }
 
     /**
@@ -105,5 +121,9 @@
     protected <T extends Service> T startService(T service) throws Exception {
         service.start();
         return service;
+    }
+
+    protected ScheduledThreadPoolExecutor createExecutorService() {
+        return new ScheduledThreadPoolExecutor(10);
     }
 }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/PollingConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/PollingConsumer.java?view=diff&rev=533990&r1=533989&r2=533990
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/PollingConsumer.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/PollingConsumer.java Tue May  1 03:00:48 2007
@@ -34,7 +34,7 @@
  */
 public abstract class PollingConsumer<E extends Exchange> extends DefaultConsumer<E> implements Runnable {
     private static final transient Log log = LogFactory.getLog(PollingConsumer.class);
-
+    
     private final ScheduledExecutorService executor;
     private long initialDelay = 1000;
     private long delay = 500;
@@ -42,12 +42,16 @@
     private boolean useFixedDelay;
     private ScheduledFuture<?> future;
 
+    public PollingConsumer(DefaultEndpoint<E> endpoint, Processor<E> processor) {
+        this(endpoint, processor, endpoint.getExecutorService());
+    }
+
     public PollingConsumer(Endpoint<E> endpoint, Processor<E> processor, ScheduledExecutorService executor) {
         super(endpoint, processor);
-        this.executor=executor;
-        
-        if( executor == null )
-        	throw new IllegalArgumentException("A non null ScheduledExecutorService must be provided.");
+        this.executor = executor;
+        if (executor == null) {
+            throw new IllegalArgumentException("A non null ScheduledExecutorService must be provided.");
+        }
     }
 
     /**
@@ -102,7 +106,7 @@
 
     /**
      * The polling method which is invoked periodically to poll this consumer
-     * 
+     *
      * @throws Exception
      */
     protected abstract void poll() throws Exception;

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/PollingEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/PollingEndpoint.java?view=diff&rev=533990&r1=533989&r2=533990
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/PollingEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/PollingEndpoint.java Tue May  1 03:00:48 2007
@@ -24,6 +24,8 @@
 import org.apache.camel.util.IntrospectionSupport;
 
 import java.util.Map;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
 
 /**
  * A base class for {@link Endpoint} which creates a {@link PollingConsumer}
@@ -57,4 +59,5 @@
             setConsumerProperties(consumerProperties);
         }
     }
+
 }

Modified: activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java?view=diff&rev=533990&r1=533989&r2=533990
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java (original)
+++ activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java Tue May  1 03:00:48 2007
@@ -47,8 +47,8 @@
     private String namedQuery;
     private String nativeQuery;
 
-    public JpaConsumer(JpaEndpoint endpoint, Processor<Exchange> processor, ScheduledExecutorService executor) {
-        super(endpoint, processor, executor);
+    public JpaConsumer(JpaEndpoint endpoint, Processor<Exchange> processor) {
+        super(endpoint, processor);
         this.endpoint = endpoint;
         this.template = endpoint.createTransactionStrategy();
     }

Modified: activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java?view=diff&rev=533990&r1=533989&r2=533990
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java (original)
+++ activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java Tue May  1 03:00:48 2007
@@ -61,7 +61,7 @@
     }
 
     public Consumer<Exchange> createConsumer(Processor<Exchange> processor) throws Exception {
-        JpaConsumer consumer = new JpaConsumer(this, processor, getExecutorService());
+        JpaConsumer consumer = new JpaConsumer(this, processor);
         configureConsumer(consumer);
         return startService(consumer);
     }

Modified: activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java?view=diff&rev=533990&r1=533989&r2=533990
==============================================================================
--- activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java (original)
+++ activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java Tue May  1 03:00:48 2007
@@ -44,7 +44,7 @@
     private final Folder folder;
 
     public MailConsumer(MailEndpoint endpoint, Processor<MailExchange> processor, Folder folder) {
-        super(endpoint, processor, endpoint.getExecutorService());
+        super(endpoint, processor);
         this.endpoint = endpoint;
         this.folder = folder;
     }

Modified: activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java?view=diff&rev=533990&r1=533989&r2=533990
==============================================================================
--- activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java (original)
+++ activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java Tue May  1 03:00:48 2007
@@ -21,6 +21,7 @@
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.impl.PollingEndpoint;
 import org.springframework.mail.javamail.JavaMailSender;
 
 import javax.mail.Message;
@@ -29,7 +30,7 @@
 /**
  * @version $Revision:520964 $
  */
-public class MailEndpoint extends DefaultEndpoint<MailExchange> {
+public class MailEndpoint extends PollingEndpoint<MailExchange> {
     private MailBinding binding;
     private MailConfiguration configuration;
 
@@ -73,7 +74,9 @@
      * @throws Exception if the consumer cannot be created
      */
     public Consumer<MailExchange> createConsumer(Processor<MailExchange> processor, Folder folder) throws Exception {
-        return startService(new MailConsumer(this, processor, folder));
+        MailConsumer answer = new MailConsumer(this, processor, folder);
+        configureConsumer(answer);
+        return startService(answer);
     }
 
     public MailExchange createExchange() {

Modified: activemq/camel/trunk/camel-mail/src/test/java/org/apache/camel/component/mail/MailComponentTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mail/src/test/java/org/apache/camel/component/mail/MailComponentTest.java?view=diff&rev=533990&r1=533989&r2=533990
==============================================================================
--- activemq/camel/trunk/camel-mail/src/test/java/org/apache/camel/component/mail/MailComponentTest.java (original)
+++ activemq/camel/trunk/camel-mail/src/test/java/org/apache/camel/component/mail/MailComponentTest.java Tue May  1 03:00:48 2007
@@ -44,9 +44,9 @@
     }
 
     public void testMailEndpointsAreConfiguredProperlyWhenUsingPop() throws Exception {
-        MailEndpoint endpoint = resolveMandatoryEndpoint("pop://james@myhost:30/subject");
+        MailEndpoint endpoint = resolveMandatoryEndpoint("pop3://james@myhost:30/subject");
         MailConfiguration config = endpoint.getConfiguration();
-        assertEquals("getProtocol()", "pop", config.getProtocol());
+        assertEquals("getProtocol()", "pop3", config.getProtocol());
         assertEquals("getHost()", "myhost", config.getHost());
         assertEquals("getPort()", 30, config.getPort());
         assertEquals("getUsername()", "james", config.getUsername());

Modified: activemq/camel/trunk/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/pom.xml?view=diff&rev=533990&r1=533989&r2=533990
==============================================================================
--- activemq/camel/trunk/pom.xml (original)
+++ activemq/camel/trunk/pom.xml Tue May  1 03:00:48 2007
@@ -127,6 +127,7 @@
     <module>camel-jms</module>
     <module>camel-josql</module>
     <module>camel-jpa</module>
+    <module>camel-mail</module>
     <module>camel-mina</module>
     <module>camel-saxon</module>
     <module>camel-script</module>