JAMES-2513 Turn DomainList autoDetect autoDetection off in tests

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

Branch: refs/heads/master
Commit: 5f45d496735102e1b36d9efaa7b2e4db18a33471
Parents: 3c275fe
Author: benwa <[email protected]>
Authored: Thu Aug 2 09:29:25 2018 +0700
Committer: Benoit Tellier <[email protected]>
Committed: Fri Aug 3 15:51:29 2018 +0700

----------------------------------------------------------------------
 .../apache/james/CassandraJamesServerTest.java  |  2 +-
 .../org/apache/james/CassandraWithTikaTest.java |  2 +-
 .../src/test/resources/domainlist.xml           | 24 ++++++++++++++++++++
 .../james/CassandraLdapJamesServerTest.java     |  2 +-
 .../src/test/resources/domainlist.xml           | 24 ++++++++++++++++++++
 .../jpa-guice/src/test/resources/domainlist.xml | 24 ++++++++++++++++++++
 .../src/test/resources/domainlist.xml           | 24 ++++++++++++++++++++
 .../jpa-smtp/src/test/resources/domainlist.xml  | 24 ++++++++++++++++++++
 .../org/apache/james/MemoryJamesServerTest.java |  6 +++--
 .../src/test/resources/domainlist.xml           | 24 ++++++++++++++++++++
 .../james/AbstractJmapJamesServerTest.java      |  9 ++++++++
 .../src/test/resources/domainlist.xml           | 24 ++++++++++++++++++++
 12 files changed, 184 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/5f45d496/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
----------------------------------------------------------------------
diff --git 
a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
 
b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
index 50b5cbe..0a13642 100644
--- 
a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
+++ 
b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
@@ -34,7 +34,7 @@ public class CassandraJamesServerTest extends 
AbstractJmapJamesServerTest {
 
     @Override
     protected GuiceJamesServer createJamesServer() throws IOException {
-        return cassandraJmap.jmapServer(cassandra.getModule());
+        return cassandraJmap.jmapServer(cassandra.getModule(), 
DOMAIN_LIST_CONFIGURATION_MODULE);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/james-project/blob/5f45d496/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraWithTikaTest.java
----------------------------------------------------------------------
diff --git 
a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraWithTikaTest.java
 
b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraWithTikaTest.java
index eef9a48..408fef0 100644
--- 
a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraWithTikaTest.java
+++ 
b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraWithTikaTest.java
@@ -36,7 +36,7 @@ public class CassandraWithTikaTest extends 
AbstractJmapJamesServerTest {
 
     @Override
     protected GuiceJamesServer createJamesServer() throws IOException {
-        return cassandraJmap.jmapServer(guiceTikaRule.getModule(), 
cassandra.getModule());
+        return cassandraJmap.jmapServer(guiceTikaRule.getModule(), 
cassandra.getModule(), DOMAIN_LIST_CONFIGURATION_MODULE);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/james-project/blob/5f45d496/server/container/guice/cassandra-guice/src/test/resources/domainlist.xml
----------------------------------------------------------------------
diff --git 
a/server/container/guice/cassandra-guice/src/test/resources/domainlist.xml 
b/server/container/guice/cassandra-guice/src/test/resources/domainlist.xml
new file mode 100644
index 0000000..fe17431
--- /dev/null
+++ b/server/container/guice/cassandra-guice/src/test/resources/domainlist.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+  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.                                           
+ -->
+
+<domainlist>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
+</domainlist>

http://git-wip-us.apache.org/repos/asf/james-project/blob/5f45d496/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
----------------------------------------------------------------------
diff --git 
a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
 
b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
index 5954d0d..5aa6c35 100644
--- 
a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
+++ 
b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
@@ -68,7 +68,7 @@ public class CassandraLdapJamesServerTest extends 
AbstractJmapJamesServerTest {
     @Override
     protected GuiceJamesServer createJamesServer() throws IOException {
         ldapContainer.start();
-        return cassandraLdapJmap.jmapServer(ldapContainer.getLdapHost());
+        return cassandraLdapJmap.jmapServer(ldapContainer.getLdapHost(), 
DOMAIN_LIST_CONFIGURATION_MODULE);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/james-project/blob/5f45d496/server/container/guice/cassandra-ldap-guice/src/test/resources/domainlist.xml
----------------------------------------------------------------------
diff --git 
a/server/container/guice/cassandra-ldap-guice/src/test/resources/domainlist.xml 
b/server/container/guice/cassandra-ldap-guice/src/test/resources/domainlist.xml
new file mode 100644
index 0000000..fe17431
--- /dev/null
+++ 
b/server/container/guice/cassandra-ldap-guice/src/test/resources/domainlist.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+  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.                                           
+ -->
+
+<domainlist>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
+</domainlist>

http://git-wip-us.apache.org/repos/asf/james-project/blob/5f45d496/server/container/guice/jpa-guice/src/test/resources/domainlist.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/test/resources/domainlist.xml 
b/server/container/guice/jpa-guice/src/test/resources/domainlist.xml
new file mode 100644
index 0000000..fe17431
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/test/resources/domainlist.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+  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.                                           
+ -->
+
+<domainlist>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
+</domainlist>

http://git-wip-us.apache.org/repos/asf/james-project/blob/5f45d496/server/container/guice/jpa-smtp-mariadb/src/test/resources/domainlist.xml
----------------------------------------------------------------------
diff --git 
a/server/container/guice/jpa-smtp-mariadb/src/test/resources/domainlist.xml 
b/server/container/guice/jpa-smtp-mariadb/src/test/resources/domainlist.xml
new file mode 100644
index 0000000..fe17431
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/src/test/resources/domainlist.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+  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.                                           
+ -->
+
+<domainlist>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
+</domainlist>

http://git-wip-us.apache.org/repos/asf/james-project/blob/5f45d496/server/container/guice/jpa-smtp/src/test/resources/domainlist.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp/src/test/resources/domainlist.xml 
b/server/container/guice/jpa-smtp/src/test/resources/domainlist.xml
new file mode 100644
index 0000000..fe17431
--- /dev/null
+++ b/server/container/guice/jpa-smtp/src/test/resources/domainlist.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+  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.                                           
+ -->
+
+<domainlist>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
+</domainlist>

http://git-wip-us.apache.org/repos/asf/james-project/blob/5f45d496/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
----------------------------------------------------------------------
diff --git 
a/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
 
b/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
index e4f2410..90e27bd 100644
--- 
a/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
+++ 
b/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
@@ -21,16 +21,18 @@ package org.apache.james;
 
 import java.io.IOException;
 
+import org.apache.james.domainlist.lib.DomainListConfiguration;
 import org.junit.Rule;
 
-public class MemoryJamesServerTest extends AbstractJmapJamesServerTest {
+import com.google.inject.Module;
 
+public class MemoryJamesServerTest extends AbstractJmapJamesServerTest {
     @Rule
     public MemoryJmapTestRule memoryJmap = new MemoryJmapTestRule();
 
     @Override
     protected GuiceJamesServer createJamesServer() throws IOException {
-        return memoryJmap.jmapServer();
+        return memoryJmap.jmapServer(DOMAIN_LIST_CONFIGURATION_MODULE);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/james-project/blob/5f45d496/server/container/guice/memory-guice/src/test/resources/domainlist.xml
----------------------------------------------------------------------
diff --git 
a/server/container/guice/memory-guice/src/test/resources/domainlist.xml 
b/server/container/guice/memory-guice/src/test/resources/domainlist.xml
new file mode 100644
index 0000000..fe17431
--- /dev/null
+++ b/server/container/guice/memory-guice/src/test/resources/domainlist.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+  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.                                           
+ -->
+
+<domainlist>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
+</domainlist>

http://git-wip-us.apache.org/repos/asf/james-project/blob/5f45d496/server/container/guice/protocols/jmap/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
----------------------------------------------------------------------
diff --git 
a/server/container/guice/protocols/jmap/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
 
b/server/container/guice/protocols/jmap/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
index 3e10b05..1abae59 100644
--- 
a/server/container/guice/protocols/jmap/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
+++ 
b/server/container/guice/protocols/jmap/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
@@ -31,18 +31,27 @@ import java.nio.channels.SocketChannel;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 
+import org.apache.james.domainlist.lib.DomainListConfiguration;
 import org.apache.james.utils.DataProbeImpl;
 import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
+import com.google.inject.Module;
+
 import io.restassured.RestAssured;
 import io.restassured.builder.RequestSpecBuilder;
 import io.restassured.http.ContentType;
 
 public abstract class AbstractJmapJamesServerTest {
 
+    public static final Module DOMAIN_LIST_CONFIGURATION_MODULE = binder -> 
binder.bind(DomainListConfiguration.class)
+        .toInstance(DomainListConfiguration.builder()
+            .autoDetect(true)
+            .autoDetectIp(false)
+            .build());
+
     private static final int IMAP_PORT_SSL = 1993;
     private static final int POP3_PORT = 1110;
     private static final int SMTP_PORT = 1025;

http://git-wip-us.apache.org/repos/asf/james-project/blob/5f45d496/server/protocols/webadmin-integration-test/src/test/resources/domainlist.xml
----------------------------------------------------------------------
diff --git 
a/server/protocols/webadmin-integration-test/src/test/resources/domainlist.xml 
b/server/protocols/webadmin-integration-test/src/test/resources/domainlist.xml
new file mode 100644
index 0000000..fe17431
--- /dev/null
+++ 
b/server/protocols/webadmin-integration-test/src/test/resources/domainlist.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+  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.                                           
+ -->
+
+<domainlist>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
+</domainlist>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to