Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ValidAuthenticated.test URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ValidAuthenticated.test?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ValidAuthenticated.test (added) +++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ValidAuthenticated.test Fri May 29 05:16:50 2015 @@ -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. # +################################################################ +# Commands not valid in NONAUTHENTICATED state +# Valid in authenticated or selected only +C: a001 SELECT mailbox +S: a001 NO SELECT failed. Command not valid in this state. +C: a001 EXAMINE mailbox +S: a001 NO EXAMINE failed. Command not valid in this state. +C: a001 CREATE mailbox +S: a001 NO CREATE failed. Command not valid in this state. +C: a001 DELETE mailbox +S: a001 NO DELETE failed. Command not valid in this state. +C: a001 RENAME oldname newname +S: a001 NO RENAME failed. Command not valid in this state. +C: a001 SUBSCRIBE mailbox +S: a001 NO SUBSCRIBE failed. Command not valid in this state. +C: a001 UNSUBSCRIBE mailbox +S: a001 NO UNSUBSCRIBE failed. Command not valid in this state. +C: a001 LIST "" "" +S: a001 NO LIST failed. Command not valid in this state. +C: a001 LSUB "" "" +S: a001 NO LSUB failed. Command not valid in this state. +C: a001 STATUS mailbox (UIDNEXT) +S: a001 NO STATUS failed. Command not valid in this state. +C: a001 APPEND mailbox {13+} +C: 13 characters +S: a001 NO APPEND failed. Command not valid in this state.
Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ValidNonAuthenticated.test URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ValidNonAuthenticated.test?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ValidNonAuthenticated.test (added) +++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ValidNonAuthenticated.test Fri May 29 05:16:50 2015 @@ -0,0 +1,23 @@ +################################################################ +# 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. # +################################################################ +# Valid in non-authenticated only +C: a001 LOGIN daz daz +S: a001 NO LOGIN failed. Command not valid in this state. +C: abcd AUTHENTICATE KERBEROS_V4 +S: abcd NO AUTHENTICATE failed. Command not valid in this state. Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ValidSelected.test URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ValidSelected.test?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ValidSelected.test (added) +++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ValidSelected.test Fri May 29 05:16:50 2015 @@ -0,0 +1,35 @@ +################################################################ +# 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. # +################################################################ +# Valid in selected only +C: a001 CHECK +S: a001 NO CHECK failed. Command not valid in this state. +C: a001 CLOSE +S: a001 NO CLOSE failed. Command not valid in this state. +C: a001 COPY 1 mailbox +S: a001 NO COPY failed. Command not valid in this state. +C: a001 EXPUNGE +S: a001 NO EXPUNGE failed. Command not valid in this state. +C: a001 SEARCH ALL +S: a001 NO SEARCH failed. Command not valid in this state. +C: a001 FETCH 1 ALL +S: a001 NO FETCH failed. Command not valid in this state. +C: a001 STORE 1 +FLAGS (\Seen) +S: a001 NO STORE failed. Command not valid in this state. +C: a001 UID FETCH 1 ALL +S: a001 NO UID failed. Command not valid in this state. Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Welcome.test URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Welcome.test?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Welcome.test (added) +++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Welcome.test Fri May 29 05:16:50 2015 @@ -0,0 +1,19 @@ +################################################################ +# 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. # +################################################################ +S: \* OK IMAP4rev1 Server ready \ No newline at end of file Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/mailboxmanager/testdata/DefaultMailboxManagerConf.xml URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/mailboxmanager/testdata/DefaultMailboxManagerConf.xml?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/mailboxmanager/testdata/DefaultMailboxManagerConf.xml (added) +++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/mailboxmanager/testdata/DefaultMailboxManagerConf.xml Fri May 29 05:16:50 2015 @@ -0,0 +1,41 @@ +<config> +<!-- + 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. +--> + <mailboxmanager> + <namespaces> + <usernamespace name="#mail" delimiter="." /> + </namespaces> + + <factory class="org.apache.james.mailboxmanager.mock.MockMailboxManagerFactory"> + <mount> + <point point="#system" /> + <target class="org.apache.james.mailboxmanager.impl.MailStoreMailboxManager"> + <repository destinationURL="file://var/mail/" type="MAIL" /> + </target> + </mount> + <mount> + <point point="#mail" /> + <target type="service" service="org.apache.james.mailboxmanager.impl.MailStoreMailboxManager"> + <repository destinationURL="file://var/mail/inboxes/" type="MAIL" /> + </target> + </mount> + </factory> + </mailboxmanager> + +</config> Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/mailboxmanager/testdata/MixedMailstores.xml URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/mailboxmanager/testdata/MixedMailstores.xml?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/mailboxmanager/testdata/MixedMailstores.xml (added) +++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/mailboxmanager/testdata/MixedMailstores.xml Fri May 29 05:16:50 2015 @@ -0,0 +1,185 @@ +<config> +<!-- + 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. +--> + <mailboxmanager> + <namespaces> + <usernamespace name="#mail" delimiter="."/> + </namespaces> + <factory + class="org.apache.james.mailboxmanager.impl.VirtualMailboxManagerFactory"> + <mounts> + <mount> + <point point="#mail.user1"/> + <target + class="org.apache.james.mailboxmanager.mailstore.MailStoreMailboxManagerFactory"> + <repository destinationURL="file://target/var/vm/user1" + type="MAIL"/> + </target> + </mount> + <mount> + <point point="#mail.user2"/> + <target + class="org.apache.james.mailboxmanager.mailstore.MailStoreMailboxManagerFactory"> + <repository destinationURL="file://target/var/vm/user2_test" + type="MAIL"/> + </target> + </mount> + </mounts> + </factory> + </mailboxmanager> + <mailstore> + <repositories> + <repository class="org.apache.james.mailboxmanager.repository.MailboxManagerMailRepository"> + <protocols> + <protocol>mailboxmanager</protocol> + </protocols> + <types> + <type>MAIL</type> + </types> + <config> + <sqlFile>file://conf/mailboxManagerSqlResources.xml</sqlFile> + </config> + </repository> + <!-- File based repositories. These repositories store all message data --> + <!-- in the file system. --> + <repository class="org.apache.james.mailrepository.AvalonMailRepository"> + <protocols> + <protocol>file</protocol> + </protocols> + <types> + <type>MAIL</type> + </types> + <!-- Set if the messages should be listed sorted. False by default --> + <config FIFO="false"/> + </repository> + <repository class="org.apache.james.mailrepository.AvalonSpoolRepository"> + <protocols> + <protocol>file</protocol> + </protocols> + <types> + <type>SPOOL</type> + </types> + </repository> + + <!-- JDBC based repositories. These repositories store all message data --> + <!-- in the database. --> + <repository class="org.apache.james.mailrepository.JDBCMailRepository"> + <protocols> + <protocol>db</protocol> + </protocols> + <types> + <type>MAIL</type> + </types> + <config> + <sqlFile>file://conf/sqlResources.xml</sqlFile> + <!-- Set the size threshold for in memory handling of storing operations --> + <!-- Default is currently 409600000 due to a bug with mysql and binary stream --> + <!-- currently under investigation. Please change this only if you know what --> + <!-- you do. --> + <!-- + <inMemorySizeLimit>4096</inMemorySizeLimit> + --> + </config> + </repository> + + <repository class="org.apache.james.mailrepository.JDBCSpoolRepository"> + <protocols> + <protocol>db</protocol> + </protocols> + <types> + <type>SPOOL</type> + </types> + <config> + <sqlFile>file://conf/sqlResources.xml</sqlFile> + <maxcache>1000</maxcache> + </config> + </repository> + + <!-- These repositories store message delivery and headers in the DB, and the body to the filesystem --> + <repository class="org.apache.james.mailrepository.JDBCMailRepository"> + <protocols> + <protocol>dbfile</protocol> + </protocols> + <types> + <type>MAIL</type> + </types> + <config> + <sqlFile>file://conf/sqlResources.xml</sqlFile> + <filestore>file://var/dbmail</filestore> + </config> + </repository> + + <repository class="org.apache.james.mailrepository.JDBCSpoolRepository"> + <protocols> + <protocol>dbfile</protocol> + </protocols> + <types> + <type>SPOOL</type> + </types> + <config> + <sqlFile>file://conf/sqlResources.xml</sqlFile> + <filestore>file://var/dbmail</filestore> + <maxcache>1000</maxcache> + </config> + </repository> + + <!-- The mbox repository is designed for MAIL only; SPOOL performance would be less than ideal--> + <repository class="org.apache.james.mailrepository.MBoxMailRepository"> + <protocols> + <protocol>mbox</protocol> + </protocols> + <types> + <type>MAIL</type> + </types> + <!-- Set if the messages should be listed sorted. False by default --> + <config FIFO="false"/> + </repository> + + <repository class="org.apache.james.mailrepository.filepair.File_Persistent_Object_Repository"> + <protocols> + <protocol>file</protocol> + </protocols> + <types> + <type>OBJECT</type> + </types> + <models> + <model>SYNCHRONOUS</model> + <model>ASYNCHRONOUS</model> + <model>CACHE</model> + </models> + </repository> + + <repository class="org.apache.james.mailrepository.filepair.File_Persistent_Stream_Repository"> + <protocols> + <protocol>file</protocol> + </protocols> + <types> + <type>STREAM</type> + </types> + <models> + <model>SYNCHRONOUS</model> + <model>ASYNCHRONOUS</model> + <model>CACHE</model> + </models> + </repository> + </repositories> + + </mailstore> +</config> + Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/mailboxmanager/testdata/VirtualRepositoryMix.xml URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/mailboxmanager/testdata/VirtualRepositoryMix.xml?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/mailboxmanager/testdata/VirtualRepositoryMix.xml (added) +++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/mailboxmanager/testdata/VirtualRepositoryMix.xml Fri May 29 05:16:50 2015 @@ -0,0 +1,129 @@ +<config> +<!-- + 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. +--> + <mailboxmanager> + <namespaces> + <usernamespace name="#mail" delimiter="."/> + </namespaces> + <factory + class="org.apache.james.mailboxmanager.impl.VirtualMailboxManagerFactory"> + <mounts> + <mount> + <point point="#user"/> + <point point="#user1"/> + <target + class="org.apache.james.mailboxmanager.mock.MockMailboxManagerFactory"> + <myconf attr="test"/> + </target> + </mount> + + <mount> + <point point="#user2"/> + <point point="#user3"/> + <target + class="org.apache.james.mailboxmanager.mock.MockMailboxManagerFactory"> + <myconf attr="test2"/> + </target> + </mount> + <mount> + <point point="#system"/> + <target + class="org.apache.james.mailboxmanager.mailstore.MailStoreMailboxManagerFactory"> + <repository destinationURL="file://var/mail/" + type="MAIL"/> + </target> + </mount> + <mount> + <point point="#mail"/> + <target + class="org.apache.james.mailboxmanager.torque.TorqueMailboxManagerFactory"> + <configFile name="file://conf/mailboxManagerSqlResources.xml"/> + <torque-properties> + <property name="torque.database.default" + value="mailboxmanager"/> + <property + name="torque.database.mailboxmanager.adapter" + value="derby"/> + <property + name="torque.dsfactory.mailboxmanager.factory" + value="org.apache.torque.dsfactory.SharedPoolDataSourceFactory"/> + <property + name="torque.dsfactory.mailboxmanager.connection.driver" + value="org.apache.derby.jdbc.EmbeddedDriver"/> + <property + name="torque.dsfactory.mailboxmanager.connection.url" + value="jdbc:derby:tmp/mailboxmanager-derbydb;create=true"/> + <property + name="torque.dsfactory.mailboxmanager.connection.user" + value="app"/> + <property + name="torque.dsfactory.mailboxmanager.connection.password" + value="app"/> + <property + name="torque.dsfactory.mailboxmanager.pool.maxActive" + value="100"/> + </torque-properties> + </target> + </mount> + </mounts> + </factory> + </mailboxmanager> + <mailboxmanager-without-torque> + <namespaces> + <usernamespace name="#mail" delimiter="."/> + </namespaces> + <factory + class="org.apache.james.mailboxmanager.impl.VirtualMailboxManagerFactory"> + <mounts> + <mount> + <point point="#user"/> + <point point="#user1"/> + <target + class="org.apache.james.mailboxmanager.mock.MockMailboxManagerFactory"> + <myconf attr="test"/> + </target> + </mount> + + <mount> + <point point="#user2"/> + <point point="#user3"/> + <target + class="org.apache.james.mailboxmanager.mock.MockMailboxManagerFactory"> + <myconf attr="test2"/> + </target> + </mount> + <mount> + <point point="#system"/> + <target + class="org.apache.james.mailboxmanager.mailstore.MailStoreMailboxManagerFactory"> + <repository destinationURL="file://var/mail/" + type="MAIL"/> + </target> + </mount> + <mount> + <point point="#mail"/> + <target + class="org.apache.james.mailboxmanager.mock.MockMailboxManagerFactory"> + <myconf attr="test3"/> + </target> + </mount> + </mounts> + </factory> + </mailboxmanager-without-torque> +</config> Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/test-repository.xml URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/test-repository.xml?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/test-repository.xml (added) +++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/test-repository.xml Fri May 29 05:16:50 2015 @@ -0,0 +1,92 @@ +<?xml version="1.0"?> +<!-- + 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. +--> +<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.6//EN" + "http://jackrabbit.apache.org/dtd/repository-1.6.dtd"> +<!-- Example Repository Configuration File + Used by + - org.apache.jackrabbit.core.config.RepositoryConfigTest.java + - +--> +<Repository> + <!-- + virtual file system where the repository stores global state + (e.g. registered namespaces, custom node types, etc.) + --> + <FileSystem class='org.apache.jackrabbit.core.fs.mem.MemoryFileSystem'> + </FileSystem> + <!-- + security configuration + --> + <Security appName="Jackrabbit"> + <SecurityManager class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager" workspaceName="default"> + </SecurityManager> + + <AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager"> + </AccessManager> + + <LoginModule class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule"> + <param name="adminId" value="admin"/> + </LoginModule> + </Security> + + <Workspaces rootPath='${rep.home}/workspaces' defaultWorkspace='default'/> + + <Workspace name='${wsp.name}'> + <FileSystem class='org.apache.jackrabbit.core.fs.mem.MemoryFileSystem'> + </FileSystem> + <!-- + persistence manager of the workspace: + class: FQN of class implementing the PersistenceManager interface + --> + <PersistenceManager class="org.apache.jackrabbit.core.persistence.mem.InMemPersistenceManager"> + <param name="persistent" value="false"/> + </PersistenceManager> + + <SearchIndex class='org.apache.jackrabbit.core.query.lucene.SearchIndex'> + <param name='path' value='${wsp.home}/index'/> + <param name='textFilterClasses' value='org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apache.jackrabbit.extractor.XMLTextExtractor'/> + <param name='extractorPoolSize' value='2'/> + <param name='supportHighlighting' value='true'/> + </SearchIndex> + + </Workspace> + + <!-- + Configures the versioning + --> + <Versioning rootPath='${rep.home}/version'> + <FileSystem class='org.apache.jackrabbit.core.fs.mem.MemoryFileSystem'> + </FileSystem> + + <PersistenceManager class="org.apache.jackrabbit.core.persistence.mem.InMemPersistenceManager"> + <param name="persistent" value="false"/> + </PersistenceManager> + + </Versioning> + <!-- + Search index for content that is shared repository wide + (/jcr:system tree, contains mainly versions) + --> + <SearchIndex class='org.apache.jackrabbit.core.query.lucene.SearchIndex'> + <param name='path' value='${rep.home}/repository/index'/> + <param name='textFilterClasses' value='org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apache.jackrabbit.extractor.XMLTextExtractor'/> + <param name='extractorPoolSize' value='2'/> + <param name='supportHighlighting' value='true'/> + </SearchIndex> + +</Repository> Added: james/mpt/trunk/impl/imap-mailbox/core/src/reporting-site/site.xml URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/reporting-site/site.xml?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/core/src/reporting-site/site.xml (added) +++ james/mpt/trunk/impl/imap-mailbox/core/src/reporting-site/site.xml Fri May 29 05:16:50 2015 @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + 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 name="${project.name}"> + + <body> + + <menu ref="reports" /> + + </body> + +</project> Added: james/mpt/trunk/impl/imap-mailbox/hbase/LICENSE.txt URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/hbase/LICENSE.txt?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/hbase/LICENSE.txt (added) +++ james/mpt/trunk/impl/imap-mailbox/hbase/LICENSE.txt Fri May 29 05:16:50 2015 @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS \ No newline at end of file Added: james/mpt/trunk/impl/imap-mailbox/hbase/NOTICE.txt URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/hbase/NOTICE.txt?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/hbase/NOTICE.txt (added) +++ james/mpt/trunk/impl/imap-mailbox/hbase/NOTICE.txt Fri May 29 05:16:50 2015 @@ -0,0 +1,11 @@ + +========================================================================= +== NOTICE file for use with the Apache License, Version 2.0, == +========================================================================= + +Apache JAMES +Copyright 2007-2008 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + \ No newline at end of file Added: james/mpt/trunk/impl/imap-mailbox/hbase/pom.xml URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/hbase/pom.xml?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/hbase/pom.xml (added) +++ james/mpt/trunk/impl/imap-mailbox/hbase/pom.xml Fri May 29 05:16:50 2015 @@ -0,0 +1,85 @@ +<?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/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <artifactId>apache-james-mpt-imapmailbox</artifactId> + <groupId>org.apache.james</groupId> + <version>0.2-SNAPSHOT</version> + </parent> + + <artifactId>apache-james-mpt-imapmailbox-hbase</artifactId> + <name>Apache James MPT Imap Mailbox - HBase</name> + + <dependencies> + <dependency> + <groupId>org.apache.james</groupId> + <artifactId>apache-james-mpt-imapmailbox-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.james</groupId> + <artifactId>apache-james-mailbox-hbase</artifactId> + </dependency> + <dependency> + <groupId>org.apache.james.protocols</groupId> + <artifactId>protocols-imap</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.hbase</groupId> + <artifactId>hbase</artifactId> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.hbase</groupId> + <artifactId>hbase</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-test</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + + + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>**/suite/*.java</exclude> + <exclude>**/suite/**/*.java</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> +</project> + Added: james/mpt/trunk/impl/imap-mailbox/hbase/src/reporting-site/site.xml URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/hbase/src/reporting-site/site.xml?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/hbase/src/reporting-site/site.xml (added) +++ james/mpt/trunk/impl/imap-mailbox/hbase/src/reporting-site/site.xml Fri May 29 05:16:50 2015 @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + 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 name="${project.name}"> + + <body> + + <menu ref="reports" /> + + </body> + +</project> Added: james/mpt/trunk/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/HBaseMailboxTest.java URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/HBaseMailboxTest.java?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/HBaseMailboxTest.java (added) +++ james/mpt/trunk/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/HBaseMailboxTest.java Fri May 29 05:16:50 2015 @@ -0,0 +1,9 @@ +package org.apache.james.mpt.imapmailbox.hbase; + +import org.apache.james.mpt.imapmailbox.AbstractMailboxTest; +import org.apache.onami.test.annotation.GuiceModules; + +@GuiceModules({ HBaseMailboxTestModule.class }) +public class HBaseMailboxTest extends AbstractMailboxTest { + +} Added: james/mpt/trunk/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/HBaseMailboxTestModule.java URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/HBaseMailboxTestModule.java?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/HBaseMailboxTestModule.java (added) +++ james/mpt/trunk/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/HBaseMailboxTestModule.java Fri May 29 05:16:50 2015 @@ -0,0 +1,22 @@ +package org.apache.james.mpt.imapmailbox.hbase; + +import org.apache.james.mpt.api.HostSystem; +import org.apache.james.mpt.imapmailbox.hbase.host.HBaseHostSystem; + +import com.google.inject.AbstractModule; +import com.google.inject.Provides; +import com.google.inject.Singleton; + +public class HBaseMailboxTestModule extends AbstractModule { + + @Override + protected void configure() { + } + + @Provides + @Singleton + public HostSystem provideHostSystem() throws Exception { + return HBaseHostSystem.build(); + } + +} Added: james/mpt/trunk/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java (added) +++ james/mpt/trunk/impl/imap-mailbox/hbase/src/test/java/org/apache/james/mpt/imapmailbox/hbase/host/HBaseHostSystem.java Fri May 29 05:16:50 2015 @@ -0,0 +1,140 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.james.mpt.imapmailbox.hbase.host; + +import java.io.File; + +import org.apache.commons.io.FileUtils; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.james.imap.api.process.ImapProcessor; +import org.apache.james.imap.encode.main.DefaultImapEncoderFactory; +import org.apache.james.imap.main.DefaultImapDecoderFactory; +import org.apache.james.imap.processor.main.DefaultImapProcessorFactory; +import org.apache.james.mailbox.MailboxSession; +import org.apache.james.mailbox.SubscriptionManager; +import org.apache.james.mailbox.acl.GroupMembershipResolver; +import org.apache.james.mailbox.acl.MailboxACLResolver; +import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver; +import org.apache.james.mailbox.acl.UnionMailboxACLResolver; +import org.apache.james.mailbox.hbase.HBaseMailboxManager; +import org.apache.james.mailbox.hbase.HBaseMailboxSessionMapperFactory; +import org.apache.james.mailbox.hbase.mail.HBaseModSeqProvider; +import org.apache.james.mailbox.hbase.mail.HBaseUidProvider; +import org.apache.james.mailbox.store.MockAuthenticator; +import org.apache.james.mailbox.store.StoreSubscriptionManager; +import org.apache.james.mpt.api.HostSystem; +import org.apache.james.mpt.host.ImapHostSystem; +import org.slf4j.LoggerFactory; + +public class HBaseHostSystem extends ImapHostSystem { + + public static final String META_DATA_DIRECTORY = "target/user-meta-data"; + public static HBaseHostSystem host = null; + /** Set this to false if you wish to test it against a real cluster. + * In that case you should provide the configuration file for the real + * cluster on the classpath. + */ + public static Boolean useMiniCluster = true; + + private final HBaseMailboxManager mailboxManager; + private final MockAuthenticator userManager; + private MiniHBaseCluster hbaseCluster; + private Configuration conf; + + public static synchronized HostSystem build() throws Exception { + if (host == null) { + host = new HBaseHostSystem(useMiniCluster); + } + return host; + } + + public HBaseHostSystem(boolean useMiniCluster) throws Exception { + if (useMiniCluster) { + HBaseTestingUtility htu = new HBaseTestingUtility(); + htu.getConfiguration().setBoolean("dfs.support.append", true); + try { + hbaseCluster = htu.startMiniCluster(); + conf = hbaseCluster.getConfiguration(); + } catch (Exception e) { + throw new Exception("Error starting MiniCluster ", e); + } + } else { + conf = HBaseConfiguration.create(); + } + + userManager = new MockAuthenticator(); + + final HBaseModSeqProvider modSeqProvider = new HBaseModSeqProvider(conf); + final HBaseUidProvider uidProvider = new HBaseUidProvider(conf); + + final HBaseMailboxSessionMapperFactory mapperFactory = new HBaseMailboxSessionMapperFactory( + conf, uidProvider, modSeqProvider); + MailboxACLResolver aclResolver = new UnionMailboxACLResolver(); + GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver(); + + mailboxManager = new HBaseMailboxManager(mapperFactory, userManager, aclResolver, groupMembershipResolver); + mailboxManager.init(); + + SubscriptionManager subscriptionManager = new StoreSubscriptionManager(mapperFactory); + + final ImapProcessor defaultImapProcessorFactory = DefaultImapProcessorFactory.createDefaultProcessor(mailboxManager, subscriptionManager); + + resetUserMetaData(); + + configure(new DefaultImapDecoderFactory().buildImapDecoder(), + new DefaultImapEncoderFactory().buildImapEncoder(), + defaultImapProcessorFactory); + } + + @Override + protected void resetData() throws Exception { + resetUserMetaData(); + MailboxSession session = mailboxManager.createSystemSession("test", LoggerFactory.getLogger("TestLog")); + mailboxManager.startProcessingRequest(session); + mailboxManager.deleteEverything(session); + mailboxManager.endProcessingRequest(session); + mailboxManager.logout(session, false); + } + + public boolean addUser(String user, String password) { + userManager.addUser(user, password); + return true; + } + + public final void resetUserMetaData() throws Exception { + File dir = new File(META_DATA_DIRECTORY); + if (dir.exists()) { + FileUtils.deleteDirectory(dir); + } + dir.mkdirs(); + } + + @Override + protected void finalize() throws Throwable { + super.finalize(); + if (useMiniCluster) { + if (hbaseCluster != null) { + hbaseCluster.shutdown(); + } + } + } +} Added: james/mpt/trunk/impl/imap-mailbox/inmemory/LICENSE.txt URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/inmemory/LICENSE.txt?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/inmemory/LICENSE.txt (added) +++ james/mpt/trunk/impl/imap-mailbox/inmemory/LICENSE.txt Fri May 29 05:16:50 2015 @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS \ No newline at end of file Added: james/mpt/trunk/impl/imap-mailbox/inmemory/NOTICE.txt URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/inmemory/NOTICE.txt?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/inmemory/NOTICE.txt (added) +++ james/mpt/trunk/impl/imap-mailbox/inmemory/NOTICE.txt Fri May 29 05:16:50 2015 @@ -0,0 +1,11 @@ + +========================================================================= +== NOTICE file for use with the Apache License, Version 2.0, == +========================================================================= + +Apache JAMES +Copyright 2007-2008 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + \ No newline at end of file Added: james/mpt/trunk/impl/imap-mailbox/inmemory/pom.xml URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/inmemory/pom.xml?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/inmemory/pom.xml (added) +++ james/mpt/trunk/impl/imap-mailbox/inmemory/pom.xml Fri May 29 05:16:50 2015 @@ -0,0 +1,63 @@ +<?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/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <artifactId>apache-james-mpt-imapmailbox</artifactId> + <groupId>org.apache.james</groupId> + <version>0.2-SNAPSHOT</version> + </parent> + + <artifactId>apache-james-mpt-imapmailbox-inmemory</artifactId> + <name>Apache James MPT Imap Mailbox - InMemory</name> + + <dependencies> + <dependency> + <groupId>org.apache.james</groupId> + <artifactId>apache-james-mpt-imapmailbox-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.james</groupId> + <artifactId>apache-james-mailbox-memory</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>**/suite/*.java</exclude> + <exclude>**/suite/**/*.java</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> +</project> + Added: james/mpt/trunk/impl/imap-mailbox/inmemory/src/reporting-site/site.xml URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/inmemory/src/reporting-site/site.xml?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/inmemory/src/reporting-site/site.xml (added) +++ james/mpt/trunk/impl/imap-mailbox/inmemory/src/reporting-site/site.xml Fri May 29 05:16:50 2015 @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + 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 name="${project.name}"> + + <body> + + <menu ref="reports" /> + + </body> + +</project> Added: james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxTest.java URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxTest.java?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxTest.java (added) +++ james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxTest.java Fri May 29 05:16:50 2015 @@ -0,0 +1,27 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.james.mpt.imapmailbox.inmemory; + +import org.apache.james.mpt.imapmailbox.AbstractMailboxTest; +import org.apache.onami.test.annotation.GuiceModules; + +@GuiceModules({ InMemoryMailboxTestModule.class }) +public class InMemoryMailboxTest extends AbstractMailboxTest { + +} Added: james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxTestModule.java URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxTestModule.java?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxTestModule.java (added) +++ james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxTestModule.java Fri May 29 05:16:50 2015 @@ -0,0 +1,40 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.james.mpt.imapmailbox.inmemory; + +import org.apache.james.mpt.api.HostSystem; +import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem; + +import com.google.inject.AbstractModule; +import com.google.inject.Provides; +import com.google.inject.Singleton; + +public class InMemoryMailboxTestModule extends AbstractModule { + + @Override + protected void configure() { + } + + @Provides + @Singleton + public HostSystem provideHostSystem() throws Exception { + return InMemoryHostSystem.build(); + } + +} Added: james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java?rev=1682367&view=auto ============================================================================== --- james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java (added) +++ james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java Fri May 29 05:16:50 2015 @@ -0,0 +1,78 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.mpt.imapmailbox.inmemory.host; + +import org.apache.james.imap.api.process.ImapProcessor; +import org.apache.james.imap.encode.main.DefaultImapEncoderFactory; +import org.apache.james.imap.main.DefaultImapDecoderFactory; +import org.apache.james.imap.processor.main.DefaultImapProcessorFactory; +import org.apache.james.mailbox.acl.GroupMembershipResolver; +import org.apache.james.mailbox.acl.MailboxACLResolver; +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.InMemoryMailboxSessionMapperFactory; +import org.apache.james.mailbox.store.MockAuthenticator; +import org.apache.james.mailbox.store.StoreMailboxManager; +import org.apache.james.mailbox.store.StoreSubscriptionManager; +import org.apache.james.mpt.api.HostSystem; +import org.apache.james.mpt.host.ImapHostSystem; + +public class InMemoryHostSystem extends ImapHostSystem { + + private StoreMailboxManager<Long> mailboxManager; + private MockAuthenticator userManager; + private InMemoryMailboxSessionMapperFactory factory; + + public static HostSystem build() throws Exception { + InMemoryHostSystem host = new InMemoryHostSystem(); + return host; + } + + private InMemoryHostSystem() throws MailboxException { + initFields(); + } + + public boolean addUser(String user, String password) throws Exception { + userManager.addUser(user, password); + return true; + } + + @Override + protected void resetData() throws Exception { + initFields(); + } + + private void initFields() throws MailboxException { + userManager = new MockAuthenticator(); + factory = new InMemoryMailboxSessionMapperFactory(); + MailboxACLResolver aclResolver = new UnionMailboxACLResolver(); + GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver(); + + mailboxManager = new StoreMailboxManager<Long>(factory, userManager, aclResolver, groupMembershipResolver); + mailboxManager.init(); + + final ImapProcessor defaultImapProcessorFactory = DefaultImapProcessorFactory.createDefaultProcessor(mailboxManager, new StoreSubscriptionManager(factory)); + configure(new DefaultImapDecoderFactory().buildImapDecoder(), + new DefaultImapEncoderFactory().buildImapEncoder(), + defaultImapProcessorFactory); + } + +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
