[jira] [Commented] (JAMES-3168) Integration tests with echo method

2020-05-17 Thread Jira


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

René Cordier commented on JAMES-3168:
-

https://github.com/linagora/james-project/pull/3353 contributed to add 
integration tests with echo method

> Integration tests with echo method
> --
>
> Key: JAMES-3168
> URL: https://issues.apache.org/jira/browse/JAMES-3168
> Project: James Server
>  Issue Type: New Feature
>Reporter: Nguyễn Việt Đức
>Priority: Major
>
> Integration test for echo method with memory + distributed james backend
> Guice bindings for Jmap Routes of new version
> smoke testing
> Scala and junit 5 and assertj and restassured



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Commented] (JAMES-3140) Provide a CachedDumbBlobStore

2020-05-17 Thread Jira


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

René Cordier commented on JAMES-3140:
-

https://github.com/linagora/james-project/pull/3378 contributed to relocate 
Cassandra backend cassandra.properties file

> Provide a CachedDumbBlobStore
> -
>
> Key: JAMES-3140
> URL: https://issues.apache.org/jira/browse/JAMES-3140
> Project: James Server
>  Issue Type: Improvement
>Reporter: René Cordier
>Priority: Major
>
> {{This DumbBlobStore wraps another dumbBlobStore and compose it with a 
> Cache.}}
> Blobs are cached upon writes
> Only blobs of the default bucket are cached.
> Upon reads:
>  * the cache is queried
>  * if the cache is empty then load it's value from the blobStore
>  * and populate the cache
> Provide guice bindings in james-distributed guice product:
>  * configure CassandraBlobStoreCache
>  * enable caching if {{blobStore.cache.enabled=true}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[james-project] 05/06: JAMES-3168: Use assertJ for json assertion in EchoMethod test

2020-05-17 Thread rcordier
This is an automated email from the ASF dual-hosted git repository.

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

commit 8b87d4505de2325ced264177d238b929dfd37f34
Author: duc91 
AuthorDate: Mon May 11 17:12:41 2020 +0700

JAMES-3168: Use assertJ for json assertion in EchoMethod test
---
 server/protocols/jmap-rfc-8621/pom.xml |   8 +-
 .../james/jmap/routes/JMAPApiRoutesTest.scala  | 157 +++--
 2 files changed, 118 insertions(+), 47 deletions(-)

diff --git a/server/protocols/jmap-rfc-8621/pom.xml 
b/server/protocols/jmap-rfc-8621/pom.xml
index 9f2d220..ba30cd2 100644
--- a/server/protocols/jmap-rfc-8621/pom.xml
+++ b/server/protocols/jmap-rfc-8621/pom.xml
@@ -17,7 +17,8 @@
 specific language governing permissions and limitations
 under the License.
 -->
-http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
 4.0.0
 
 
@@ -83,6 +84,11 @@
 test
 
 
+net.javacrumbs.json-unit
+json-unit-assertj
+test
+
+
 org.mockito
 mockito-core
 test
diff --git 
a/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/routes/JMAPApiRoutesTest.scala
 
b/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/routes/JMAPApiRoutesTest.scala
index 4301319..004529b 100644
--- 
a/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/routes/JMAPApiRoutesTest.scala
+++ 
b/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/routes/JMAPApiRoutesTest.scala
@@ -1,4 +1,4 @@
-/** **
+/
  * 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*
@@ -6,16 +6,16 @@
  * 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 *
- * *
+ *  *
+ *   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.jmap.routes
 
 import java.nio.charset.StandardCharsets
@@ -27,11 +27,9 @@ import io.restassured.builder.RequestSpecBuilder
 import io.restassured.config.EncoderConfig.encoderConfig
 import io.restassured.config.RestAssuredConfig.newConfig
 import io.restassured.http.ContentType
+import net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson
 import org.apache.http.HttpStatus
 import org.apache.james.jmap.JMAPUrls.JMAP
-import org.apache.james.jmap.json.Fixture._
-import org.apache.james.jmap.json.Serializer
-import org.apache.james.jmap.model.RequestObject
 import org.apache.james.jmap.{JMAPConfiguration, JMAPRoutesHandler, 
JMAPServer, Version, VersionParser}
 import org.scalatest.BeforeAndAfter
 import org.scalatest.flatspec.AnyFlatSpec
@@ -48,13 +46,80 @@ class JMAPApiRoutesTest extends AnyFlatSpec with 
BeforeAndAfter with Matchers {
   private val ROUTES_HANDLER: ImmutableSet[JMAPRoutesHandler] = 
ImmutableSet.of(new JMAPRoutesHandler(Version.RFC8621, JMAP_API_ROUTE))
 
   private val REQUEST_OBJECT: String =
-new Serializer().serialize(RequestObject(Seq(coreIdentifier), 
Seq(invocation1))).toString()
-
+"""{
+  |  "using": [
+  |"urn:ietf:params:jmap:core"
+  |  ],
+  |  "methodCalls": [
+  |[
+  |  "Core/echo",
+  |  {
+  |"arg1": "arg1data",
+  |"arg2": "arg2data"
+  |  },
+  |  "c1"
+  |]
+  |  ]
+  |}""".stripMargin
   private val REQUEST_OBJECT_WITH_UNSUPPORTED_METHOD: String =
-new Serializer().serialize(RequestObject(Seq(coreIdentifier), 
Seq(invocation1, 

[james-project] 04/06: JAMES-3168: Guice binding for JMAP-RFC8621, use jmap project everywhere to support both -draft and -rfc8621 implementations

2020-05-17 Thread rcordier
This is an automated email from the ASF dual-hosted git repository.

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

commit dccd616fe4f3b1e8f0d169936d1f493fff4ad8ef
Author: duc91 
AuthorDate: Mon May 11 17:08:44 2020 +0700

JAMES-3168: Guice binding for JMAP-RFC8621, use jmap project everywhere to 
support both -draft and -rfc8621 implementations
---
 .../smtp/cassandra-rabbitmq-object-storage/pom.xml |  2 +-
 mpt/impl/smtp/cassandra/pom.xml|  2 +-
 pom.xml|  4 +-
 server/container/cli-integration/pom.xml   |  2 +-
 server/container/guice/cassandra-guice/pom.xml |  4 +-
 .../org/apache/james/CassandraJamesServerMain.java |  4 +-
 .../container/guice/cassandra-ldap-guice/pom.xml   |  2 +-
 .../guice/cassandra-rabbitmq-guice/pom.xml |  2 +-
 .../guice/cassandra-rabbitmq-ldap-guice/pom.xml|  2 +-
 server/container/guice/memory-guice/pom.xml|  4 +-
 .../org/apache/james/MemoryJamesServerMain.java|  4 +-
 server/container/guice/pom.xml |  8 ++--
 .../guice/protocols/{jmap-draft => jmap}/pom.xml   | 10 +++--
 .../james/jmap/draft/DraftMethodsModule.java}  |  2 +-
 .../apache/james/jmap/draft/JMAPCommonModule.java  |  0
 .../jmap/draft/JMAPConfigurationStartUpCheck.java  |  0
 .../org/apache/james/jmap/draft/JMAPModule.java|  5 ++-
 .../apache/james/jmap/draft/JmapGuiceProbe.java|  0
 .../apache/james/jmap/draft/MessageIdProbe.java|  0
 .../james/jmap/rfc8621/RFC8621MethodsModule.java   | 45 ++
 .../james/modules/protocols/JMAPServerModule.java} |  2 +-
 .../main/resources/defaultJmapMailetContainer.xml  |  0
 .../apache/james/jmap/draft/JMAPModuleTest.java|  0
 .../james/jmap/draft/JmapJamesServerContract.java  |  1 -
 .../james/jmap/draft/MailetPreconditionTest.java   |  1 -
 .../apache/james/modules/TestJMAPServerModule.java |  0
 server/mailet/integration-testing/pom.xml  |  2 +-
 .../pom.xml|  2 +-
 .../jmap-draft-integration-testing-common/pom.xml  |  2 +-
 .../memory-jmap-draft-integration-testing/pom.xml  |  2 +-
 .../pom.xml|  2 +-
 .../webadmin-integration-test-common/pom.xml   |  4 +-
 32 files changed, 85 insertions(+), 35 deletions(-)

diff --git a/mpt/impl/smtp/cassandra-rabbitmq-object-storage/pom.xml 
b/mpt/impl/smtp/cassandra-rabbitmq-object-storage/pom.xml
index 267cc92..d4ce24f 100644
--- a/mpt/impl/smtp/cassandra-rabbitmq-object-storage/pom.xml
+++ b/mpt/impl/smtp/cassandra-rabbitmq-object-storage/pom.xml
@@ -95,7 +95,7 @@
 
 
 ${james.groupId}
-james-server-guice-jmap-draft
+james-server-guice-jmap
 test-jar
 test
 
diff --git a/mpt/impl/smtp/cassandra/pom.xml b/mpt/impl/smtp/cassandra/pom.xml
index 8414055..0fefef4 100644
--- a/mpt/impl/smtp/cassandra/pom.xml
+++ b/mpt/impl/smtp/cassandra/pom.xml
@@ -59,7 +59,7 @@
 
 
 ${james.groupId}
-james-server-guice-jmap-draft
+james-server-guice-jmap
 test-jar
 test
 
diff --git a/pom.xml b/pom.xml
index 413a1ad..94adf21 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1479,12 +1479,12 @@
 
 
 ${james.groupId}
-james-server-guice-jmap-draft
+james-server-guice-jmap
 ${project.version}
 
 
 ${james.groupId}
-james-server-guice-jmap-draft
+james-server-guice-jmap
 ${project.version}
 test-jar
 
diff --git a/server/container/cli-integration/pom.xml 
b/server/container/cli-integration/pom.xml
index dafe9c2..8084fda 100644
--- a/server/container/cli-integration/pom.xml
+++ b/server/container/cli-integration/pom.xml
@@ -50,7 +50,7 @@
 
 
 ${james.groupId}
-james-server-guice-jmap-draft
+james-server-guice-jmap
 test-jar
 test
 
diff --git a/server/container/guice/cassandra-guice/pom.xml 
b/server/container/guice/cassandra-guice/pom.xml
index 4c277fa..8526e09 100644
--- a/server/container/guice/cassandra-guice/pom.xml
+++ b/server/container/guice/cassandra-guice/pom.xml
@@ -174,11 +174,11 @@
 
 
 ${james.groupId}
-james-server-guice-jmap-draft
+james-server-guice-jmap
 
 
 ${james.groupId}
-james-server-guice-jmap-draft
+james-server-guice-jmap
 test-jar
 test
 
diff --git 
a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
 

[james-project] 03/06: JAMES-3168: Add integration test for EchoMethod

2020-05-17 Thread rcordier
This is an automated email from the ASF dual-hosted git repository.

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

commit 5bfbea1ca99bb62ee2a89978c933bff85d22f773
Author: duc91 
AuthorDate: Mon May 11 17:06:07 2020 +0700

JAMES-3168: Add integration test for EchoMethod
---
 server/container/guice/pom.xml |   5 +
 server/pom.xml |   3 +-
 .../jmap-rfc-8621-integration-tests-common/pom.xml |  69 +
 .../jmap/rfc8621/contract/EchoMethodContract.scala | 167 +
 .../memory-jmap-rfc-8621-integration-tests/pom.xml |  58 +++
 .../jmap/rfc8621/memory/MemoryEchoMethodTest.java  |  39 +
 .../src/test/resources/dnsservice.xml  |  29 
 .../src/test/resources/domainlist.xml  |  24 +++
 .../src/test/resources/imapserver.xml  |  39 +
 .../src/test/resources/keystore| Bin 0 -> 2245 bytes
 .../src/test/resources/listeners.xml   |  46 ++
 .../src/test/resources/lmtpserver.xml  |  23 +++
 .../src/test/resources/mailetcontainer.xml | 132 
 .../src/test/resources/mailrepositorystore.xml |  30 
 .../src/test/resources/managesieveserver.xml   |  32 
 .../src/test/resources/pop3server.xml  |  23 +++
 .../src/test/resources/smtpserver.xml  |  48 ++
 .../jmap-rfc-8621-integration-tests/pom.xml|  65 
 18 files changed, 831 insertions(+), 1 deletion(-)

diff --git a/server/container/guice/pom.xml b/server/container/guice/pom.xml
index af004d3..6586449 100644
--- a/server/container/guice/pom.xml
+++ b/server/container/guice/pom.xml
@@ -221,6 +221,11 @@
 
 
 ${james.groupId}
+james-server-jmap-rfc-8621
+${project.version}
+
+
+${james.groupId}
 james-server-jpa-smtp-common-guice
 ${project.version}
 
diff --git a/server/pom.xml b/server/pom.xml
index c5b8efa..a152c6a 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -85,8 +85,9 @@
 protocols/fetchmail
 protocols/jmap
 protocols/jmap-draft
-protocols/jmap-rfc-8621
 protocols/jmap-draft-integration-testing
+protocols/jmap-rfc-8621
+protocols/jmap-rfc-8621-integration-tests
 protocols/jwt
 protocols/protocols-imap4
 protocols/protocols-library
diff --git 
a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/pom.xml
 
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/pom.xml
new file mode 100644
index 000..3cedba7
--- /dev/null
+++ 
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/pom.xml
@@ -0,0 +1,69 @@
+
+
+http://maven.apache.org/POM/4.0.0;
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+
+jmap-rfc-8621-integration-tests
+org.apache.james
+3.6.0-SNAPSHOT
+
+
+4.0.0
+jmap-rfc-8621-integration-tests-common
+JMAP RFC-8621 integration test suite common to all 
products
+Apache James :: Server :: JMAP RFC-8621 :: Contract for Integration 
Testing
+
+
+
+${james.groupId}
+james-server-guice-common
+
+
+${james.groupId}
+james-server-guice-jmap
+
+
+${james.groupId}
+testing-base
+
+
+com.typesafe.play
+play-json_${scala.base}
+
+
+io.rest-assured
+rest-assured
+
+
+net.javacrumbs.json-unit
+json-unit-assertj
+
+
+
+
+
+
+net.alchim31.maven
+scala-maven-plugin
+
+
+
+
\ No newline at end of file
diff --git 
a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EchoMethodContract.scala
 
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EchoMethodContract.scala
new file mode 100644
index 000..4c960ee
--- /dev/null
+++ 
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EchoMethodContract.scala
@@ -0,0 +1,167 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for 

[james-project] 01/06: JAMES-3140 Relocate Cassandra backend cassandra.properties file

2020-05-17 Thread rcordier
This is an automated email from the ASF dual-hosted git repository.

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

commit 24fd2c4a40e19b8447e556a29a5fe021abcbe272
Author: Benoit Tellier 
AuthorDate: Tue May 12 11:13:41 2020 +0700

JAMES-3140 Relocate Cassandra backend cassandra.properties file

This file was used for testing parsing and was fed with meaningless
values.

However integration tests were relying on it instead of Cassandra
configuration defaults, leading to '2' retries only being performed
upon concurrent modseq generation.

Note that this is actually the cause of random failure within
MailsShouldBeWellReceived::oneHundredMailsShouldBeWellReceived
---
 .../backends/cassandra/init/CassandraConfigurationReadingTest.java  | 2 +-
 .../test/resources/{ => configuration-reader-test}/cassandra.properties | 0
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/CassandraConfigurationReadingTest.java
 
b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/CassandraConfigurationReadingTest.java
index da60e9b..a6f5995 100644
--- 
a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/CassandraConfigurationReadingTest.java
+++ 
b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/CassandraConfigurationReadingTest.java
@@ -43,7 +43,7 @@ class CassandraConfigurationReadingTest {
 FileBasedConfigurationBuilder builder = new 
FileBasedConfigurationBuilder(PropertiesConfiguration.class)
 .configure(new Parameters()
 .fileBased()
-
.setURL(ClassLoader.getSystemResource("cassandra.properties")));
+
.setURL(ClassLoader.getSystemResource("configuration-reader-test/cassandra.properties")));
 
 CassandraConfiguration configuration = 
CassandraConfiguration.from(builder.getConfiguration());
 
diff --git a/backends-common/cassandra/src/test/resources/cassandra.properties 
b/backends-common/cassandra/src/test/resources/configuration-reader-test/cassandra.properties
similarity index 100%
rename from backends-common/cassandra/src/test/resources/cassandra.properties
rename to 
backends-common/cassandra/src/test/resources/configuration-reader-test/cassandra.properties


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



[james-project] branch master updated (f67aeee -> 4edb31b)

2020-05-17 Thread rcordier
This is an automated email from the ASF dual-hosted git repository.

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


from f67aeee  JAMES-3183 adds X-Originating-IP in network mailet matcher
 new 24fd2c4  JAMES-3140 Relocate Cassandra backend cassandra.properties 
file
 new 009c2b4  JAMES-3140 Fix ModSeq::toString
 new 5bfbea1  JAMES-3168: Add integration test for EchoMethod
 new dccd616  JAMES-3168: Guice binding for JMAP-RFC8621, use jmap project 
everywhere to support both -draft and -rfc8621 implementations
 new 8b87d45  JAMES-3168: Use assertJ for json assertion in EchoMethod test
 new 4edb31b  JAMES-3168: remove unused property 'message_limit' for 
integration testing jmap rfc after rebase

The 6 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:
 .../init/CassandraConfigurationReadingTest.java|   2 +-
 .../cassandra.properties   |   0
 .../main/java/org/apache/james/mailbox/ModSeq.java |   5 +-
 .../smtp/cassandra-rabbitmq-object-storage/pom.xml |   2 +-
 mpt/impl/smtp/cassandra/pom.xml|   2 +-
 pom.xml|   4 +-
 server/container/cli-integration/pom.xml   |   2 +-
 server/container/guice/cassandra-guice/pom.xml |   4 +-
 .../org/apache/james/CassandraJamesServerMain.java |   4 +-
 .../container/guice/cassandra-ldap-guice/pom.xml   |   2 +-
 .../guice/cassandra-rabbitmq-guice/pom.xml |   2 +-
 .../guice/cassandra-rabbitmq-ldap-guice/pom.xml|   2 +-
 server/container/guice/memory-guice/pom.xml|   4 +-
 .../org/apache/james/MemoryJamesServerMain.java|   4 +-
 server/container/guice/pom.xml |  13 +-
 .../guice/protocols/{jmap-draft => jmap}/pom.xml   |  10 +-
 .../james/jmap/draft/DraftMethodsModule.java}  |   2 +-
 .../apache/james/jmap/draft/JMAPCommonModule.java  |   0
 .../jmap/draft/JMAPConfigurationStartUpCheck.java  |   0
 .../org/apache/james/jmap/draft/JMAPModule.java|   5 +-
 .../apache/james/jmap/draft/JmapGuiceProbe.java|   0
 .../apache/james/jmap/draft/MessageIdProbe.java|   0
 .../james/jmap/rfc8621/RFC8621MethodsModule.java}  |  29 ++--
 .../james/modules/protocols/JMAPServerModule.java} |   2 +-
 .../main/resources/defaultJmapMailetContainer.xml  |   0
 .../apache/james/jmap/draft/JMAPModuleTest.java|   0
 .../james/jmap/draft/JmapJamesServerContract.java  |   1 -
 .../james/jmap/draft/MailetPreconditionTest.java   |   1 -
 .../apache/james/modules/TestJMAPServerModule.java |   0
 server/mailet/integration-testing/pom.xml  |   2 +-
 server/pom.xml |   3 +-
 .../pom.xml|   2 +-
 .../jmap-draft-integration-testing-common/pom.xml  |   2 +-
 .../memory-jmap-draft-integration-testing/pom.xml  |   2 +-
 .../pom.xml|   2 +-
 .../pom.xml|  47 +++---
 .../jmap/rfc8621/contract/EchoMethodContract.scala | 167 +
 .../pom.xml|  44 +++---
 .../jmap/rfc8621/memory/MemoryEchoMethodTest.java} |  20 +--
 .../src/test/resources/dnsservice.xml  |   0
 .../src/test/resources/domainlist.xml  |   0
 .../src/test/resources/imapserver.xml  |  19 +--
 .../src/test/resources/keystore| Bin
 .../src/test/resources/listeners.xml   |   0
 .../src/test/resources/lmtpserver.xml  |   0
 .../src/test/resources/mailetcontainer.xml |   0
 .../src/test/resources/mailrepositorystore.xml |   0
 .../src/test/resources/managesieveserver.xml   |   0
 .../src/test/resources/pop3server.xml  |   0
 .../src/test/resources/smtpserver.xml  |   0
 .../jmap-rfc-8621-integration-tests}/pom.xml   |  39 ++---
 server/protocols/jmap-rfc-8621/pom.xml |   8 +-
 .../james/jmap/routes/JMAPApiRoutesTest.scala  | 157 +--
 .../webadmin-integration-test-common/pom.xml   |   4 +-
 54 files changed, 430 insertions(+), 190 deletions(-)
 rename backends-common/cassandra/src/test/resources/{ => 
configuration-reader-test}/cassandra.properties (100%)
 rename server/container/guice/protocols/{jmap-draft => jmap}/pom.xml (89%)
 rename 
server/container/guice/protocols/{jmap-draft/src/main/java/org/apache/james/jmap/draft/MethodsModule.java
 => jmap/src/main/java/org/apache/james/jmap/draft/DraftMethodsModule.java} 
(98%)
 rename server/container/guice/protocols/{jmap-draft => 
jmap}/src/main/java/org/apache/james/jmap/draft/JMAPCommonModule.java (100%)
 rename server/container/guice/protocols/{jmap-draft => 

[james-project] 02/06: JAMES-3140 Fix ModSeq::toString

2020-05-17 Thread rcordier
This is an automated email from the ASF dual-hosted git repository.

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

commit 009c2b49a6233c2073743b08e3a0f49c6f0af115
Author: Benoit Tellier 
AuthorDate: Tue May 12 11:15:05 2020 +0700

JAMES-3140 Fix ModSeq::toString
---
 mailbox/api/src/main/java/org/apache/james/mailbox/ModSeq.java | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mailbox/api/src/main/java/org/apache/james/mailbox/ModSeq.java 
b/mailbox/api/src/main/java/org/apache/james/mailbox/ModSeq.java
index 22cfb62..62640c5 100644
--- a/mailbox/api/src/main/java/org/apache/james/mailbox/ModSeq.java
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/ModSeq.java
@@ -19,6 +19,7 @@
 
 package org.apache.james.mailbox;
 
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Objects;
 import com.google.common.base.Preconditions;
 
@@ -74,6 +75,8 @@ public class ModSeq implements Comparable {
 
 @Override
 public String toString() {
-return "ModSeq{uid=" + modSeq + "}";
+return MoreObjects.toStringHelper(this)
+.add("value", modSeq)
+.toString();
 }
 }


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



[james-project] 06/06: JAMES-3168: remove unused property 'message_limit' for integration testing jmap rfc after rebase

2020-05-17 Thread rcordier
This is an automated email from the ASF dual-hosted git repository.

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

commit 4edb31b8291341a109e8625676cd41cd6b4793b8
Author: ducnv 
AuthorDate: Sun May 17 16:53:00 2020 +0700

JAMES-3168: remove unused property 'message_limit' for integration testing 
jmap rfc after rebase
---
 .../james/jmap/rfc8621/memory/MemoryEchoMethodTest.java   |  3 +--
 .../src/test/resources/imapserver.xml | 15 ---
 2 files changed, 1 insertion(+), 17 deletions(-)

diff --git 
a/server/protocols/jmap-rfc-8621-integration-tests/memory-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/memory/MemoryEchoMethodTest.java
 
b/server/protocols/jmap-rfc-8621-integration-tests/memory-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/memory/MemoryEchoMethodTest.java
index 7108a6b..f7aa3c7 100644
--- 
a/server/protocols/jmap-rfc-8621-integration-tests/memory-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/memory/MemoryEchoMethodTest.java
+++ 
b/server/protocols/jmap-rfc-8621-integration-tests/memory-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/memory/MemoryEchoMethodTest.java
@@ -20,7 +20,6 @@
 package org.apache.james.jmap.rfc8621.memory;
 
 import static 
org.apache.james.MemoryJamesServerMain.IN_MEMORY_SERVER_AGGREGATE_MODULE;
-import static 
org.apache.james.modules.TestJMAPServerModule.LIMIT_TO_20_MESSAGES;
 
 import org.apache.james.GuiceJamesServer;
 import org.apache.james.JamesServerBuilder;
@@ -34,6 +33,6 @@ public class MemoryEchoMethodTest implements 
EchoMethodContract {
 static JamesServerExtension testExtension = new JamesServerBuilder()
 .server(configuration -> 
GuiceJamesServer.forConfiguration(configuration)
 .combineWith(IN_MEMORY_SERVER_AGGREGATE_MODULE)
-
.overrideWith(TestJMAPServerModule.maximumMessages(LIMIT_TO_20_MESSAGES)))
+.overrideWith(new TestJMAPServerModule()))
 .build();
 }
diff --git 
a/server/protocols/jmap-rfc-8621-integration-tests/memory-jmap-rfc-8621-integration-tests/src/test/resources/imapserver.xml
 
b/server/protocols/jmap-rfc-8621-integration-tests/memory-jmap-rfc-8621-integration-tests/src/test/resources/imapserver.xml
index aa7c2fb..ead2b34 100644
--- 
a/server/protocols/jmap-rfc-8621-integration-tests/memory-jmap-rfc-8621-integration-tests/src/test/resources/imapserver.xml
+++ 
b/server/protocols/jmap-rfc-8621-integration-tests/memory-jmap-rfc-8621-integration-tests/src/test/resources/imapserver.xml
@@ -21,19 +21,4 @@ under the License.
 
 
 
-
-imapserver
-0.0.0.0:0
-200
-
-
-file://conf/keystore
-james72laBalle
-
org.bouncycastle.jce.provider.BouncyCastleProvider
-
-0
-0
-
 


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



[jira] [Created] (JAMES-3184) Concurrency for consistency tasks

2020-05-17 Thread Lan Khuat (Jira)
Lan Khuat created JAMES-3184:


 Summary: Concurrency for consistency tasks
 Key: JAMES-3184
 URL: https://issues.apache.org/jira/browse/JAMES-3184
 Project: James Server
  Issue Type: Improvement
Reporter: Lan Khuat


We currently limit concurrency of consistency tasks to 1 in order to avoid 
unbounded concurrency.

When running a consistency task, an admin should be able to precise the 
concurrency he wishes to use.

To do so, each task will expose (optional) concurrency parameters, that an 
admin can provide via query parameters of the corresponding webadmin endpoints. 
 * RecomputeUserFastViewProjectionItems
 * RecomputeCurrentQuotas
 * RecomputeMailboxCounters
 * SolveMailboxInconsistencies
 * SolveMessageInconsistencies
 * FullReindexing
 * UserReindexing
 * SingleMailboxReindexing
 * ErrorRecoveryReindexation



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Commented] (JAMES-1541) James won't start when Tarpit is active - TarpitHandler not found

2020-05-17 Thread Christian Knecht (Jira)


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

Christian Knecht commented on JAMES-1541:
-

It seems the class is still missing in V3.3 and even V3.4.

Any chance this gets put back in?

Thanks.

> James won't start when Tarpit is active - TarpitHandler not found
> -
>
> Key: JAMES-1541
> URL: https://issues.apache.org/jira/browse/JAMES-1541
> Project: James Server
>  Issue Type: Bug
>  Components: James Core
>Affects Versions: 3.0-beta4, 3.0.0-beta5
> Environment: Ubuntu 12.04
>Reporter: Shahar Davidson
>Priority: Major
>
> I deployed james-server-app-3.0.0-beta5-20140130.003646-329-app.tar.gz.
> Uncommented the tarpit handler in smtpserver.xml and started the server.
> Server fails to start due to the following exception:
> INFO   | jvm 1| 2014/02/03 23:27:10 | WrapperSimpleApp: Encountered an 
> error running main: org.springframework.beans.factory.BeanCreationException: 
> Error creating b
> ean with name 'smtpserver': Invocation of init method failed; nested 
> exception is 
> org.apache.james.protocols.lib.handler.ProtocolHandlerLoader$LoadingException:
>  Unable
> to load handler
> INFO   | jvm 1| 2014/02/03 23:27:10 | 
> org.springframework.beans.factory.BeanCreationException: Error creating bean 
> with name 'smtpserver': Invocation of init method
>  failed; nested exception is 
> org.apache.james.protocols.lib.handler.ProtocolHandlerLoader$LoadingException:
>  Unable to load handler
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(I
> nitDestroyAnnotationBeanPostProcessor.java:135)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitializat
> ion(AbstractAutowireCapableBeanFactory.java:394)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBe
> anFactory.java:1448)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBean
> Factory.java:519)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFa
> ctory.java:456)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java
> :225)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFact
> ory.java:609)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationCon
> text.java:918)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.apache.james.container.spring.context.JamesServerApplicationContext.(JamesServerApplicationContext.java:39)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.apache.james.app.spring.JamesAppSpringMain.init(JamesAppSpringMain.java:61)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> org.apache.james.app.spring.JamesAppSpringMain.main(JamesAppSpringMain.java:42)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> INFO   | jvm 1| 2014/02/03 23:27:10 |   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> INFO   | 

API Boundaries

2020-05-17 Thread David Leangen


Hi,

Sorry for the barrage of emails, but I hope to get help from the community. I 
hope the benefits of what I plan to contribute will be worth the efforts that 
you make to answer my questions. Thanks for bearing with me. :-)


I wanted to ask about API boundaries. As I mentioned in a different email 
thread, I think that:

> the organization of the Guice Modules is perhaps THE most important 
> abstraction available to allow people to understand the system.
> 
> Ideally, to help provide a better understanding of the system and its 
> compile-time (and even to some extent its runtime) organization, I think it 
> is important to:
> 
> […]
> 
> * Ensure that each Module is well-contained (i.e. no “leaks” or coupling to 
> other implementations)
> —> I found this part to be quite problematic

I noticed what, to me, is a problem with API boundaries. I would like to use 
Cassandra as my example.

My shallow understanding of James is that it requires a module to store emails. 
If I understand correctly, that is the “Maildir" module, which can be 
implemented in many different ways (filesystem, RDB, Cassandra, in-memory…). If 
my understanding is correct, then I think the concept is quite simple. If the 
simplicity of the concept can be maintained in the code, then the system should 
in principle remain easy to understand.

The whole point of a framework like Guice is to separate the API from its 
implementations. All that James should care about is that it has a Maildir 
instance, and for all intents and purposes, it shouldn’t care at all about 
which implementation is has.

That is where the resolution/writing comes into play. With Guice, this happens 
to be done statically at compile time in Java code (and of course executed at 
runtime). Nothing fancy, but that’s quite ok as it gets the job done. I like 
having that configuration in code because it makes things like documentation 
and refactoring easier. Thanks to this type of DI approach (which requires 
clean separation of API from implementation code) for an application assembler, 
it should be trivial to swap out an RDB implementation of a Maildir for a 
Cassandra implementation of a Maildir.

Now, because James is a complex system, there are actually several APIs. For 
instance, by inspecting the code I gather that the EventStore also requires an 
implementation, and one of those implementations is Cassandra.

If the API is well-designed, then it should be very easy to swap 
implementations:

 Mailbox (interface)
   MailboxAImpl
   MailboxBImpl
   MailboxCImpl
   ...

EventStore
   EventStoreAImpl
   EventStoreBImpl
   EventStoreCImpl
   ...

If Cassandra could implement both of these, then this configuration could be 
possible:

Mailbox
 Mailbox (interface)
   MailboxAImpl
   MailboxBImpl
   CassandraMailbox
   ...

EventStore
   EventStoreAImpl
   EventStoreBImpl
   CassandraEventStore
   …


However, this configuration should also be possible:

Mailbox
 Mailbox (interface)
   CassandraJames

EventStore
   CassandraJames (yes! the same instance as above)


In other words, the “CassandraJames” Module could very well implement more than 
one API. There is absolutely nothing wrong with an implementation’s 
implementing multiple APIs.

Actually, ANY implementation, including the Cassandra implementation, does not 
necessarily need to reside in the same code base. It should ideally be packaged 
into a single JAR that gets dropped into the framework. That means that ideally 
there should be a single CassandraJames jar that is used to wire up the system. 
Perhaps all of the APIs will be used, but maybe not. Doesn’t matter. The point 
is to make the system easy to understand and easy to wire up.

However, I could be wrong, but in the current code base, there appears to be 
bits of “Cassandra” code all over the place.


In any case, this is just one example. The point is that I get the feeling that 
the Modules are not clearly defined, and the implementations are leaking into 
different places instead of keeping cohesive code together. Or rather, the 
cohesiveness is not being defined along the same dimensions, which IMO does not 
seem quite right.

The result is that the code base does not seem to match well the high-level 
system concepts, which makes the code very difficult to understand even if the 
concepts behind James are not so difficult.


So my question is: what are the thoughts behind how the APIs are designed? Is 
there any documentation or something that can help me understand? Right now I 
can only base my statements on my impressions, and my impression could be 
completely wrong.

My impression is that the important James concepts which require a 
well-designed API are:

 * Mailbox (is this the same as “backend”??? and what about “blob”??? and 
“data”???)
 * EventStore (is this always required???)
 * Mailet
 * Server
 * Protocols (and the various flavours)
 * Admin (implemented by CLI and API)
 * Queue (or is this part of “server”???)

These 

Questions about Guice design

2020-05-17 Thread David Leangen


Hi!

As I just mentioned in a different email:

> As part of my documentation project, I am starting to turn my attention 
> towards the code itself. I am trying to understand how the system works. […] 
> To understand the system better, I need to take a step back and understand 
> Guice. I am learning about Guice now. So far, guice looks quite easy to 
> understand and use (at least for me because as a long-time OSGi user I 
> understand very well the concepts of DI, api/impl separation, services, 
> etc.). I can understand very well the motivation for using a framework like 
> Guice, and I think (hope!) it should help me to understand what is going on 
> in the system.

You’ll have to excuse my inexperience with Guice. However, to understand James, 
it is imperative (ok, actually “declarative” hahahaha I’m so funny) to 
understand its organization into Guice Modules. I have not read through all of 
the Guice documentation, but I think I get the idea.

In this context, I have started looking at the James code base. There are many 
very nice things about it. Despite its size and complexity, I was able to 
understand quite a lot thanks to the good organization and naming conventions. 
That said, I think we could still do a lot better.

Organizing into Guice Modules is very nice. One of the important benefits is 
that it helps a lot to break the system down into reasonable chunks that are 
more understandable. It is simply impossible for a normal human to understand 
the system all at once. It is necessary to have several levels of abstraction. 
The use of Guice Modules to provide a “just right" level of abstraction (not 
too high so as to be useless when trying to run it, but not so low as to be 
much too detailed) is essential. I would wager that in most situations, this is 
the level of abstraction that is most useful for a developer or system operator 
(and definitely for an application assembler). The only time a package or class 
level is necessary is when actually making changes to the code.

I would even double down on my statement and say that the organization of the 
Guice Modules is perhaps THE most important abstraction available to allow 
people to understand the system.

Ideally, to help provide a better understanding of the system and its 
compile-time (and even to some extent its runtime) organization, I think it is 
important to:

 * Match the Guice Modules with the Maven modules, matching them exactly if 
possible
 —> At first glance, this seems pretty good

 * Ensure that each Module is well-contained (i.e. no “leaks” or coupling to 
other implementations)
 —> I found this part to be quite problematic (topic for a different email)

 * Understand the API surface area of each Module
 —> I am having a lot of trouble with this (again, a topic for a different 
email)


Below is a list of all the Guice Modules I was able to find in the system. I 
simply did a search and manually extracted these. There are 144!!

Although I could guess a little bit as to what they do, I was otherwise unable 
to understand many things:

 * What is the purpose?
 * How does it relate to other Modules?
 * Which Modules are implementing the same API, so are “swappable”?
 * What is the hierarchy? (Assuming that there are Modules of Modules)?


It is a great start! However, to be able to put more order into all of this, 
these are my initial thoughts:

 1. Document each module individually (even if only a line or two of text)
 2. Understand if there is any hierarchy (i.e. Modules of Modules)
  —> Refactor / Rename the Modules to make the hierarchy immediately clear
 3. Validate that each Guice Module is perfectly aligned with its Maven module
 4. With this clearer picture, evaluate whether or not the current project 
structure is still appropriate
 5. Update the documentation of each Maven module to show all of its Guice 
Modules

With this clearer understanding, it should be much easier to wire together a 
“product” without having to rely on a “supported product”. I think the system 
appears to be well-designed. It’s just very difficult to understand right now. 
If we can make it easier to grok, it will be much easier to use.


Thoughts?

Cheers,
=David


BlobStoreAPIModule
BlobExportMechanismModule
LinshareBlobExportMechanismModule
LocalFileBlobExportMechanismModule
BlobMemoryModule
ObjectStorageBlobStoreModule
ObjectStorageDependenciesModule
MyExtensionModule
CassandraDLPConfigurationStoreModule
CassandraDomainListModule
CassandraJmapModule
CassandraMailRepositoryModule
CassandraRecipientRewriteTableModule
CassandraSieveRepositoryModule
CassandraUsersRepositoryModule
CassandraEventStoreModule
CassandraBlobStoreModule
CassandraCacheSessionModule
CassandraDeadLetterModule
CassandraDeletedMessageVaultModule
CassandraMailboxModule
CassandraQuotaMailingModule
CassandraQuotaModule
CassandraSessionModule
ElasticSearchClientModule
ElasticSearchMailboxModule
ElasticSearchQuotaSearcherModule