james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r691073 - in /james/jsieve/trunk/src: main/java/org/apache/jsieve/ConfigurationManager.java test/java/org/apache/jsieve/junit/utils/JUnitUtils.java test/java/org/apache/jsieve/util/check/ScriptChecker.java
Date Mon, 01 Sep 2008 21:59:16 GMT
Author: rdonkin
Date: Mon Sep  1 14:59:15 2008
New Revision: 691073

URL: http://svn.apache.org/viewvc?rev=691073&view=rev
Log:
Add build method to configuration manager

Modified:
    james/jsieve/trunk/src/main/java/org/apache/jsieve/ConfigurationManager.java
    james/jsieve/trunk/src/test/java/org/apache/jsieve/junit/utils/JUnitUtils.java
    james/jsieve/trunk/src/test/java/org/apache/jsieve/util/check/ScriptChecker.java

Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/ConfigurationManager.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/ConfigurationManager.java?rev=691073&r1=691072&r2=691073&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/ConfigurationManager.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/ConfigurationManager.java Mon Sep 
1 14:59:15 2008
@@ -233,4 +233,8 @@
     public Log getLog() {
         return log;
     }
+    
+    public SieveFactory build() {
+        return new SieveFactory(getCommandManager(), getComparatorManager(), getTestManager(),
getLog());
+    }
 }

Modified: james/jsieve/trunk/src/test/java/org/apache/jsieve/junit/utils/JUnitUtils.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/test/java/org/apache/jsieve/junit/utils/JUnitUtils.java?rev=691073&r1=691072&r2=691073&view=diff
==============================================================================
--- james/jsieve/trunk/src/test/java/org/apache/jsieve/junit/utils/JUnitUtils.java (original)
+++ james/jsieve/trunk/src/test/java/org/apache/jsieve/junit/utils/JUnitUtils.java Mon Sep
 1 14:59:15 2008
@@ -27,7 +27,6 @@
 import javax.mail.internet.MimeMessage;
 
 import org.apache.jsieve.ConfigurationManager;
-import org.apache.jsieve.SieveFactory;
 import org.apache.jsieve.exception.SieveException;
 import org.apache.jsieve.mail.MailAdapter;
 import org.apache.jsieve.parser.generated.ParseException;
@@ -47,9 +46,7 @@
     static public void interpret(MailAdapter mail, String script)
         throws SieveException, ParseException
     {
-        ConfigurationManager configuration = new ConfigurationManager();
-        new SieveFactory(configuration.getCommandManager(), configuration.getComparatorManager(),
-                configuration.getTestManager(), configuration.getLog()).interpret(
+        new ConfigurationManager().build().interpret(
             mail,
             new ByteArrayInputStream(script.getBytes()));
     }
@@ -64,9 +61,7 @@
     static public void parse(String script)
         throws SieveException, ParseException
     {
-        ConfigurationManager configuration = new ConfigurationManager();
-        new SieveFactory(configuration.getCommandManager(), configuration.getComparatorManager(),
-                configuration.getTestManager(), configuration.getLog()).parse(
+        new ConfigurationManager().build().parse(
             new ByteArrayInputStream(script.getBytes()));
     }
     

Modified: james/jsieve/trunk/src/test/java/org/apache/jsieve/util/check/ScriptChecker.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/test/java/org/apache/jsieve/util/check/ScriptChecker.java?rev=691073&r1=691072&r2=691073&view=diff
==============================================================================
--- james/jsieve/trunk/src/test/java/org/apache/jsieve/util/check/ScriptChecker.java (original)
+++ james/jsieve/trunk/src/test/java/org/apache/jsieve/util/check/ScriptChecker.java Mon Sep
 1 14:59:15 2008
@@ -86,9 +86,7 @@
         adapter.setMail(mimeMessage);
         Results results;
         try {
-            ConfigurationManager configuration = new ConfigurationManager();
-            new SieveFactory(configuration.getCommandManager(), configuration.getComparatorManager(),
-                    configuration.getTestManager(), configuration.getLog()).interpret(adapter,
script);
+            new ConfigurationManager().build().interpret(adapter, script);
             final List executedActions = adapter.getExecutedActions();
             results = new Results(executedActions);
         } catch (ParseException e) {



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