james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject svn commit: r1686806 - in /james/mpt/trunk: core/src/main/java/org/apache/james/mpt/api/ core/src/main/java/org/apache/james/mpt/host/ core/src/main/java/org/apache/james/mpt/script/ core/src/main/java/org/apache/james/mpt/session/ impl/imap-mailbox/co...
Date Mon, 22 Jun 2015 08:18:13 GMT
Author: btellier
Date: Mon Jun 22 08:18:12 2015
New Revision: 1686806

URL: http://svn.apache.org/r1686806
Log:
MPT-16 Replace reset method by beforeTest & afterTest methods - contributed by Antoine
Duprat

Modified:
    james/mpt/trunk/core/src/main/java/org/apache/james/mpt/api/HostSystem.java
    james/mpt/trunk/core/src/main/java/org/apache/james/mpt/host/ExternalHostSystem.java
    james/mpt/trunk/core/src/main/java/org/apache/james/mpt/script/AbstractProtocolTestFramework.java
    james/mpt/trunk/core/src/main/java/org/apache/james/mpt/session/ExternalSessionFactory.java
    james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/host/ImapHostSystem.java

Modified: james/mpt/trunk/core/src/main/java/org/apache/james/mpt/api/HostSystem.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/core/src/main/java/org/apache/james/mpt/api/HostSystem.java?rev=1686806&r1=1686805&r2=1686806&view=diff
==============================================================================
--- james/mpt/trunk/core/src/main/java/org/apache/james/mpt/api/HostSystem.java (original)
+++ james/mpt/trunk/core/src/main/java/org/apache/james/mpt/api/HostSystem.java Mon Jun 22
08:18:12 2015
@@ -36,13 +36,6 @@ import org.apache.james.mpt.host.Externa
 public interface HostSystem extends SessionFactory {
 
     /**
-     * Resets host system to initial state.
-     * 
-     * @throws Exception
-     */
-    public void reset() throws Exception;
-
-    /**
      * Add a user for testing.
      * 
      * @param user
@@ -65,4 +58,8 @@ public interface HostSystem extends Sess
 
     public void afterTests() throws Exception;
 
+    public void beforeTest() throws Exception;
+
+    public void afterTest() throws Exception;
+
 }

Modified: james/mpt/trunk/core/src/main/java/org/apache/james/mpt/host/ExternalHostSystem.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/core/src/main/java/org/apache/james/mpt/host/ExternalHostSystem.java?rev=1686806&r1=1686805&r2=1686806&view=diff
==============================================================================
--- james/mpt/trunk/core/src/main/java/org/apache/james/mpt/host/ExternalHostSystem.java (original)
+++ james/mpt/trunk/core/src/main/java/org/apache/james/mpt/host/ExternalHostSystem.java Mon
Jun 22 08:18:12 2015
@@ -75,10 +75,14 @@ public class ExternalHostSystem extends
     }
 
     public void beforeTests() throws Exception {
-
     }
 
     public void afterTests() throws Exception {
+    }
 
+    public void beforeTest() throws Exception {
+    }
+    
+    public void afterTest() throws Exception {
     }
 }

Modified: james/mpt/trunk/core/src/main/java/org/apache/james/mpt/script/AbstractProtocolTestFramework.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/core/src/main/java/org/apache/james/mpt/script/AbstractProtocolTestFramework.java?rev=1686806&r1=1686805&r2=1686806&view=diff
==============================================================================
--- james/mpt/trunk/core/src/main/java/org/apache/james/mpt/script/AbstractProtocolTestFramework.java
(original)
+++ james/mpt/trunk/core/src/main/java/org/apache/james/mpt/script/AbstractProtocolTestFramework.java
Mon Jun 22 08:18:12 2015
@@ -60,10 +60,12 @@ public abstract class AbstractProtocolTe
     }
 
     protected void setUp() throws Exception {
-        setUpEnvironment();
+        hostSystem.beforeTest();
+        hostSystem.addUser(userName, password);
     }
 
     protected void tearDown() throws Exception {
+        hostSystem.afterTest();
     }
 
     /**
@@ -110,12 +112,4 @@ public abstract class AbstractProtocolTe
         }
     }
 
-    /**
-     * Initialises the host on first call.
-     */
-    public void setUpEnvironment() throws Exception {
-        hostSystem.reset();
-        hostSystem.addUser(userName, password);
-    }
-
 }

Modified: james/mpt/trunk/core/src/main/java/org/apache/james/mpt/session/ExternalSessionFactory.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/core/src/main/java/org/apache/james/mpt/session/ExternalSessionFactory.java?rev=1686806&r1=1686805&r2=1686806&view=diff
==============================================================================
--- james/mpt/trunk/core/src/main/java/org/apache/james/mpt/session/ExternalSessionFactory.java
(original)
+++ james/mpt/trunk/core/src/main/java/org/apache/james/mpt/session/ExternalSessionFactory.java
Mon Jun 22 08:18:12 2015
@@ -52,10 +52,6 @@ public class ExternalSessionFactory impl
         return result;
     }
 
-    public void reset() throws Exception {
-        monitor.note("Please reset system.");
-    }
-
     /**
      * Constructs a <code>String</code> with all attributes
      * in name = value format.

Modified: james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/host/ImapHostSystem.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/host/ImapHostSystem.java?rev=1686806&r1=1686805&r2=1686806&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/host/ImapHostSystem.java
(original)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/host/ImapHostSystem.java
Mon Jun 22 08:18:12 2015
@@ -67,9 +67,11 @@ public abstract class ImapHostSystem imp
         return new Session(continuation);
     }
 
-    public final void reset() throws Exception {
+    public void beforeTest() throws Exception {
+    }
+    
+    public void afterTest() throws Exception {
         users.clear();
-        
         resetData();
     }
     



---------------------------------------------------------------------
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