You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2020/12/31 01:24:48 UTC

[GitHub] [james-project] chibenwa commented on a change in pull request #283: JAMES-2543 Uses JamesServerBuilder in MPT tests

chibenwa commented on a change in pull request #283:
URL: https://github.com/apache/james-project/pull/283#discussion_r550371029



##########
File path: mpt/impl/smtp/cassandra-rabbitmq-object-storage/src/test/resources/imapserver.xml
##########
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>

Review comment:
       My bet is that we don't need IMAP, LMTP, POP3, etc... while testing SMTP. Maybe we can omit unneeded files?

##########
File path: mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/InMemoryDnsExtension.java
##########
@@ -0,0 +1,60 @@
+/****************************************************************
+ * 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.                                           *
+ ****************************************************************/
+
+package org.apache.james.mpt.smtp;
+
+import java.util.Optional;
+
+import org.apache.james.GuiceModuleTestExtension;
+import org.apache.james.dnsservice.api.DNSService;
+import org.apache.james.dnsservice.api.InMemoryDNSService;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.ParameterContext;
+import org.junit.jupiter.api.extension.ParameterResolutionException;
+
+import com.google.inject.Module;
+
+public class InMemoryDnsExtension implements GuiceModuleTestExtension {
+    private InMemoryDNSService inMemoryDns;
+
+    @Override
+    public Module getModule() {
+        return binder -> binder.bind(DNSService.class).toInstance(inMemoryDns);
+    }
+
+    @Override
+    public void afterEach(ExtensionContext extensionContext) throws Exception {
+        inMemoryDns = null;

Review comment:
       Is this needed?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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