[jira] [Closed] (JAMES-2855) James dependencies upgrade 08/2019

2019-08-27 Thread Tellier Benoit (Jira)


 [ 
https://issues.apache.org/jira/browse/JAMES-2855?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tellier Benoit closed JAMES-2855.
-
Fix Version/s: 3.4.0
   Resolution: Fixed

> James dependencies upgrade 08/2019
> --
>
> Key: JAMES-2855
> URL: https://issues.apache.org/jira/browse/JAMES-2855
> Project: James Server
>  Issue Type: Improvement
>Reporter: Trần Tiến Đức
>Priority: Major
> Fix For: 3.4.0
>
>
> List of the dependencies
> {code:java}
> From: mvn versions:display-dependency-updates | grep -- '->' | sort | uniq -c
>       1 [INFO]        
> net.javacrumbs.future-converter:future-converter-java8-guava    0.3.0 -> 1.2.0
>     223 [INFO]      
> org.apache.karaf.tooling.exam:org.apache.karaf.tooling.exam.container 
> ...2.3.0 -> 3.0.0.RC1
>     223 [INFO]       org.apache.maven.plugin-tools:maven-plugin-annotations 
> ... 3.4 -> 3.6.0
>     223 [INFO]   ch.qos.logback:logback-classic . 1.2.3 -> 
> 1.3.0-alpha4
>     223 [INFO]   ch.qos.logback:logback-core  1.2.3 -> 
> 1.3.0-alpha4
>       1 [INFO]   com.amazonaws:aws-java-sdk-s3 ... 1.11.532 
> -> 1.11.602
>       1 [INFO]   com.datastax.cassandra:cassandra-driver-core .. 
> 3.7.0 -> 4.0.0
>     223 [INFO]   com.fasterxml.jackson.core:jackson-annotations ... 2.9.6 -> 
> 2.10.0.pr1
>     223 [INFO]   com.fasterxml.jackson.core:jackson-core .. 2.9.6 -> 
> 2.10.0.pr1
>     223 [INFO]   com.fasterxml.jackson.core:jackson-databind .. 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.core:jackson-annotations  2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.core:jackson-core ... 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.core:jackson-databind ... 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.dataformat:jackson-dataformat-cbor ... 2.9.6 
> -> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.dataformat:jackson-dataformat-smile ... 2.9.6 
> -> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.dataformat:jackson-dataformat-xml ... 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.dataformat:jackson-dataformat-yaml ... 2.9.6 
> -> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.datatype:jackson-datatype-guava ... 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.datatype:jackson-datatype-jdk8 ... 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.datatype:jackson-datatype-joda ... 2.9.6 
> ->2.10.0.pr1
> [INFO]   com.fasterxml.jackson.datatype:jackson-datatype-jsr310 ... 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider ... 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.module:jackson-module-afterburner ... 2.9.6 -> 
> 2.10.0.pr1
>     223 [INFO]   org.codehaus.jackson:jackson-core-asl  1.9.2 
> -> 1.9.11
>     223 [INFO]   org.codehaus.jackson:jackson-jaxrs ... 1.9.2 
> -> 1.9.11
>     223 [INFO]   org.codehaus.jackson:jackson-mapper-asl .. 1.9.2 
> -> 1.9.11
>     223 [INFO]   org.codehaus.jackson:jackson-xc .. 1.9.2 
> -> 1.9.11
>     223 [INFO]   com.github.kongchen:swagger-maven-plugin .. 
> 3.1.7 -> 3.1.8
>     223 [INFO]   com.github.spullara.mustache.java:compiler  
> 0.9.5 -> 0.9.6
>       1 [INFO]   com.github.stefanbirkner:system-rules ... 1.18.0 
> -> 1.19.0
>       1 [INFO]   com.google.crypto.tink:tink ... 1.2.0 -> 
> 1.3.0-rc1
>       1 [INFO]   com.google.guava:guava .. 13.0 
> -> 28.0-jre
>       1 [INFO]   com.google.guava:guava .. 20.0 
> -> 28.0-jre
>     223 [INFO]   com.google.guava:guava .. 25.1-jre 
> -> 28.0-jre
>      25 [INFO]   com.google.inject.extensions:guice-assistedinject ... 
> 4.0 -> 4.2.2
>     198 [INFO]   com.google.inject.extensions:guice-assistedinject . 
> 4.2.0 -> 4.2.2
>     223 [INFO]   com.google.inject.extensions:guice-multibindings  
> 4.0 -> 4.2.2
>      25 [INFO]   com.google.inject:guice . 
> 4.0 -> 4.2.2
>     198 [INFO]   com.google.inject:guice ... 
> 4.2.0 -> 4.2.2
>     223 [INFO]   com.ibm.icu:icu4j ... 
> 62.1 -> 64.2
>     223 [INFO]   com.jayway.awaitility:awaitility .. 
> 1.6.5 -> 1.7.0
>     223 [INFO]   org.awaitility:awaitility . 3.1.2 -> 
> 4.0.0-rc1
> [INFO]   org.apache.pdfbox:pdfbox  2.0.12 -> 
> 2.0.15
>     223 [INFO]   commons-configuration:commons-configuration .. 
> 1.9 -> 1.10
>     223 [INFO]   commons-daemon:commons-daemon . 
> 1.1.0 -> 1.2.0
>     223 [INFO]   commons-logging:commons-logging 

[jira] [Closed] (JAMES-2866) MockSMTP server behaviors setup over HTTP

2019-08-27 Thread Tellier Benoit (Jira)


 [ 
https://issues.apache.org/jira/browse/JAMES-2866?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tellier Benoit closed JAMES-2866.
-
Fix Version/s: 3.4.0
   Resolution: Fixed

https://github.com/linagora/james-project/pull/2625

> MockSMTP server behaviors setup over HTTP
> -
>
> Key: JAMES-2866
> URL: https://issues.apache.org/jira/browse/JAMES-2866
> Project: James Server
>  Issue Type: Sub-task
>  Components: Remote Delivery, tests
>Reporter: Tellier Benoit
>Assignee: Tellier Benoit
>Priority: Major
> Fix For: 3.4.0
>
>
> You can setup your route by using spark-java library or any other light HTTP 
> server library written in Java as you think it's better.
> JSON serialization for JAMES-2853 POJOs is needed as well. No data stability 
> required (not an external API, it's for testing purposes).
> {code:java}
> PUT /smtpBehaviors
>  - 204: ok, created
> GET /smtpBehaviors
>  - 200 OK, JSON: 
> [
>   {
>   "command": "RCPT",
> "condition": {
>   "operator": "contains",
>   "matchingValue": "pippin got the ring"
> },
>   "response": {
> "code": 504,
> "rejected": false,
> "message": "server is out of memory"
> },
>   "numberOfAnswer": 7
>   },
>   ...
> ]
> DELETE /smtpBehaviors
>   - 204: ok, cleared the mock setups
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Commented] (JAMES-2855) James dependencies upgrade 08/2019

2019-08-27 Thread Tellier Benoit (Jira)


[ 
https://issues.apache.org/jira/browse/JAMES-2855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16916479#comment-16916479
 ] 

Tellier Benoit commented on JAMES-2855:
---

https://github.com/linagora/james-project/pull/2606 upgraded docker files

https://github.com/linagora/james-project/pull/2613 fixed logging issues 
introduced by the commons configuration upgrade

https://github.com/linagora/james-project/pull/2630 Upgraded Junit 5 and solved 
related problems

> James dependencies upgrade 08/2019
> --
>
> Key: JAMES-2855
> URL: https://issues.apache.org/jira/browse/JAMES-2855
> Project: James Server
>  Issue Type: Improvement
>Reporter: Trần Tiến Đức
>Priority: Major
>
> List of the dependencies
> {code:java}
> From: mvn versions:display-dependency-updates | grep -- '->' | sort | uniq -c
>       1 [INFO]        
> net.javacrumbs.future-converter:future-converter-java8-guava    0.3.0 -> 1.2.0
>     223 [INFO]      
> org.apache.karaf.tooling.exam:org.apache.karaf.tooling.exam.container 
> ...2.3.0 -> 3.0.0.RC1
>     223 [INFO]       org.apache.maven.plugin-tools:maven-plugin-annotations 
> ... 3.4 -> 3.6.0
>     223 [INFO]   ch.qos.logback:logback-classic . 1.2.3 -> 
> 1.3.0-alpha4
>     223 [INFO]   ch.qos.logback:logback-core  1.2.3 -> 
> 1.3.0-alpha4
>       1 [INFO]   com.amazonaws:aws-java-sdk-s3 ... 1.11.532 
> -> 1.11.602
>       1 [INFO]   com.datastax.cassandra:cassandra-driver-core .. 
> 3.7.0 -> 4.0.0
>     223 [INFO]   com.fasterxml.jackson.core:jackson-annotations ... 2.9.6 -> 
> 2.10.0.pr1
>     223 [INFO]   com.fasterxml.jackson.core:jackson-core .. 2.9.6 -> 
> 2.10.0.pr1
>     223 [INFO]   com.fasterxml.jackson.core:jackson-databind .. 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.core:jackson-annotations  2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.core:jackson-core ... 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.core:jackson-databind ... 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.dataformat:jackson-dataformat-cbor ... 2.9.6 
> -> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.dataformat:jackson-dataformat-smile ... 2.9.6 
> -> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.dataformat:jackson-dataformat-xml ... 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.dataformat:jackson-dataformat-yaml ... 2.9.6 
> -> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.datatype:jackson-datatype-guava ... 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.datatype:jackson-datatype-jdk8 ... 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.datatype:jackson-datatype-joda ... 2.9.6 
> ->2.10.0.pr1
> [INFO]   com.fasterxml.jackson.datatype:jackson-datatype-jsr310 ... 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider ... 2.9.6 -> 
> 2.10.0.pr1
> [INFO]   com.fasterxml.jackson.module:jackson-module-afterburner ... 2.9.6 -> 
> 2.10.0.pr1
>     223 [INFO]   org.codehaus.jackson:jackson-core-asl  1.9.2 
> -> 1.9.11
>     223 [INFO]   org.codehaus.jackson:jackson-jaxrs ... 1.9.2 
> -> 1.9.11
>     223 [INFO]   org.codehaus.jackson:jackson-mapper-asl .. 1.9.2 
> -> 1.9.11
>     223 [INFO]   org.codehaus.jackson:jackson-xc .. 1.9.2 
> -> 1.9.11
>     223 [INFO]   com.github.kongchen:swagger-maven-plugin .. 
> 3.1.7 -> 3.1.8
>     223 [INFO]   com.github.spullara.mustache.java:compiler  
> 0.9.5 -> 0.9.6
>       1 [INFO]   com.github.stefanbirkner:system-rules ... 1.18.0 
> -> 1.19.0
>       1 [INFO]   com.google.crypto.tink:tink ... 1.2.0 -> 
> 1.3.0-rc1
>       1 [INFO]   com.google.guava:guava .. 13.0 
> -> 28.0-jre
>       1 [INFO]   com.google.guava:guava .. 20.0 
> -> 28.0-jre
>     223 [INFO]   com.google.guava:guava .. 25.1-jre 
> -> 28.0-jre
>      25 [INFO]   com.google.inject.extensions:guice-assistedinject ... 
> 4.0 -> 4.2.2
>     198 [INFO]   com.google.inject.extensions:guice-assistedinject . 
> 4.2.0 -> 4.2.2
>     223 [INFO]   com.google.inject.extensions:guice-multibindings  
> 4.0 -> 4.2.2
>      25 [INFO]   com.google.inject:guice . 
> 4.0 -> 4.2.2
>     198 [INFO]   com.google.inject:guice ... 
> 4.2.0 -> 4.2.2
>     223 [INFO]   com.ibm.icu:icu4j ... 
> 62.1 -> 64.2
>     223 [INFO]   com.jayway.awaitility:awaitility .. 
> 1.6.5 -> 1.7.0
>     223 [INFO]   org.awaitility:awaitility . 3.1.2 -> 
> 4.0.0-rc1
> [INFO]   org.apache.pdfbox:pdfbox  2.0.12 

[james-project] 10/17: JAMES-2866 Manage MockSmtp configuration over Http (Jetty)

2019-08-27 Thread btellier
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 c882f4a7da4ae3a97a2f027d7078ad6a7e9177cf
Author: Benoit Tellier 
AuthorDate: Fri Aug 23 14:36:48 2019 +0700

JAMES-2866 Manage MockSmtp configuration over Http (Jetty)

Includes a Fixture for MockSMTPServer tests
---
 server/mailet/mock-smtp-server/pom.xml |  17 +++
 .../mock/smtp/server/HTTPConfigurationServer.java  | 110 +
 .../james/mock/smtp/server/ConditionTest.java  |   4 +-
 .../org/apache/james/mock/smtp/server/Fixture.java |  66 +++
 .../smtp/server/HTTPConfigurationServerTest.java   | 130 +
 .../mock/smtp/server/MockSMTPBehaviorTest.java |  53 +++--
 .../mock/smtp/server/MockSmtpBehaviorsTest.java|  30 ++---
 .../james/mock/smtp/server/ResponseTest.java   |   4 +-
 .../smtp/server/SMTPBehaviorRepositoryTest.java|  12 +-
 .../james/mock/smtp/server/SMTPCommandTest.java|   5 +-
 10 files changed, 354 insertions(+), 77 deletions(-)

diff --git a/server/mailet/mock-smtp-server/pom.xml 
b/server/mailet/mock-smtp-server/pom.xml
index f7ea8c8..2ea427f 100644
--- a/server/mailet/mock-smtp-server/pom.xml
+++ b/server/mailet/mock-smtp-server/pom.xml
@@ -42,6 +42,10 @@
 james-core
 
 
+${james.groupId}
+james-server-jetty
+
+
 com.fasterxml.jackson.core
 jackson-databind
 
@@ -58,6 +62,11 @@
 guava
 
 
+io.rest-assured
+rest-assured
+test
+
+
 net.javacrumbs.json-unit
 json-unit-assertj
 test
@@ -77,5 +86,13 @@
 assertj-core
 test
 
+
+org.slf4j
+jcl-over-slf4j
+
+
+org.slf4j
+slf4j-api
+
 
 
diff --git 
a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/HTTPConfigurationServer.java
 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/HTTPConfigurationServer.java
new file mode 100644
index 000..2f04ec9
--- /dev/null
+++ 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/HTTPConfigurationServer.java
@@ -0,0 +1,110 @@
+/
+ * 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.mock.smtp.server;
+
+import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
+import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
+import static javax.servlet.http.HttpServletResponse.SC_OK;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.james.http.jetty.Configuration;
+import org.apache.james.http.jetty.JettyHttpServer;
+import org.apache.james.util.Port;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.datatype.guava.GuavaModule;
+import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
+import com.google.common.collect.ImmutableList;
+
+public class HTTPConfigurationServer {
+static class HTTPConfigurationServlet extends HttpServlet {
+private final ObjectMapper objectMapper;
+private final SMTPBehaviorRepository smtpBehaviorRepository;
+
+HTTPConfigurationServlet(SMTPBehaviorRepository 
smtpBehaviorRepository) {
+this.objectMapper = new ObjectMapper()
+.registerModule(new Jdk8Module())
+.registerModule(new GuavaModule());
+this.smtpBehaviorRepository = smtpBehaviorRepository;
+}
+
+

[james-project] 17/17: JAMES-2593 expose webadmin port in docker-compose

2019-08-27 Thread btellier
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 3d30d5a9cace8b1889d2607987b95067707fd679
Author: Rene Cordier 
AuthorDate: Mon Aug 26 09:59:40 2019 +0700

JAMES-2593 expose webadmin port in docker-compose
---
 dockerfiles/run/docker-compose.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dockerfiles/run/docker-compose.yml 
b/dockerfiles/run/docker-compose.yml
index 3affe16..d21e296 100644
--- a/dockerfiles/run/docker-compose.yml
+++ b/dockerfiles/run/docker-compose.yml
@@ -21,6 +21,7 @@ services:
   - "465:465"
   - "587:587"
   - "993:993"
+  - "8000:8000"
 
   elasticsearch:
 image: docker.elastic.co/elasticsearch/elasticsearch:6.3.2


-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[james-project] 08/17: JAMES-2866 MockSMTPBehaviors POJO

2019-08-27 Thread btellier
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 0f02246908797e6fa70563fdbca361f163196c1a
Author: Benoit Tellier 
AuthorDate: Wed Aug 21 15:55:04 2019 +0700

JAMES-2866 MockSMTPBehaviors POJO

Directly correnspond to HTTP configuration output
---
 server/mailet/mock-smtp-server/pom.xml |  4 ++
 .../james/mock/smtp/server/MockSmtpBehaviors.java  | 56 +
 .../mock/smtp/server/MockSMTPBehaviorTest.java |  8 +--
 .../mock/smtp/server/MockSmtpBehaviorsTest.java| 73 ++
 4 files changed, 137 insertions(+), 4 deletions(-)

diff --git a/server/mailet/mock-smtp-server/pom.xml 
b/server/mailet/mock-smtp-server/pom.xml
index ce806b9..f7ea8c8 100644
--- a/server/mailet/mock-smtp-server/pom.xml
+++ b/server/mailet/mock-smtp-server/pom.xml
@@ -47,6 +47,10 @@
 
 
 com.fasterxml.jackson.datatype
+jackson-datatype-guava
+
+
+com.fasterxml.jackson.datatype
 jackson-datatype-jdk8
 
 
diff --git 
a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSmtpBehaviors.java
 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSmtpBehaviors.java
new file mode 100644
index 000..7ebe28a
--- /dev/null
+++ 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSmtpBehaviors.java
@@ -0,0 +1,56 @@
+/
+ * 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.mock.smtp.server;
+
+import java.util.List;
+import java.util.Objects;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.google.common.collect.ImmutableList;
+
+public class MockSmtpBehaviors {
+private final List behaviorList;
+
+@JsonCreator
+public MockSmtpBehaviors(List behaviorList) {
+this.behaviorList = ImmutableList.copyOf(behaviorList);
+}
+
+@JsonValue
+public List getBehaviorList() {
+return behaviorList;
+}
+
+@Override
+public final boolean equals(Object o) {
+if (o instanceof MockSmtpBehaviors) {
+MockSmtpBehaviors that = (MockSmtpBehaviors) o;
+
+return Objects.equals(this.behaviorList, that.behaviorList);
+}
+return false;
+}
+
+@Override
+public final int hashCode() {
+return Objects.hash(behaviorList);
+}
+}
diff --git 
a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/MockSMTPBehaviorTest.java
 
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/MockSMTPBehaviorTest.java
index 606c4bc..91f760f 100644
--- 
a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/MockSMTPBehaviorTest.java
+++ 
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/MockSMTPBehaviorTest.java
@@ -40,25 +40,25 @@ class MockSMTPBehaviorTest {
 private static final Response RESPONSE = 
Response.serverAccept(SMTPStatusCode.ACTION_COMPLETE_250, "message");
 private static final ObjectMapper OBJECT_MAPPER = new 
ObjectMapper().registerModule(new Jdk8Module());
 
-private static final String JSON_COMPULSORY_FIELDS = "{" +
+static final String JSON_COMPULSORY_FIELDS = "{" +
 "  \"response\": {\"code\":250, \"message\":\"OK\", 
\"rejected\":false}," +
 "  \"command\": \"EHLO\"" +
 "}";
 
-private static final MockSMTPBehavior POJO_COMPULSORY_FIELDS = new 
MockSMTPBehavior(
+static final MockSMTPBehavior POJO_COMPULSORY_FIELDS = new 
MockSMTPBehavior(
 SMTPCommand.EHLO,
 Optional.empty(),

[james-project] 15/17: JAMES-2855 @RegisterExtension fields cannot be private

2019-08-27 Thread btellier
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 a2b069c802672297b05f9437aea56641453d1147
Author: Rene Cordier 
AuthorDate: Mon Aug 26 15:08:05 2019 +0700

JAMES-2855 @RegisterExtension fields cannot be private
---
 .../methods/integration/LinshareBlobExportMechanismIntegrationTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/LinshareBlobExportMechanismIntegrationTest.java
 
b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/LinshareBlobExportMechanismIntegrationTest.java
index 068827d..71f7b9f 100644
--- 
a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/LinshareBlobExportMechanismIntegrationTest.java
+++ 
b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/LinshareBlobExportMechanismIntegrationTest.java
@@ -92,7 +92,7 @@ public abstract class 
LinshareBlobExportMechanismIntegrationTest {
 private LinshareAPI user1LinshareAPI;
 
 @RegisterExtension
-private IMAPMessageReader imapMessageReader = new IMAPMessageReader();
+IMAPMessageReader imapMessageReader = new IMAPMessageReader();
 
 @BeforeEach
 void setup(GuiceJamesServer jmapServer) throws Throwable {


-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[james-project] 12/17: JAMES-2855 Upgrade to Junit 5.5.1

2019-08-27 Thread btellier
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 d476c69212d5dfdce29f962cef598e4af8868431
Author: Rene Cordier 
AuthorDate: Fri Aug 23 17:06:33 2019 +0700

JAMES-2855 Upgrade to Junit 5.5.1
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 507e013..8f6053d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -604,9 +604,9 @@
 
 2.1.9
 4.12
-5.2.0
-1.4.1
-5.2.0
+5.5.1
+1.5.1
+5.5.1
 1.3.4
 4.9
 3.10.6.Final


-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[james-project] 04/17: JAMES-2866 JSON serialization for SMTPCommand

2019-08-27 Thread btellier
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 7263450e5084ded737805086053897bc9919a625
Author: Benoit Tellier 
AuthorDate: Wed Aug 21 14:52:06 2019 +0700

JAMES-2866 JSON serialization for SMTPCommand
---
 server/mailet/mock-smtp-server/pom.xml |   4 +
 .../apache/james/mock/smtp/server/SMTPCommand.java |  18 +++
 .../james/mock/smtp/server/SMTPCommandTest.java| 151 +
 3 files changed, 173 insertions(+)

diff --git a/server/mailet/mock-smtp-server/pom.xml 
b/server/mailet/mock-smtp-server/pom.xml
index d79081f..8db2a69 100644
--- a/server/mailet/mock-smtp-server/pom.xml
+++ b/server/mailet/mock-smtp-server/pom.xml
@@ -42,6 +42,10 @@
 james-core
 
 
+com.fasterxml.jackson.core
+jackson-databind
+
+
 com.google.guava
 guava
 
diff --git 
a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/SMTPCommand.java
 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/SMTPCommand.java
index 024b662..60a2a76 100644
--- 
a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/SMTPCommand.java
+++ 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/SMTPCommand.java
@@ -19,6 +19,11 @@
 
 package org.apache.james.mock.smtp.server;
 
+import java.util.Arrays;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
 enum SMTPCommand {
 RCPT_TO("RCPT TO"),
 EHLO("EHLO"),
@@ -29,9 +34,22 @@ enum SMTPCommand {
 NOOP("NOOP"),
 QUIT("QUIT");
 
+@JsonCreator
+public static SMTPCommand parse(String value) {
+return Arrays.stream(SMTPCommand.values())
+.filter(command -> command.commandName.equals(value))
+.findFirst()
+.orElseThrow(() -> new IllegalArgumentException("No command name 
associated with supplied value: " + value));
+}
+
 private final String commandName;
 
 SMTPCommand(String commandName) {
 this.commandName = commandName;
 }
+
+@JsonValue
+public String getCommandName() {
+return commandName;
+}
 }
diff --git 
a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/SMTPCommandTest.java
 
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/SMTPCommandTest.java
new file mode 100644
index 000..be396c1
--- /dev/null
+++ 
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/SMTPCommandTest.java
@@ -0,0 +1,151 @@
+/
+ * 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.mock.smtp.server;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import java.io.IOException;
+
+import org.junit.jupiter.api.Test;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+class SMTPCommandTest {
+private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+
+@Test
+void jacksonShouldDeserializeRsetCommand() throws Exception {
+SMTPCommand command = OBJECT_MAPPER.readValue("\"RSET\"", 
SMTPCommand.class);
+
+assertThat(command).isEqualTo(SMTPCommand.RSET);
+}
+
+@Test
+void jacksonShouldDeserializeRcptToCommand() throws Exception {
+SMTPCommand command = OBJECT_MAPPER.readValue("\"RCPT TO\"", 
SMTPCommand.class);
+
+assertThat(command).isEqualTo(SMTPCommand.RCPT_TO);
+}
+
+@Test
+void jacksonShouldDeserializeMailFromCommand() throws Exception {
+SMTPCommand command = 

[james-project] 07/17: JAMES-2866 JSON serialization for MockSMTPBehavior

2019-08-27 Thread btellier
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 ff6e5e8e3b72ad9a17f690fbbc738784705e33a4
Author: Benoit Tellier 
AuthorDate: Wed Aug 21 15:30:12 2019 +0700

JAMES-2866 JSON serialization for MockSMTPBehavior
---
 server/mailet/mock-smtp-server/pom.xml |  4 ++
 .../james/mock/smtp/server/MockSMTPBehavior.java   | 55 -
 .../mock/smtp/server/MockSMTPBehaviorTest.java | 68 ++
 3 files changed, 125 insertions(+), 2 deletions(-)

diff --git a/server/mailet/mock-smtp-server/pom.xml 
b/server/mailet/mock-smtp-server/pom.xml
index bdcbea7..ce806b9 100644
--- a/server/mailet/mock-smtp-server/pom.xml
+++ b/server/mailet/mock-smtp-server/pom.xml
@@ -46,6 +46,10 @@
 jackson-databind
 
 
+com.fasterxml.jackson.datatype
+jackson-datatype-jdk8
+
+
 com.google.guava
 guava
 
diff --git 
a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPBehavior.java
 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPBehavior.java
index 371b2ea..2d8596a 100644
--- 
a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPBehavior.java
+++ 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPBehavior.java
@@ -22,8 +22,13 @@ package org.apache.james.mock.smtp.server;
 import java.util.Objects;
 import java.util.Optional;
 
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
 import com.google.common.base.Preconditions;
 
+@JsonDeserialize(builder = MockSMTPBehavior.Builder.class)
 public class MockSMTPBehavior {
 public static final class NumberOfAnswersPolicy {
 
@@ -31,6 +36,7 @@ public class MockSMTPBehavior {
 return new NumberOfAnswersPolicy(Optional.empty());
 }
 
+@JsonCreator
 public static NumberOfAnswersPolicy times(int times) {
 Preconditions.checkArgument(times > 0, "times should be positive");
 return new NumberOfAnswersPolicy(Optional.of(times));
@@ -42,6 +48,7 @@ public class MockSMTPBehavior {
 this.numberOfAnswers = numberOfAnswers;
 }
 
+@JsonValue
 public Optional getNumberOfAnswers() {
 return numberOfAnswers;
 }
@@ -62,6 +69,50 @@ public class MockSMTPBehavior {
 }
 }
 
+@JsonPOJOBuilder(withPrefix = "")
+public static class Builder {
+private SMTPCommand smtpCommand;
+private Optional condition;
+private Response response;
+private Optional numberOfAnswers;
+
+public Builder() {
+condition = Optional.empty();
+numberOfAnswers = Optional.empty();
+}
+
+public Builder command(SMTPCommand command) {
+this.smtpCommand = command;
+return this;
+}
+
+public Builder response(Response response) {
+this.response = response;
+return this;
+}
+
+public Builder condition(Condition condition) {
+this.condition = Optional.of(condition);
+return this;
+}
+
+public Builder numberOfAnswer(Optional 
numberOfAnswers) {
+this.numberOfAnswers = numberOfAnswers;
+return this;
+}
+
+public MockSMTPBehavior build() {
+Preconditions.checkState(smtpCommand != null, "You need to specify 
an smtpCommand");
+Preconditions.checkState(response != null, "You need to specify a 
response");
+
+return new MockSMTPBehavior(
+smtpCommand,
+condition,
+response,
+numberOfAnswers.orElse(NumberOfAnswersPolicy.anytime()));
+}
+}
+
 private final SMTPCommand smtpCommand;
 private final Optional condition;
 private final Response response;
@@ -79,7 +130,7 @@ public class MockSMTPBehavior {
 this.numberOfAnswers = numberOfAnswers;
 }
 
-public SMTPCommand getSmtpCommand() {
+public SMTPCommand getCommand() {
 return smtpCommand;
 }
 
@@ -91,7 +142,7 @@ public class MockSMTPBehavior {
 return response;
 }
 
-public NumberOfAnswersPolicy getNumberOfAnswers() {
+public NumberOfAnswersPolicy getNumberOfAnswer() {
 return numberOfAnswers;
 }
 
diff --git 
a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/MockSMTPBehaviorTest.java
 
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/MockSMTPBehaviorTest.java
index 57f16cd..606c4bc 

[james-project] 16/17: JAMES-2593 Use distributed james image in docker-compose

2019-08-27 Thread btellier
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 1da0096fceb492c7f772a0976ba03546d1c19160
Author: Rene Cordier 
AuthorDate: Mon Aug 26 09:59:06 2019 +0700

JAMES-2593 Use distributed james image in docker-compose
---
 dockerfiles/run/docker-compose.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dockerfiles/run/docker-compose.yml 
b/dockerfiles/run/docker-compose.yml
index b9611e3..3affe16 100644
--- a/dockerfiles/run/docker-compose.yml
+++ b/dockerfiles/run/docker-compose.yml
@@ -10,7 +10,7 @@ services:
   - rabbitmq
   - swift
 entrypoint: bash -c "java -Dworking.directory=/root/ -jar james-server.jar"
-image: linagora/james-project:latest
+image: linagora/james-rabbitmq-project:latest
 container_name: james
 hostname: james.local
 ports:


-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[james-project] 02/17: JAMES-2855 Upgrade ruby to 2.6.3 in Homepage Dockerfile

2019-08-27 Thread btellier
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 7478399430785960a9588a40dde9a73cd98ab81a
Author: Benoit Tellier 
AuthorDate: Tue Aug 20 14:49:20 2019 +0700

JAMES-2855 Upgrade ruby to 2.6.3 in Homepage Dockerfile
---
 dockerfiles/site/homepage/Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dockerfiles/site/homepage/Dockerfile 
b/dockerfiles/site/homepage/Dockerfile
index b5741d6..c5997ab 100644
--- a/dockerfiles/site/homepage/Dockerfile
+++ b/dockerfiles/site/homepage/Dockerfile
@@ -1,4 +1,4 @@
-FROM ruby:2.3
+FROM ruby:2.6.3
 
 RUN apt-get update \
   && apt-get install -y \


-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[james-project] 14/17: JAMES-2855 Add missing junit-platform-launcher dependency to poms

2019-08-27 Thread btellier
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 ede498570cb44ea6869f2e46561d32e4c664aaf2
Author: Rene Cordier 
AuthorDate: Fri Aug 23 17:39:52 2019 +0700

JAMES-2855 Add missing junit-platform-launcher dependency to poms
---
 examples/custom-listeners/pom.xml   |  5 +
 mailbox/caching/pom.xml |  5 +
 mailbox/event/json/pom.xml  |  5 +
 mpt/impl/managesieve/core/pom.xml   |  4 
 server/blob/blob-export-api/pom.xml |  5 +
 server/container/guice/blob-export-guice/pom.xml|  5 +
 .../container/guice/cassandra-rabbitmq-ldap-guice/pom.xml   |  5 +
 server/container/guice/configuration/pom.xml|  5 +
 server/container/guice/guice-common/pom.xml |  5 +
 server/container/guice/jpa-common-guice/pom.xml |  5 +
 server/container/guice/mailbox/pom.xml  |  5 +
 server/container/guice/memory-guice/pom.xml |  5 +
 server/container/lifecycle-api/pom.xml  |  5 +
 server/data/data-jmap-cassandra/pom.xml | 13 +
 server/data/data-jmap/pom.xml   |  5 +
 server/mailet/mock-smtp-server/pom.xml  |  5 +
 server/mailrepository/mailrepository-memory/pom.xml |  5 +
 server/protocols/jmap/pom.xml   |  5 +
 server/protocols/webadmin/webadmin-cassandra-data/pom.xml   |  5 +
 server/protocols/webadmin/webadmin-mailqueue/pom.xml|  5 +
 server/queue/queue-api/pom.xml  |  5 +
 server/queue/queue-file/pom.xml |  5 +
 server/testing/pom.xml  |  4 
 23 files changed, 117 insertions(+), 4 deletions(-)

diff --git a/examples/custom-listeners/pom.xml 
b/examples/custom-listeners/pom.xml
index 07be61d..fa74532 100644
--- a/examples/custom-listeners/pom.xml
+++ b/examples/custom-listeners/pom.xml
@@ -45,5 +45,10 @@
 junit-jupiter-engine
 test
 
+
+org.junit.platform
+junit-platform-launcher
+test
+
 
 
\ No newline at end of file
diff --git a/mailbox/caching/pom.xml b/mailbox/caching/pom.xml
index 589e2e6..3dd45e9 100644
--- a/mailbox/caching/pom.xml
+++ b/mailbox/caching/pom.xml
@@ -63,6 +63,11 @@
 test
 
 
+org.junit.platform
+junit-platform-launcher
+test
+
+
 org.slf4j
 slf4j-api
 
diff --git a/mailbox/event/json/pom.xml b/mailbox/event/json/pom.xml
index 752c165..7b88bc4 100644
--- a/mailbox/event/json/pom.xml
+++ b/mailbox/event/json/pom.xml
@@ -78,6 +78,11 @@
 test
 
 
+org.junit.platform
+junit-platform-launcher
+test
+
+
 org.julienrf
 play-json-derived-codecs_${scala.base}
 6.0.0
diff --git a/mpt/impl/managesieve/core/pom.xml 
b/mpt/impl/managesieve/core/pom.xml
index e72d5d8..fb2aba6 100644
--- a/mpt/impl/managesieve/core/pom.xml
+++ b/mpt/impl/managesieve/core/pom.xml
@@ -51,6 +51,10 @@
 junit-jupiter-engine
 
 
+org.junit.platform
+junit-platform-launcher
+
+
 org.junit.vintage
 junit-vintage-engine
 
diff --git a/server/blob/blob-export-api/pom.xml 
b/server/blob/blob-export-api/pom.xml
index 408d522..ed93e22 100644
--- a/server/blob/blob-export-api/pom.xml
+++ b/server/blob/blob-export-api/pom.xml
@@ -62,5 +62,10 @@
 junit-jupiter-engine
 test
 
+
+org.junit.platform
+junit-platform-launcher
+test
+
 
 
\ No newline at end of file
diff --git a/server/container/guice/blob-export-guice/pom.xml 
b/server/container/guice/blob-export-guice/pom.xml
index 79ac090..aa656dd 100644
--- a/server/container/guice/blob-export-guice/pom.xml
+++ b/server/container/guice/blob-export-guice/pom.xml
@@ -82,6 +82,11 @@
 test
 
 
+org.junit.platform
+junit-platform-launcher
+test
+
+
 org.mockito
 mockito-core
 test
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml 
b/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
index 22f01e2..79ad4a8 100644
--- a/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
@@ -120,6 +120,11 @@
 

[james-project] 01/17: JAMES-2854 Upgrade to OpenJDK 8u222 JRE base image

2019-08-27 Thread btellier
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 7778b799bef49c24203a103ec9bc21f4683180df
Author: Benoit Tellier 
AuthorDate: Tue Aug 20 14:11:45 2019 +0700

JAMES-2854 Upgrade to OpenJDK 8u222 JRE base image
---
 dockerfiles/run/guice/cassandra-ldap/Dockerfile  | 2 +-
 dockerfiles/run/guice/cassandra-rabbitmq-ldap/Dockerfile | 2 +-
 dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile  | 2 +-
 dockerfiles/run/guice/cassandra/Dockerfile   | 2 +-
 dockerfiles/run/guice/jpa-smtp/Dockerfile| 2 +-
 dockerfiles/run/guice/jpa/Dockerfile | 2 +-
 dockerfiles/run/guice/memory/Dockerfile  | 2 +-
 dockerfiles/run/spring/Dockerfile| 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/dockerfiles/run/guice/cassandra-ldap/Dockerfile 
b/dockerfiles/run/guice/cassandra-ldap/Dockerfile
index dd5db36..499f4fd 100644
--- a/dockerfiles/run/guice/cassandra-ldap/Dockerfile
+++ b/dockerfiles/run/guice/cassandra-ldap/Dockerfile
@@ -2,7 +2,7 @@
 #
 # VERSION  1.0
 
-FROM openjdk:8u181-jre
+FROM openjdk:8u222-jre
 
 # Ports that are used
 #
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/Dockerfile 
b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/Dockerfile
index 24f06c4..64e477a 100644
--- a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/Dockerfile
+++ b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/Dockerfile
@@ -2,7 +2,7 @@
 #
 # VERSION  1.0
 
-FROM openjdk:8u181-jre
+FROM openjdk:8u222-jre
 
 # Ports that are used
 #
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile 
b/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
index 922e0e3..79f1a10 100644
--- a/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
+++ b/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
@@ -2,7 +2,7 @@
 #
 # VERSION  1.0
 
-FROM openjdk:8u181-jre
+FROM openjdk:8u222-jre
 
 # Ports that are used
 #
diff --git a/dockerfiles/run/guice/cassandra/Dockerfile 
b/dockerfiles/run/guice/cassandra/Dockerfile
index 43f3c69..c4fddf8 100644
--- a/dockerfiles/run/guice/cassandra/Dockerfile
+++ b/dockerfiles/run/guice/cassandra/Dockerfile
@@ -2,7 +2,7 @@
 #
 # VERSION  1.0
 
-FROM openjdk:8u181-jre
+FROM openjdk:8u222-jre
 
 # Ports that are used
 #
diff --git a/dockerfiles/run/guice/jpa-smtp/Dockerfile 
b/dockerfiles/run/guice/jpa-smtp/Dockerfile
index 2eb86ff..f0ba5d3 100644
--- a/dockerfiles/run/guice/jpa-smtp/Dockerfile
+++ b/dockerfiles/run/guice/jpa-smtp/Dockerfile
@@ -2,7 +2,7 @@
 #
 # VERSION  1.0
 
-FROM openjdk:8u181-jre
+FROM openjdk:8u222-jre
 
 # Ports that are used
 #
diff --git a/dockerfiles/run/guice/jpa/Dockerfile 
b/dockerfiles/run/guice/jpa/Dockerfile
index 07e386f..e83fbf7 100644
--- a/dockerfiles/run/guice/jpa/Dockerfile
+++ b/dockerfiles/run/guice/jpa/Dockerfile
@@ -2,7 +2,7 @@
 #
 # VERSION  1.0
 
-FROM openjdk:8u181-jre
+FROM openjdk:8u222-jre
 
 # Ports that are used
 #
diff --git a/dockerfiles/run/guice/memory/Dockerfile 
b/dockerfiles/run/guice/memory/Dockerfile
index 93e3bd1..f0ba1e2 100644
--- a/dockerfiles/run/guice/memory/Dockerfile
+++ b/dockerfiles/run/guice/memory/Dockerfile
@@ -2,7 +2,7 @@
 #
 # VERSION  1.0
 
-FROM openjdk:8u181-jre
+FROM openjdk:8u222-jre
 
 # Ports that are used
 #
diff --git a/dockerfiles/run/spring/Dockerfile 
b/dockerfiles/run/spring/Dockerfile
index ff94ea4..a8fd727 100644
--- a/dockerfiles/run/spring/Dockerfile
+++ b/dockerfiles/run/spring/Dockerfile
@@ -2,7 +2,7 @@
 #
 # VERSION  1.0
 
-FROM openjdk:8u181-jre
+FROM openjdk:8u222-jre
 
 # Ports that are used
 #


-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[james-project] 13/17: JAMES-2855 Upgrade surefire plugin to 2.22.2

2019-08-27 Thread btellier
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 c1e354230a9bfd59de3aaccc47bded5cc0935e2f
Author: Rene Cordier 
AuthorDate: Fri Aug 23 17:06:56 2019 +0700

JAMES-2855 Upgrade surefire plugin to 2.22.2
---
 pom.xml   | 16 ++--
 server/protocols/jmap-integration-testing/pom.xml | 12 
 2 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/pom.xml b/pom.xml
index 8f6053d..1459c2d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2904,30 +2904,18 @@
 
 org.apache.maven.plugins
 maven-surefire-plugin
-2.22.0
+2.22.2
 
 -Xms512m -Xmx1024m
 false
 
 
7200
 
-
-
-org.junit.jupiter
-junit-jupiter-engine
-${junit.jupiter.version}
-
-
-org.junit.vintage
-junit-vintage-engine
-${junit.vintage.version}
- 
-
 
 
 org.apache.maven.plugins
 maven-surefire-report-plugin
-2.22.0
+2.22.2
 
 true
 
diff --git a/server/protocols/jmap-integration-testing/pom.xml 
b/server/protocols/jmap-integration-testing/pom.xml
index 71ea405..7ae8946 100644
--- a/server/protocols/jmap-integration-testing/pom.xml
+++ b/server/protocols/jmap-integration-testing/pom.xml
@@ -45,18 +45,6 @@
 
 org.apache.maven.plugins
 maven-surefire-plugin
-
-
-org.junit.jupiter
-junit-jupiter-engine
-${junit.jupiter.version}
-
-
-org.junit.vintage
-junit-vintage-engine
-${junit.vintage.version}
-
-
 
 
 


-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[james-project] 06/17: JAMES-2866 JSON serialization for Response

2019-08-27 Thread btellier
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 d1ccaad97ebf1e850169be99b87812163e828a07
Author: Benoit Tellier 
AuthorDate: Wed Aug 21 15:09:41 2019 +0700

JAMES-2866 JSON serialization for Response
---
 .../apache/james/mock/smtp/server/Response.java| 29 +-
 .../james/mock/smtp/server/ResponseTest.java   | 65 ++
 2 files changed, 92 insertions(+), 2 deletions(-)

diff --git 
a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/Response.java
 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/Response.java
index 9adb043..04f3ea0 100644
--- 
a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/Response.java
+++ 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/Response.java
@@ -19,8 +19,12 @@
 
 package org.apache.james.mock.smtp.server;
 
+import java.util.Arrays;
 import java.util.Objects;
 
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonValue;
 import com.google.common.base.Preconditions;
 
 class Response {
@@ -53,10 +57,19 @@ class Response {
 
 private final int code;
 
-private SMTPStatusCode(int code) {
+@JsonCreator
+public static SMTPStatusCode of(int code) {
+return Arrays.stream(values())
+.filter(value -> value.code == code)
+.findFirst()
+.orElseThrow(() -> new IllegalArgumentException(code + " is 
not a supported SMTP code"));
+}
+
+SMTPStatusCode(int code) {
 this.code = code;
 }
 
+@JsonValue
 public int getCode() {
 return code;
 }
@@ -74,7 +87,10 @@ class Response {
 private final String message;
 private final boolean serverRejected;
 
-private Response(SMTPStatusCode code, String message, boolean 
serverRejected) {
+@JsonCreator
+private Response(@JsonProperty("code") SMTPStatusCode code,
+ @JsonProperty("message") String message,
+ @JsonProperty("rejected") boolean serverRejected) {
 Preconditions.checkNotNull(message);
 Preconditions.checkNotNull(code);
 
@@ -87,10 +103,19 @@ class Response {
 return code.getCode() + " " + message;
 }
 
+@JsonProperty("rejected")
 boolean isServerRejected() {
 return serverRejected;
 }
 
+public SMTPStatusCode getCode() {
+return code;
+}
+
+public String getMessage() {
+return message;
+}
+
 @Override
 public final boolean equals(Object o) {
 if (o instanceof Response) {
diff --git 
a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/ResponseTest.java
 
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/ResponseTest.java
index cd5f39f..cc2cfb6 100644
--- 
a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/ResponseTest.java
+++ 
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/ResponseTest.java
@@ -19,15 +19,61 @@
 
 package org.apache.james.mock.smtp.server;
 
+import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 import org.apache.james.mock.smtp.server.Response.SMTPStatusCode;
+import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+
 import nl.jqno.equalsverifier.EqualsVerifier;
 
 class ResponseTest {
+static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+static final int OK_250_CODE = 250;
+static final Response.SMTPStatusCode OK_250 = 
Response.SMTPStatusCode.of(OK_250_CODE);
+
+@Nested
+class SMTPStatusCodeTest {
+@Test
+void shouldMatchBeanContract() {
+EqualsVerifier.forClass(Response.SMTPStatusCode.class)
+.verify();
+}
+
+@Test
+void constructorShouldThrowWhenStatusCodeIsNegative() {
+assertThatThrownBy(() -> Response.SMTPStatusCode.of(-1))
+.isInstanceOf(IllegalArgumentException.class);
+}
+
+@Test
+void constructorShouldThrowWhenStatusCodeIsZero() {
+assertThatThrownBy(() -> Response.SMTPStatusCode.of(0))
+.isInstanceOf(IllegalArgumentException.class);
+}
+
+@Test
+void constructorShouldThrowWhenStatusCodeIsTooBig() {
+assertThatThrownBy(() -> Response.SMTPStatusCode.of(600))
+.isInstanceOf(IllegalArgumentException.class);
+}
+
+@Test
+

[james-project] 11/17: JAMES-2866 Avoid relying on Optional now that we have the matchAll condition

2019-08-27 Thread btellier
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 b2f0789afac251cc65f8e01fcda4fbf912edd9b6
Author: Benoit Tellier 
AuthorDate: Tue Aug 27 10:16:52 2019 +0700

JAMES-2866 Avoid relying on Optional now that we have the matchAll condition
---
 .../james/mock/smtp/server/MockSMTPBehavior.java| 21 +++--
 .../org/apache/james/mock/smtp/server/Fixture.java  |  7 +++
 .../mock/smtp/server/MockSMTPBehaviorTest.java  |  8 +++-
 3 files changed, 21 insertions(+), 15 deletions(-)

diff --git 
a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPBehavior.java
 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPBehavior.java
index 2d8596a..f49f92d 100644
--- 
a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPBehavior.java
+++ 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPBehavior.java
@@ -72,12 +72,11 @@ public class MockSMTPBehavior {
 @JsonPOJOBuilder(withPrefix = "")
 public static class Builder {
 private SMTPCommand smtpCommand;
-private Optional condition;
+private Condition condition;
 private Response response;
 private Optional numberOfAnswers;
 
 public Builder() {
-condition = Optional.empty();
 numberOfAnswers = Optional.empty();
 }
 
@@ -92,7 +91,7 @@ public class MockSMTPBehavior {
 }
 
 public Builder condition(Condition condition) {
-this.condition = Optional.of(condition);
+this.condition = condition;
 return this;
 }
 
@@ -114,11 +113,11 @@ public class MockSMTPBehavior {
 }
 
 private final SMTPCommand smtpCommand;
-private final Optional condition;
+private final Condition condition;
 private final Response response;
 private final NumberOfAnswersPolicy numberOfAnswers;
 
-public MockSMTPBehavior(SMTPCommand smtpCommand, Optional 
condition, Response response, NumberOfAnswersPolicy numberOfAnswers) {
+public MockSMTPBehavior(SMTPCommand smtpCommand, Condition condition, 
Response response, NumberOfAnswersPolicy numberOfAnswers) {
 Preconditions.checkNotNull(smtpCommand);
 Preconditions.checkNotNull(condition);
 Preconditions.checkNotNull(response);
@@ -134,7 +133,7 @@ public class MockSMTPBehavior {
 return smtpCommand;
 }
 
-public Optional getCondition() {
+public Condition getCondition() {
 return condition;
 }
 
@@ -163,4 +162,14 @@ public class MockSMTPBehavior {
 public final int hashCode() {
 return Objects.hash(smtpCommand, condition, response, numberOfAnswers);
 }
+
+@Override
+public String toString() {
+return "MockSMTPBehavior{" +
+"smtpCommand=" + smtpCommand +
+", condition=" + condition +
+", response=" + response +
+", numberOfAnswers=" + numberOfAnswers +
+'}';
+}
 }
diff --git 
a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/Fixture.java
 
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/Fixture.java
index 3178766..fe1ff47 100644
--- 
a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/Fixture.java
+++ 
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/Fixture.java
@@ -19,8 +19,6 @@
 
 package org.apache.james.mock.smtp.server;
 
-import java.util.Optional;
-
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.datatype.guava.GuavaModule;
 import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
@@ -34,13 +32,14 @@ public interface Fixture {
 Response RESPONSE = Response.serverAccept(Response.SMTPStatusCode.of(250), 
"message");
 
 String JSON_BEHAVIOR_COMPULSORY_FIELDS = "{" +
+"  \"condition\": {\"operator\":\"matchAll\"}," +
 "  \"response\": {\"code\":250, \"message\":\"OK\", 
\"rejected\":false}," +
 "  \"command\": \"EHLO\"" +
 "}";
 
 MockSMTPBehavior BEHAVIOR_COMPULSORY_FIELDS = new MockSMTPBehavior(
 SMTPCommand.EHLO,
-Optional.empty(),
+Condition.MATCH_ALL,
 Response.serverAccept(Response.SMTPStatusCode.ACTION_COMPLETE_250, 
"OK"),
 MockSMTPBehavior.NumberOfAnswersPolicy.anytime());
 
@@ -53,7 +52,7 @@ public interface Fixture {
 
 MockSMTPBehavior BEHAVIOR_ALL_FIELDS = new MockSMTPBehavior(
 SMTPCommand.EHLO,
-Optional.of(new Condition.OperatorCondition(Operator.CONTAINS, 
"matchme")),
+new Condition.OperatorCondition(Operator.CONTAINS, "matchme"),
 Response.serverAccept(Response.SMTPStatusCode.of(250), "OK"),
 

[james-project] 03/17: JAMES-2855 Correct log4j-over-slf4j bridge

2019-08-27 Thread btellier
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 a37c7db23fd26b4ef3d7e93bf83990668c766b82
Author: Tran Tien Duc 
AuthorDate: Wed Aug 21 17:58:48 2019 +0700

JAMES-2855 Correct log4j-over-slf4j bridge

Instead of using slf4j-log4j which does it in the reverse way
---
 backends-common/elasticsearch/pom.xml  |  4 +-
 backends-common/rabbitmq/pom.xml   |  2 +-
 mailbox/plugin/quota-mailing/pom.xml   |  2 +-
 mailbox/tika/pom.xml   |  2 +-
 pom.xml|  5 ++
 protocols/api/pom.xml  |  4 +-
 server/app/pom.xml | 74 ++
 server/container/guice/es-metric-reporter/pom.xml  |  2 +-
 .../guice/mailbox-plugin-spamassassin/pom.xml  |  2 +-
 server/container/jetty/pom.xml |  2 +-
 server/container/lifecycle-api/pom.xml |  4 +-
 server/container/spring/pom.xml| 18 ++
 server/data/data-cassandra/pom.xml |  4 +-
 server/data/data-file/pom.xml  |  4 +-
 server/data/data-jdbc/pom.xml  |  4 +-
 server/data/data-jpa/pom.xml   |  4 +-
 server/data/data-ldap/pom.xml  | 14 ++--
 server/data/data-library/pom.xml   |  4 +-
 server/dns-service/dnsservice-dnsjava/pom.xml  |  4 +-
 server/mailet/mailetcontainer-camel/pom.xml|  2 +-
 server/protocols/fetchmail/pom.xml |  4 +-
 server/protocols/protocols-imap4/pom.xml   |  4 +-
 server/protocols/protocols-library/pom.xml |  4 +-
 server/protocols/protocols-lmtp/pom.xml|  4 +-
 server/protocols/protocols-managesieve/pom.xml |  4 +-
 server/protocols/protocols-pop3/pom.xml|  4 +-
 server/protocols/protocols-smtp/pom.xml|  4 +-
 third-party/linshare/pom.xml   |  4 +-
 28 files changed, 143 insertions(+), 50 deletions(-)

diff --git a/backends-common/elasticsearch/pom.xml 
b/backends-common/elasticsearch/pom.xml
index b68bd15..3c4c216 100644
--- a/backends-common/elasticsearch/pom.xml
+++ b/backends-common/elasticsearch/pom.xml
@@ -101,11 +101,11 @@
 
 
 org.slf4j
-slf4j-api
+log4j-over-slf4j
 
 
 org.slf4j
-slf4j-log4j12
+slf4j-api
 
 
 org.testcontainers
diff --git a/backends-common/rabbitmq/pom.xml b/backends-common/rabbitmq/pom.xml
index 61f1e78..48dd167 100644
--- a/backends-common/rabbitmq/pom.xml
+++ b/backends-common/rabbitmq/pom.xml
@@ -107,7 +107,7 @@
 
 
 org.slf4j
-slf4j-log4j12
+log4j-over-slf4j
 
 
 org.testcontainers
diff --git a/mailbox/plugin/quota-mailing/pom.xml 
b/mailbox/plugin/quota-mailing/pom.xml
index 682e405..0cdcaaf 100644
--- a/mailbox/plugin/quota-mailing/pom.xml
+++ b/mailbox/plugin/quota-mailing/pom.xml
@@ -138,7 +138,7 @@
 
 
 org.slf4j
-slf4j-log4j12
+log4j-over-slf4j
 
 
 
diff --git a/mailbox/tika/pom.xml b/mailbox/tika/pom.xml
index e967ba2..ca37f1c 100644
--- a/mailbox/tika/pom.xml
+++ b/mailbox/tika/pom.xml
@@ -126,7 +126,7 @@
 
 
 org.slf4j
-slf4j-log4j12
+log4j-over-slf4j
 
 
 org.testcontainers
diff --git a/pom.xml b/pom.xml
index 9245bba..507e013 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2510,6 +2510,11 @@
 
 
 org.slf4j
+log4j-over-slf4j
+${slf4j.version}
+
+
+org.slf4j
 slf4j-api
 ${slf4j.version}
 
diff --git a/protocols/api/pom.xml b/protocols/api/pom.xml
index 36c031f..fc187f1 100644
--- a/protocols/api/pom.xml
+++ b/protocols/api/pom.xml
@@ -61,11 +61,11 @@
 
 
 org.slf4j
-slf4j-api
+log4j-over-slf4j
 
 
 org.slf4j
-slf4j-log4j12
+slf4j-api
 
 
 
diff --git a/server/app/pom.xml b/server/app/pom.xml
index b783991..8f79651 100644
--- a/server/app/pom.xml
+++ b/server/app/pom.xml
@@ -159,6 +159,10 @@
 javax.mail
 mail
 
+
+org.slf4j
+log4j-over-slf4j
+
 
 
 
@@ -170,17 +174,33 @@
 javax.mail
 mail
 
+
+org.slf4j
+log4j-over-slf4j
+
 
   

[james-project] 05/17: JAMES-2866 JSON serialization for Condition

2019-08-27 Thread btellier
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 5a192d585c9a3ee26bdff2dc4a7501dbc87a77b5
Author: Benoit Tellier 
AuthorDate: Wed Aug 21 15:04:20 2019 +0700

JAMES-2866 JSON serialization for Condition
---
 server/mailet/mock-smtp-server/pom.xml |   5 +
 .../apache/james/mock/smtp/server/Condition.java   | 111 -
 .../apache/james/mock/smtp/server/Operator.java|  60 ++-
 .../james/mock/smtp/server/ConditionTest.java  |  95 +++---
 4 files changed, 232 insertions(+), 39 deletions(-)

diff --git a/server/mailet/mock-smtp-server/pom.xml 
b/server/mailet/mock-smtp-server/pom.xml
index 8db2a69..bdcbea7 100644
--- a/server/mailet/mock-smtp-server/pom.xml
+++ b/server/mailet/mock-smtp-server/pom.xml
@@ -50,6 +50,11 @@
 guava
 
 
+net.javacrumbs.json-unit
+json-unit-assertj
+test
+
+
 nl.jqno.equalsverifier
 equalsverifier
 test
diff --git 
a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/Condition.java
 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/Condition.java
index 422eea7..523794b 100644
--- 
a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/Condition.java
+++ 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/Condition.java
@@ -20,43 +20,106 @@
 package org.apache.james.mock.smtp.server;
 
 import java.util.Objects;
+import java.util.Optional;
 
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
 import com.google.common.base.Preconditions;
 
-class Condition {
+@JsonDeserialize(builder = Condition.Builder.class)
+interface Condition {
+@JsonPOJOBuilder(withPrefix = "")
+class Builder {
+private Operator.OperatorName operator;
+private Optional matchingValue;
 
-static final Condition MATCH_ALL = new Condition(Operator.MATCH_ALL, 
"any");
+public Builder() {
+this.matchingValue = Optional.empty();
+}
 
-private final Operator operator;
-private final String matchingValue;
+public Builder operator(Operator.OperatorName operator) {
+this.operator = operator;
+return this;
+}
 
-Condition(Operator operator, String matchingValue) {
-Preconditions.checkNotNull(operator);
-Preconditions.checkNotNull(matchingValue);
+public Builder matchingValue(String matchingValue) {
+this.matchingValue = Optional.of(matchingValue);
+return this;
+}
 
-this.operator = operator;
-this.matchingValue = matchingValue;
-}
+public Condition build() {
+Preconditions.checkState(operator != null, "You need to specify an 
operator");
 
-boolean matches(String line) {
-return operator.actual(line)
-.expected(matchingValue)
-.matches();
+return operator.getConditionFactory().apply(matchingValue);
+}
 }
 
-@Override
-public final boolean equals(Object o) {
-if (o instanceof Condition) {
-Condition condition = (Condition) o;
+class MatchAllCondition implements Condition {
+public Operator.OperatorName getOperator() {
+return Operator.OperatorName.MATCH_ALL;
+}
 
-return Objects.equals(this.operator, condition.operator)
-&& Objects.equals(this.matchingValue, condition.matchingValue);
+@Override
+public boolean matches(String line) {
+return true;
+}
+
+@Override
+public final boolean equals(Object o) {
+return o instanceof MatchAllCondition;
+}
+
+@Override
+public final int hashCode() {
+return Objects.hash(MatchAllCondition.class);
 }
-return false;
 }
 
-@Override
-public final int hashCode() {
-return Objects.hash(operator, matchingValue);
+class OperatorCondition implements Condition {
+private final Operator operator;
+private final String matchingValue;
+
+OperatorCondition(Operator operator, String matchingValue) {
+Preconditions.checkNotNull(operator);
+Preconditions.checkNotNull(matchingValue);
+
+this.operator = operator;
+this.matchingValue = matchingValue;
+}
+
+public Operator.OperatorName getOperator() {
+return operator.getOperatorName();
+}
+
+public String getMatchingValue() {
+return matchingValue;
+}
+
+@Override
+public boolean matches(String line) {
+return 

[james-project] branch master updated (d6ad1d2 -> 3d30d5a)

2019-08-27 Thread btellier
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git.


from d6ad1d2  JAMES-2864 Replace Optional by Condition with 
MATCH_ALL capability
 new 7778b79  JAMES-2854 Upgrade to OpenJDK 8u222 JRE base image
 new 7478399  JAMES-2855 Upgrade ruby to 2.6.3 in Homepage Dockerfile
 new a37c7db  JAMES-2855 Correct log4j-over-slf4j bridge
 new 7263450  JAMES-2866 JSON serialization for SMTPCommand
 new 5a192d5  JAMES-2866 JSON serialization for Condition
 new d1ccaad  JAMES-2866 JSON serialization for Response
 new ff6e5e8  JAMES-2866 JSON serialization for MockSMTPBehavior
 new 0f02246  JAMES-2866 MockSMTPBehaviors POJO
 new 1f02792  JAMES-2866 Store SMTP behaviors
 new c882f4a  JAMES-2866 Manage MockSmtp configuration over Http (Jetty)
 new b2f0789  JAMES-2866 Avoid relying on Optional now that we have the 
matchAll condition
 new d476c69  JAMES-2855 Upgrade to Junit 5.5.1
 new c1e3542  JAMES-2855 Upgrade surefire plugin to 2.22.2
 new ede4985  JAMES-2855 Add missing junit-platform-launcher dependency to 
poms
 new a2b069c  JAMES-2855 @RegisterExtension fields cannot be private
 new 1da0096  JAMES-2593 Use distributed james image in docker-compose
 new 3d30d5a  JAMES-2593 expose webadmin port in docker-compose

The 17 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 backends-common/elasticsearch/pom.xml  |   4 +-
 backends-common/rabbitmq/pom.xml   |   2 +-
 dockerfiles/run/docker-compose.yml |   3 +-
 dockerfiles/run/guice/cassandra-ldap/Dockerfile|   2 +-
 .../run/guice/cassandra-rabbitmq-ldap/Dockerfile   |   2 +-
 .../run/guice/cassandra-rabbitmq/Dockerfile|   2 +-
 dockerfiles/run/guice/cassandra/Dockerfile |   2 +-
 dockerfiles/run/guice/jpa-smtp/Dockerfile  |   2 +-
 dockerfiles/run/guice/jpa/Dockerfile   |   2 +-
 dockerfiles/run/guice/memory/Dockerfile|   2 +-
 dockerfiles/run/spring/Dockerfile  |   2 +-
 dockerfiles/site/homepage/Dockerfile   |   2 +-
 examples/custom-listeners/pom.xml  |   5 +
 mailbox/caching/pom.xml|   5 +
 mailbox/event/json/pom.xml |   5 +
 mailbox/plugin/quota-mailing/pom.xml   |   2 +-
 mailbox/tika/pom.xml   |   2 +-
 mpt/impl/managesieve/core/pom.xml  |   4 +
 pom.xml|  27 ++--
 protocols/api/pom.xml  |   4 +-
 server/app/pom.xml |  74 +++
 server/blob/blob-export-api/pom.xml|   5 +
 server/container/guice/blob-export-guice/pom.xml   |   5 +
 .../guice/cassandra-rabbitmq-ldap-guice/pom.xml|   5 +
 server/container/guice/configuration/pom.xml   |   5 +
 server/container/guice/es-metric-reporter/pom.xml  |   2 +-
 server/container/guice/guice-common/pom.xml|   5 +
 server/container/guice/jpa-common-guice/pom.xml|   5 +
 .../guice/mailbox-plugin-spamassassin/pom.xml  |   2 +-
 server/container/guice/mailbox/pom.xml |   5 +
 server/container/guice/memory-guice/pom.xml|   5 +
 server/container/jetty/pom.xml |   2 +-
 server/container/lifecycle-api/pom.xml |   9 +-
 server/container/spring/pom.xml|  18 +++
 server/data/data-cassandra/pom.xml |   4 +-
 server/data/data-file/pom.xml  |   4 +-
 server/data/data-jdbc/pom.xml  |   4 +-
 server/data/data-jmap-cassandra/pom.xml|  13 +-
 server/data/data-jmap/pom.xml  |   5 +
 server/data/data-jpa/pom.xml   |   4 +-
 server/data/data-ldap/pom.xml  |  14 +-
 server/data/data-library/pom.xml   |   4 +-
 server/dns-service/dnsservice-dnsjava/pom.xml  |   4 +-
 server/mailet/mailetcontainer-camel/pom.xml|   2 +-
 server/mailet/mock-smtp-server/pom.xml |  39 ++
 .../apache/james/mock/smtp/server/Condition.java   | 111 
 .../mock/smtp/server/HTTPConfigurationServer.java  | 110 +++
 .../james/mock/smtp/server/MockSMTPBehavior.java   |  70 +-
 .../james/mock/smtp/server/MockSmtpBehaviors.java} |  29 ++--
 .../apache/james/mock/smtp/server/Operator.java|  60 -
 .../apache/james/mock/smtp/server/Response.java|  29 +++-
 .../{Operator.java => SMTPBehaviorRepository.java} |  25 ++--
 .../apache/james/mock/smtp/server/SMTPCommand.java |  18 +++
 

[james-project] 09/17: JAMES-2866 Store SMTP behaviors

2019-08-27 Thread btellier
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 1f027922ef53485858c7d3d4e63b3def8c812b2e
Author: Benoit Tellier 
AuthorDate: Wed Aug 21 16:13:55 2019 +0700

JAMES-2866 Store SMTP behaviors
---
 .../mock/smtp/server/SMTPBehaviorRepository.java   | 43 ++
 .../mock/smtp/server/MockSmtpBehaviorsTest.java|  2 +-
 .../smtp/server/SMTPBehaviorRepositoryTest.java| 68 ++
 3 files changed, 112 insertions(+), 1 deletion(-)

diff --git 
a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/SMTPBehaviorRepository.java
 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/SMTPBehaviorRepository.java
new file mode 100644
index 000..23084cd
--- /dev/null
+++ 
b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/SMTPBehaviorRepository.java
@@ -0,0 +1,43 @@
+/
+ * 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.mock.smtp.server;
+
+import java.util.Optional;
+import java.util.concurrent.atomic.AtomicReference;
+
+public class SMTPBehaviorRepository {
+private final AtomicReference behaviors;
+
+public SMTPBehaviorRepository() {
+this.behaviors = new AtomicReference<>();
+}
+
+public Optional getBehaviors() {
+return Optional.ofNullable(this.behaviors.get());
+}
+
+public void clearBehaviors() {
+this.behaviors.set(null);
+}
+
+public void setBehaviors(MockSmtpBehaviors behaviors) {
+this.behaviors.set(behaviors);
+}
+}
diff --git 
a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/MockSmtpBehaviorsTest.java
 
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/MockSmtpBehaviorsTest.java
index 83ffaaf..8507a0f 100644
--- 
a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/MockSmtpBehaviorsTest.java
+++ 
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/MockSmtpBehaviorsTest.java
@@ -41,7 +41,7 @@ class MockSmtpBehaviorsTest {
 private static final String JSON = "[" + 
MockSMTPBehaviorTest.JSON_ALL_FIELDS + ", "
 + MockSMTPBehaviorTest.JSON_COMPULSORY_FIELDS + "]";
 
-private static final MockSmtpBehaviors POJO = new 
MockSmtpBehaviors(ImmutableList.of(
+static final MockSmtpBehaviors POJO = new 
MockSmtpBehaviors(ImmutableList.of(
 MockSMTPBehaviorTest.POJO_ALL_FIELDS,
 MockSMTPBehaviorTest.POJO_COMPULSORY_FIELDS));
 
diff --git 
a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/SMTPBehaviorRepositoryTest.java
 
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/SMTPBehaviorRepositoryTest.java
new file mode 100644
index 000..0ce87f0
--- /dev/null
+++ 
b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/SMTPBehaviorRepositoryTest.java
@@ -0,0 +1,68 @@
+/
+ * 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