james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [18/18] james-project git commit: MAILBOX-266 Find a temporary solution for Guice chaotic initialization
Date Wed, 06 Apr 2016 09:22:02 GMT
MAILBOX-266 Find a temporary solution for Guice chaotic initialization


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/1d43ec8e
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/1d43ec8e
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/1d43ec8e

Branch: refs/heads/master
Commit: 1d43ec8eb064a67d9f2b3638cdffdebcf7b6136c
Parents: 6628e4f
Author: Benoit Tellier <btellier@linagora.com>
Authored: Tue Apr 5 10:23:32 2016 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Wed Apr 6 16:18:46 2016 +0700

----------------------------------------------------------------------
 .../main/java/org/apache/james/mpt/smtp/ForwardSmtpTest.java | 2 --
 .../org/apache/james/domainlist/lib/AbstractDomainList.java  | 8 ++++++--
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/1d43ec8e/mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/ForwardSmtpTest.java
----------------------------------------------------------------------
diff --git a/mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/ForwardSmtpTest.java
b/mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/ForwardSmtpTest.java
index fbfc138..27859a2 100644
--- a/mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/ForwardSmtpTest.java
+++ b/mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/ForwardSmtpTest.java
@@ -30,7 +30,6 @@ import javax.inject.Inject;
 
 import org.apache.james.mpt.script.AbstractSimpleScriptedTestProtocol;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.RuleChain;
@@ -76,7 +75,6 @@ public class ForwardSmtpTest extends AbstractSimpleScriptedTestProtocol
{
         RestAssured.config = newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8));
     }
 
-    @Ignore("Due to chaotic initialisation of Guice project, DomainList is not initialized
when RemoteDelivery is initialized. Hence a NullPointer exception is thrown on default domain
location")
     @Test
     public void forwardingAnEmailShouldWork() throws Exception {
         scriptTest("helo", Locale.US);

http://git-wip-us.apache.org/repos/asf/james-project/blob/1d43ec8e/server/data/data-library/src/main/java/org/apache/james/domainlist/lib/AbstractDomainList.java
----------------------------------------------------------------------
diff --git a/server/data/data-library/src/main/java/org/apache/james/domainlist/lib/AbstractDomainList.java
b/server/data/data-library/src/main/java/org/apache/james/domainlist/lib/AbstractDomainList.java
index 9852a11..c191cce 100644
--- a/server/data/data-library/src/main/java/org/apache/james/domainlist/lib/AbstractDomainList.java
+++ b/server/data/data-library/src/main/java/org/apache/james/domainlist/lib/AbstractDomainList.java
@@ -69,8 +69,12 @@ public abstract class AbstractDomainList implements DomainList, LogEnabled,
Conf
     }
 
     @Override
-    public String getDefaultDomain() {
-        return defaultDomain;
+    public String getDefaultDomain() throws DomainListException {
+        if (defaultDomain!= null) {
+            return defaultDomain;
+        } else {
+            throw new DomainListException("Null default domain. Domain list might not be
configured yet.");
+        }
     }
 
     @Override


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