james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r681701 - in /james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester: SMTPTransport.java Tester.java
Date Fri, 01 Aug 2008 14:20:40 GMT
Author: bago
Date: Fri Aug  1 07:20:40 2008
New Revision: 681701

URL: http://svn.apache.org/viewvc?rev=681701&view=rev
Log:
Add synchronization to Tester (SMTPTransport is not singleton) (attempt to fix JAMES-850)

Modified:
    james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/SMTPTransport.java
    james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/Tester.java

Modified: james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/SMTPTransport.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/SMTPTransport.java?rev=681701&r1=681700&r2=681701&view=diff
==============================================================================
--- james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/SMTPTransport.java
(original)
+++ james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/SMTPTransport.java
Fri Aug  1 07:20:40 2008
@@ -44,10 +44,7 @@
     }
     
     protected SMTPTransport(Session session, URLName urlname, String s, int i, boolean flag)
{
-        super(session, urlname);
-        owner = (Tester) session.getProperties().get("Tester");
-        connected = false;
-        if (owner == null) throw new IllegalStateException("Can only be used by a Tester");
+        this(session, urlname);
     }
 
     public synchronized void connect() throws MessagingException {

Modified: james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/Tester.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/Tester.java?rev=681701&r1=681700&r2=681701&view=diff
==============================================================================
--- james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/Tester.java
(original)
+++ james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/Tester.java
Fri Aug  1 07:20:40 2008
@@ -278,7 +278,7 @@
         return ((List)hostAddresses.get(domainName)).iterator();
     }
     
-    public void onTransportConnect(SMTPTransport tester) throws MessagingException {
+    public synchronized void onTransportConnect(SMTPTransport tester) throws MessagingException
{
         String server = getServerName(tester.getURLName());
         log("TRANSPORT", "Connection to " + server);
         
@@ -301,7 +301,7 @@
         }
     }
 
-    public void onTransportSendMessage(SMTPTransport tester, Message message, Address[] recipients)
throws MessagingException, SendFailedException {
+    public synchronized void onTransportSendMessage(SMTPTransport tester, Message message,
Address[] recipients) throws MessagingException, SendFailedException {
         String server = getServerName(tester.getURLName());
         ProcMail.Listing listing = new ProcMail.Listing();
         Vector rules = new Vector();
@@ -390,7 +390,7 @@
         return res.toString();
     }
 
-    public void onTransportClose(SMTPTransport tester) throws MessagingException {
+    public synchronized void onTransportClose(SMTPTransport tester) throws MessagingException
{
         String server = getServerName(tester.getURLName());
         log("TRANSPORT", "Closing connection to " + server);
         
@@ -413,7 +413,7 @@
         }
     }
 
-    public boolean OnTransportSupportsExtension(SMTPTransport tester, String arg0) {
+    public synchronized boolean OnTransportSupportsExtension(SMTPTransport tester, String
arg0) {
         String server = getServerName(tester.getURLName());
         log("TRANSPORT", "Asking if " + server + " supports " + arg0);
         



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message