This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 4361d3cd2a3fd88a7448528e882611fb7a6f46be Author: Tran Tien Duc <[email protected]> AuthorDate: Mon Dec 16 10:36:54 2019 +0700 [Refactoring] Move LMTPProtocolHandlerChain to test and use RecordingMetric --- protocols/lmtp/pom.xml | 5 +++++ .../james/protocols/lmtp/LMTPProtocolHandlerChain.java | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/protocols/lmtp/pom.xml b/protocols/lmtp/pom.xml index 3f4881b..da1abfb 100644 --- a/protocols/lmtp/pom.xml +++ b/protocols/lmtp/pom.xml @@ -34,6 +34,11 @@ <dependencies> <dependency> + <groupId>${james.groupId}</groupId> + <artifactId>metrics-tests</artifactId> + <scope>test</scope> + </dependency> + <dependency> <groupId>${james.protocols.groupId}</groupId> <artifactId>protocols-api</artifactId> </dependency> diff --git a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java b/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java similarity index 86% rename from protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java rename to protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java index 86332d2..2f0b02c 100644 --- a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java +++ b/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java @@ -21,7 +21,7 @@ package org.apache.james.protocols.lmtp; import java.util.ArrayList; import java.util.List; -import org.apache.james.metrics.api.NoopMetricFactory; +import org.apache.james.metrics.tests.RecordingMetricFactory; import org.apache.james.protocols.api.handler.CommandDispatcher; import org.apache.james.protocols.api.handler.CommandHandlerResultLogger; import org.apache.james.protocols.api.handler.ProtocolHandler; @@ -50,7 +50,7 @@ import org.apache.james.protocols.smtp.core.esmtp.StartTlsCmdHandler; public class LMTPProtocolHandlerChain extends SMTPProtocolHandlerChain { public LMTPProtocolHandlerChain() { - super(new NoopMetricFactory()); + super(new RecordingMetricFactory()); } @Override @@ -58,21 +58,21 @@ public class LMTPProtocolHandlerChain extends SMTPProtocolHandlerChain { List<ProtocolHandler> defaultHandlers = new ArrayList<>(); defaultHandlers.add(new CommandDispatcher<SMTPSession>()); defaultHandlers.add(new ExpnCmdHandler()); - defaultHandlers.add(new LhloCmdHandler(new NoopMetricFactory())); + defaultHandlers.add(new LhloCmdHandler(new RecordingMetricFactory())); defaultHandlers.add(new HelpCmdHandler()); - defaultHandlers.add(new MailCmdHandler(new NoopMetricFactory())); + defaultHandlers.add(new MailCmdHandler(new RecordingMetricFactory())); defaultHandlers.add(new NoopCmdHandler()); - defaultHandlers.add(new QuitCmdHandler(new NoopMetricFactory())); - defaultHandlers.add(new RcptCmdHandler(new NoopMetricFactory())); + defaultHandlers.add(new QuitCmdHandler(new RecordingMetricFactory())); + defaultHandlers.add(new RcptCmdHandler(new RecordingMetricFactory())); defaultHandlers.add(new RsetCmdHandler()); defaultHandlers.add(new VrfyCmdHandler()); - defaultHandlers.add(new DataCmdHandler(new NoopMetricFactory())); + defaultHandlers.add(new DataCmdHandler(new RecordingMetricFactory())); defaultHandlers.add(new MailSizeEsmtpExtension()); defaultHandlers.add(new WelcomeMessageHandler()); defaultHandlers.add(new ReceivedDataLineFilter()); defaultHandlers.add(new DataLineMessageHookHandler()); defaultHandlers.add(new StartTlsCmdHandler()); - defaultHandlers.add(new UnknownCmdHandler(new NoopMetricFactory())); + defaultHandlers.add(new UnknownCmdHandler(new RecordingMetricFactory())); defaultHandlers.add(new CommandHandlerResultLogger()); return defaultHandlers; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
