JAMES-1799 Add scanning ListeningMessageSearchIndex tests I had to introduce a new project in order to satisfy a cyclic dependency (mailbox-store - mailbox-memory)
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/8fcd6606 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/8fcd6606 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/8fcd6606 Branch: refs/heads/master Commit: 8fcd6606c7cbf70fdc726319cd096b615c72610d Parents: e5f5c6a Author: Antoine Duprat <[email protected]> Authored: Wed Jul 13 16:00:22 2016 +0200 Committer: Antoine Duprat <[email protected]> Committed: Tue Jul 19 14:24:43 2016 +0200 ---------------------------------------------------------------------- mailbox/pom.xml | 7 + mailbox/scanning-search/pom.xml | 234 +++++++++++++++++++ .../search/SimpleMessageSearchIndexTest.java | 217 +++++++++++++++++ 3 files changed, 458 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/8fcd6606/mailbox/pom.xml ---------------------------------------------------------------------- diff --git a/mailbox/pom.xml b/mailbox/pom.xml index a7e1974..1a23088 100644 --- a/mailbox/pom.xml +++ b/mailbox/pom.xml @@ -58,6 +58,7 @@ <module>lucene</module> <module>maildir</module> <module>memory</module> + <module>scanning-search</module> <module>store</module> <module>spring</module> <module>tika</module> @@ -124,6 +125,7 @@ <apache-backends-cassandra.version>1.8.3-SNAPSHOT</apache-backends-cassandra.version> <assertj-1.version>1.7.1</assertj-1.version> <assertj-3.version>3.2.0</assertj-3.version> + <logback.version>1.1.7</logback.version> </properties> <dependencyManagement> @@ -311,6 +313,11 @@ <version>${slf4j.version}</version> <scope>test</scope> </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <version>${logback.version}</version> + </dependency> <!-- START Logging --> http://git-wip-us.apache.org/repos/asf/james-project/blob/8fcd6606/mailbox/scanning-search/pom.xml ---------------------------------------------------------------------- diff --git a/mailbox/scanning-search/pom.xml b/mailbox/scanning-search/pom.xml new file mode 100644 index 0000000..90eacb9 --- /dev/null +++ b/mailbox/scanning-search/pom.xml @@ -0,0 +1,234 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<project xmlns="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"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <artifactId>apache-james-mailbox</artifactId> + <groupId>org.apache.james</groupId> + <version>0.6-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>apache-james-mailbox-scanning-search</artifactId> + <description>Apache James Mailbox IMAP search implementation using scanning</description> + <name>Apache James :: Mailbox :: Scanning</name> + + <properties> + <javax.mail.groupId>javax.mail</javax.mail.groupId> + <javax.mail.artifactId>mail</javax.mail.artifactId> + </properties> + + <profiles> + <profile> + <id>disable-build-for-older-jdk</id> + <activation> + <jdk>(,1.8)</jdk> + </activation> + <build> + <plugins> + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <executions> + <execution> + <id>default-jar</id> + <phase>none</phase> + </execution> + <execution> + <id>jar</id> + <phase>none</phase> + </execution> + <execution> + <id>test-jar</id> + <phase>none</phase> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <executions> + <execution> + <id>default-compile</id> + <phase>none</phase> + </execution> + <execution> + <id>default-testCompile</id> + <phase>none</phase> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <executions> + <execution> + <id>default-test</id> + <phase>none</phase> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-source-plugin</artifactId> + <executions> + <execution> + <id>attach-sources</id> + <phase>none</phase> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-install-plugin</artifactId> + <executions> + <execution> + <id>default-install</id> + <phase>none</phase> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <executions> + <execution> + <id>default-resources</id> + <phase>none</phase> + </execution> + <execution> + <id>default-testResources</id> + <phase>none</phase> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-site-plugin</artifactId> + <executions> + <execution> + <id>attach-descriptor</id> + <phase>none</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>build-for-jdk-8</id> + <activation> + <jdk>[1.8,)</jdk> + </activation> + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <archive> + <manifest> + <mainClass>fully.qualified.MainClass</mainClass> + </manifest> + </archive> + <descriptorRefs> + <descriptorRef>jar-with-dependencies</descriptorRef> + </descriptorRefs> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> + </plugin> + </plugins> + + </build> + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>apache-james-mailbox-api</artifactId> + </dependency> + <dependency> + <groupId>org.apache.james</groupId> + <artifactId>apache-james-mailbox-memory</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.james</groupId> + <artifactId>apache-james-mailbox-store</artifactId> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>apache-james-mailbox-store</artifactId> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.assertj</groupId> + <artifactId>assertj-core</artifactId> + <version>${assertj-3.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + </dependencies> + </profile> + <profile> + <id>animal-sniffer-java-8</id> + <activation> + <jdk>[1.8,)</jdk> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>animal-sniffer-maven-plugin</artifactId> + <configuration> + <signature> + <groupId>org.codehaus.mojo.signature</groupId> + <artifactId>java18</artifactId> + <version>1.0</version> + </signature> + </configuration> + <executions> + <execution> + <id>check_java_8</id> + <phase>test</phase> + <goals> + <goal>check</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + +</project> http://git-wip-us.apache.org/repos/asf/james-project/blob/8fcd6606/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndexTest.java ---------------------------------------------------------------------- diff --git a/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndexTest.java b/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndexTest.java new file mode 100644 index 0000000..c484c64 --- /dev/null +++ b/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndexTest.java @@ -0,0 +1,217 @@ +/**************************************************************** + * 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.mailbox.store.search; + +import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver; +import org.apache.james.mailbox.acl.UnionMailboxACLResolver; +import org.apache.james.mailbox.exception.MailboxException; +import org.apache.james.mailbox.inmemory.InMemoryMailboxManager; +import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory; +import org.apache.james.mailbox.store.JVMMailboxPathLocker; +import org.apache.james.mailbox.store.MailboxSessionMapperFactory; +import org.apache.james.mailbox.store.MockAuthenticator; +import org.apache.james.mailbox.store.mail.model.impl.MessageParser; +import org.junit.Ignore; + +public class SimpleMessageSearchIndexTest extends AbstractMessageSearchIndexTest { + + @Override + protected void await() { + } + + @Override + protected void initializeMailboxManager() throws Exception { + MailboxSessionMapperFactory mapperFactory = new InMemoryMailboxSessionMapperFactory(); + messageSearchIndex = new SimpleMessageSearchIndex(mapperFactory); + storeMailboxManager = new InMemoryMailboxManager( + mapperFactory, + new MockAuthenticator(), + new JVMMailboxPathLocker(), + new UnionMailboxACLResolver(), + new SimpleGroupMembershipResolver(), + new MessageParser()); + storeMailboxManager.setMessageSearchIndex(messageSearchIndex); + storeMailboxManager.init(); + } + + /** + * 32 tests out of 54 are failing + */ + + @Ignore + @Override + public void flagIsSetShouldReturnUidOfMessageMarkedAsRecentWhenUsedWithFlagRecent() throws MailboxException { + } + + @Ignore + @Override + public void uidShouldreturnEveryThing() throws Exception { + } + + @Ignore + @Override + public void sortOnCcShouldWork() throws Exception { + } + + @Ignore + @Override + public void sortOnFromShouldWork() throws Exception { + } + + @Ignore + @Override + public void addressShouldReturnUidHavingRightRecipientWhenBccIsSpecified() throws Exception { + } + + @Ignore + @Override + public void orShouldReturnResultsMatchinganyRequests() throws Exception { + } + + @Ignore + @Override + public void internalDateBeforeShouldReturnMessagesBeforeAGivenDate() throws Exception { + } + + @Ignore + @Override + public void headerContainsShouldReturnUidsOfMessageHavingThisHeaderWithTheSpecifiedValue() throws Exception { + } + + @Ignore + @Override + public void internalDateAfterShouldReturnMessagesAfterAGivenDate() throws Exception { + } + + @Ignore + @Override + public void youShouldBeAbleToSpecifySeveralCriterionOnASingleQuery() throws Exception { + } + + @Ignore + @Override + public void headerExistsShouldReturnUidsOfMessageHavingThisHeader() throws Exception { + } + + @Ignore + @Override + public void modSeqLessThanShouldReturnUidsOfMessageHavingAGreaterModSeq() throws Exception { + } + + @Ignore + @Override + public void addressShouldReturnUidHavingRightRecipientWhenCcIsSpecified() throws Exception { + } + + @Ignore + @Override + public void andShouldReturnResultsMatchingBothRequests() throws Exception { + } + + @Ignore + @Override + public void addressShouldReturnUidHavingRightExpeditorWhenFromIsSpecified() throws Exception { + } + + @Ignore + @Override + public void sortOnDisplayToShouldWork() throws Exception { + } + + @Ignore + @Override + public void flagIsUnSetShouldReturnUidOfMessageNotMarkedAsRecentWhenUsedWithFlagRecent() throws MailboxException { + } + + @Ignore + @Override + public void bodyContainsShouldReturnUidOfMessageContainingTheApproximativeText() throws MailboxException { + } + + @Ignore + @Override + public void headerDateBeforeShouldWork() throws Exception { + } + + @Ignore + @Override + public void sortOnSentDateShouldWork() throws Exception { + } + + @Ignore + @Override + public void addressShouldReturnUidHavingRightRecipientWhenToIsSpecified() throws Exception { + } + + @Ignore + @Override + public void sortOnToShouldWork() throws Exception { + } + + @Ignore + @Override + public void sortOnDisplayFromShouldWork() throws Exception { + } + + @Ignore + @Override + public void revertSortingShouldReturnElementsInAReversedOrder() throws Exception { + } + + @Ignore + @Override + public void headerDateAfterShouldWork() throws Exception { + } + + @Ignore + @Override + public void mailsContainsShouldIncludeMailHavingAttachmentsMatchingTheRequest() throws Exception { + } + + @Ignore + @Override + public void sortOnSubjectShouldWork() throws Exception { + } + + @Ignore + @Override + public void modSeqGreaterThanShouldReturnUidsOfMessageHavingAGreaterModSeq() throws Exception { + } + + @Ignore + @Override + public void notShouldReturnResultsThatDoNotMatchAQuery() throws Exception { + } + + @Ignore + @Override + public void headerDateOnShouldWork() throws Exception { + } + + @Ignore + @Override + public void sortOnSizeShouldWork() throws Exception { + } + + @Ignore + @Override + public void sortShouldOrderMessages() throws Exception { + } +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
