james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject svn commit: r1455020 - in /james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox: ./ suite/ suite/base/ user/
Date Mon, 11 Mar 2013 06:59:59 GMT
Author: eric
Date: Mon Mar 11 06:59:58 2013
New Revision: 1455020

URL: http://svn.apache.org/r1455020
Log:
Simple repackaging and renaming of base protocol classes (MPT-4)

Added:
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapHostSystem.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapSessionImpl.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseAuthenticatedState.java
      - copied, changed from r1455017, james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForAuthenticatedState.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseImapProtocol.java
      - copied, changed from r1455017, james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapProtocolFramework.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseNonAuthenticatedState.java
      - copied, changed from r1455017, james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForNonAuthenticatedState.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseSelectedInbox.java
      - copied, changed from r1455017, james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForSelectedInbox.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseSelectedState.java
      - copied, changed from r1455017, james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForSelectedStateBase.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/user/
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/user/InMemoryMailboxUserManager.java   (with props)
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/user/MailboxUser.java   (with props)
Removed:
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForAuthenticatedState.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForNonAuthenticatedState.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForSelectedInbox.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForSelectedStateBase.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapProtocolFramework.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/InMemoryUserManager.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/User.java
Modified:
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/AuthenticatedState.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/ConcurrentSessions.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Events.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Expunge.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Fetch.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchBodySection.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchBodyStructure.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchHeaders.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Listing.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/NonAuthenticatedState.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/PartialFetch.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Rename.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Search.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Security.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Select.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/SelectedInbox.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/SelectedState.java
    james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/UidSearch.java

Added: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapHostSystem.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapHostSystem.java?rev=1455020&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapHostSystem.java (added)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapHostSystem.java Mon Mar 11 06:59:58 2013
@@ -0,0 +1,261 @@
+/****************************************************************
+ * 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;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetEncoder;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.james.imap.api.process.ImapProcessor;
+import org.apache.james.imap.decode.ImapDecoder;
+import org.apache.james.imap.decode.main.ImapRequestStreamHandler;
+import org.apache.james.imap.encode.ImapEncoder;
+import org.apache.james.mailbox.MailboxSession.User;
+import org.apache.james.mpt.Continuation;
+import org.apache.james.mpt.HostSystem;
+import org.slf4j.LoggerFactory;
+
+public abstract class ImapHostSystem implements HostSystem {
+
+    private ImapDecoder decoder;
+
+    private ImapEncoder encoder;
+
+    private ImapProcessor processor;
+
+    private final Set<User> users;
+
+    public ImapHostSystem() {
+        super();
+        users = new HashSet<User>();
+    }
+
+    public void configure(final ImapDecoder decoder, final ImapEncoder encoder,
+            final ImapProcessor processor) {
+        this.decoder = decoder;
+        this.encoder = encoder;
+        this.processor = processor;
+    }
+
+    public Session newSession(Continuation continuation)
+            throws Exception {
+        return new Session(continuation);
+    }
+
+    public final void reset() throws Exception {
+        users.clear();
+        
+        resetData();
+    }
+    
+    protected abstract void resetData() throws Exception;
+
+    public String getHelloName() {
+        return "JAMES";
+    }
+
+    public ImapDecoder getImapDecoder() {
+        return decoder;
+    }
+
+    public ImapEncoder getImapEncoder() {
+        return encoder;
+    }
+
+    public ImapProcessor getImapProcessor() {
+        return processor;
+    }
+
+    public int getResetLength() {
+        return Integer.MAX_VALUE;
+    }
+
+    public int countUsers() {
+        return users.size();
+    }
+
+    public String getRealName(String name) {
+        return name;
+    }
+
+    class Session implements org.apache.james.mpt.Session {
+        ByteBufferOutputStream out;
+
+        ByteBufferInputStream in;
+
+        ImapRequestStreamHandler handler;
+
+        ImapSessionImpl session;
+
+        boolean isReadLast = true;
+
+        public Session(Continuation continuation) {
+            out = new ByteBufferOutputStream(continuation);
+            in = new ByteBufferInputStream();
+            handler = new ImapRequestStreamHandler(decoder, processor, encoder);
+            session = new ImapSessionImpl(LoggerFactory.getLogger("sessionLog"));
+        }
+
+        public String readLine() throws Exception {
+            if (!isReadLast) {
+                handler.handleRequest(in, out, session);
+                isReadLast = true;
+            }
+            final String result = out.nextLine();
+            return result;
+        }
+
+        public void start() throws Exception {
+            // Welcome message handled in the server
+            out.write("* OK IMAP4rev1 Server ready\r\n");
+        }
+
+        public void stop() throws Exception {
+            session.deselect();
+        }
+
+        public void writeLine(String line) throws Exception {
+            isReadLast = false;
+            in.nextLine(line);
+        }
+
+        public void forceConnectionClose(String byeMessage) {
+            try {
+                out.write(byeMessage);
+                session.deselect();
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+    }
+
+    static class ByteBufferInputStream extends InputStream {
+
+        ByteBuffer buffer = ByteBuffer.allocate(16384);
+
+        CharsetEncoder encoder = Charset.forName("ASCII").newEncoder();
+
+        boolean readLast = true;
+
+        public int read() throws IOException {
+            if (!readLast) {
+                readLast = true;
+                buffer.flip();
+            }
+            int result = -1;
+            if (buffer.hasRemaining()) {
+                result = buffer.get();
+            }
+            return result;
+        }
+
+        public void nextLine(String line) {
+            if (buffer.position() > 0 && readLast) {
+                buffer.compact();
+            }
+            encoder.encode(CharBuffer.wrap(line), buffer, true);
+            buffer.put((byte) '\r');
+            buffer.put((byte) '\n');
+            readLast = false;
+        }
+    }
+
+    static class ByteBufferOutputStream extends OutputStream {
+        ByteBuffer buffer = ByteBuffer.allocate(65536);
+
+        Charset ascii = Charset.forName("ASCII");
+
+        Continuation continuation;
+
+        boolean matchPlus = false;
+
+        boolean matchCR = false;
+
+        boolean matchLF = false;
+
+        public ByteBufferOutputStream(Continuation continuation) {
+            this.continuation = continuation;
+        }
+
+        public void write(String message) throws IOException {
+            ascii.newEncoder().encode(CharBuffer.wrap(message), buffer, true);
+        }
+
+        public void write(int b) throws IOException {
+            buffer.put((byte) b);
+            if (b == '\n' && matchPlus && matchCR && matchLF) {
+                matchPlus = false;
+                matchCR = false;
+                matchLF = false;
+                continuation.doContinue();
+            } else if (b == '\n') {
+                matchLF = true;
+                matchPlus = false;
+                matchCR = false;
+            } else if (b == '+' && matchLF) {
+                matchPlus = true;
+                matchCR = false;
+            } else if (b == '\r' && matchPlus && matchLF) {
+                matchCR = true;
+            } else {
+                matchPlus = false;
+                matchCR = false;
+                matchLF = false;
+            }
+        }
+
+        public String nextLine() throws Exception {
+            buffer.flip();
+            byte last = 0;
+            while (buffer.hasRemaining()) {
+                byte next = buffer.get();
+                if (last == '\r' && next == '\n') {
+                    break;
+                }
+                last = next;
+            }
+            final ByteBuffer readOnlyBuffer = buffer.asReadOnlyBuffer();
+            readOnlyBuffer.flip();
+            int limit = readOnlyBuffer.limit() - 2;
+            if (limit < 0) {
+                limit = 0;
+            }
+            readOnlyBuffer.limit(limit);
+            String result = ascii.decode(readOnlyBuffer).toString();
+            buffer.compact();
+            return result;
+        }
+    }
+
+    public void afterTests() throws Exception {
+        // default do nothing
+    }
+
+    public void beforeTests() throws Exception {
+        // default do nothing
+    }
+    
+}

Added: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapSessionImpl.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapSessionImpl.java?rev=1455020&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapSessionImpl.java (added)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapSessionImpl.java Mon Mar 11 06:59:58 2013
@@ -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;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.james.imap.api.ImapSessionState;
+import org.apache.james.imap.api.process.ImapLineHandler;
+import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.api.process.SelectedMailbox;
+import org.slf4j.Logger;
+
+public class ImapSessionImpl implements ImapSession {
+
+    private ImapSessionState state = ImapSessionState.NON_AUTHENTICATED;
+
+    private SelectedMailbox selectedMailbox = null;
+
+    private final Map<String, Object> attributesByKey;
+
+    private Logger log;
+
+    public ImapSessionImpl(Logger log) {
+        this.attributesByKey = new ConcurrentHashMap<String, Object>();
+        this.log = log;
+    }
+
+    public void logout() {
+        closeMailbox();
+        state = ImapSessionState.LOGOUT;
+    }
+
+    public void authenticated() {
+        this.state = ImapSessionState.AUTHENTICATED;
+    }
+
+    public void deselect() {
+        this.state = ImapSessionState.AUTHENTICATED;
+        closeMailbox();
+    }
+
+    public void selected(SelectedMailbox mailbox) {
+        this.state = ImapSessionState.SELECTED;
+        closeMailbox();
+        this.selectedMailbox = mailbox;
+    }
+
+    public SelectedMailbox getSelected() {
+        return this.selectedMailbox;
+    }
+
+    public ImapSessionState getState() {
+        return this.state;
+    }
+
+    public void closeMailbox() {
+        if (selectedMailbox != null) {
+            selectedMailbox.deselect();
+            selectedMailbox = null;
+        }
+    }
+
+    public Object getAttribute(String key) {
+        final Object result = attributesByKey.get(key);
+        return result;
+    }
+
+    public void setAttribute(String key, Object value) {
+        if (value == null) {
+            attributesByKey.remove(key);
+        }
+        else {
+            attributesByKey.put(key, value);
+        }
+    }
+
+    public Logger getLog() {
+        return log;
+    }
+
+    public boolean startTLS() {
+        return false;
+    }
+
+    public boolean supportStartTLS() {
+        return false;
+    }
+
+    public boolean isCompressionSupported() {
+        return false;
+    }
+
+    public boolean startCompression() {
+        return false;
+    }
+
+    public void pushLineHandler(ImapLineHandler lineHandler) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void popLineHandler() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public boolean isPlainAuthDisallowed() {
+        return false;
+    }
+
+    public boolean isTLSActive() {
+        return false;
+    }
+
+    public boolean supportMultipleNamespaces() {
+        return false;
+    }
+
+    public boolean isCompressionActive() {
+        return false;
+    }
+
+}

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/AuthenticatedState.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/AuthenticatedState.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/AuthenticatedState.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/AuthenticatedState.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForAuthenticatedState;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseAuthenticatedState;
 import org.junit.Test;
 
-public abstract class AuthenticatedState extends FrameworkForAuthenticatedState {
+public abstract class AuthenticatedState extends BaseAuthenticatedState {
 
     public AuthenticatedState(HostSystem system)
             throws Exception {

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/ConcurrentSessions.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/ConcurrentSessions.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/ConcurrentSessions.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/ConcurrentSessions.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForAuthenticatedState;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseAuthenticatedState;
 import org.junit.Test;
 
-public abstract class ConcurrentSessions extends FrameworkForAuthenticatedState {
+public abstract class ConcurrentSessions extends BaseAuthenticatedState {
 
     public ConcurrentSessions(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Events.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Events.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Events.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Events.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForSelectedStateBase;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseSelectedState;
 import org.junit.Test;
 
-public abstract class Events extends FrameworkForSelectedStateBase {
+public abstract class Events extends BaseSelectedState {
 
     public Events(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Expunge.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Expunge.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Expunge.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Expunge.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForSelectedStateBase;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseSelectedState;
 import org.junit.Test;
 
-public abstract class Expunge extends FrameworkForSelectedStateBase {
+public abstract class Expunge extends BaseSelectedState {
 
     public Expunge(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Fetch.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Fetch.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Fetch.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Fetch.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForSelectedStateBase;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseSelectedState;
 import org.junit.Test;
 
-public abstract class Fetch extends FrameworkForSelectedStateBase {
+public abstract class Fetch extends BaseSelectedState {
 
     public Fetch(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchBodySection.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchBodySection.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchBodySection.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchBodySection.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForSelectedStateBase;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseSelectedState;
 import org.junit.Test;
 
-public abstract class FetchBodySection extends FrameworkForSelectedStateBase {
+public abstract class FetchBodySection extends BaseSelectedState {
 
     public FetchBodySection(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchBodyStructure.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchBodyStructure.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchBodyStructure.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchBodyStructure.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForSelectedStateBase;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseSelectedState;
 import org.junit.Test;
 
-public abstract class FetchBodyStructure extends FrameworkForSelectedStateBase {
+public abstract class FetchBodyStructure extends BaseSelectedState {
 
     public FetchBodyStructure(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchHeaders.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchHeaders.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchHeaders.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/FetchHeaders.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForSelectedStateBase;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseSelectedState;
 import org.junit.Test;
 
-public abstract class FetchHeaders extends FrameworkForSelectedStateBase {
+public abstract class FetchHeaders extends BaseSelectedState {
 
     public FetchHeaders(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Listing.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Listing.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Listing.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Listing.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForAuthenticatedState;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseAuthenticatedState;
 import org.junit.Test;
 
-public abstract class Listing extends FrameworkForAuthenticatedState {
+public abstract class Listing extends BaseAuthenticatedState {
 
     public Listing(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/NonAuthenticatedState.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/NonAuthenticatedState.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/NonAuthenticatedState.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/NonAuthenticatedState.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForNonAuthenticatedState;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseNonAuthenticatedState;
 import org.junit.Test;
 
-public abstract class NonAuthenticatedState extends FrameworkForNonAuthenticatedState {
+public abstract class NonAuthenticatedState extends BaseNonAuthenticatedState {
 
     public NonAuthenticatedState(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/PartialFetch.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/PartialFetch.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/PartialFetch.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/PartialFetch.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForSelectedStateBase;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseSelectedState;
 import org.junit.Test;
 
-public abstract class PartialFetch extends FrameworkForSelectedStateBase {
+public abstract class PartialFetch extends BaseSelectedState {
 
     public PartialFetch(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Rename.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Rename.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Rename.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Rename.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForSelectedStateBase;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseSelectedState;
 import org.junit.Test;
 
-public abstract class Rename extends FrameworkForSelectedStateBase {
+public abstract class Rename extends BaseSelectedState {
 
     public Rename(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Search.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Search.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Search.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Search.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForAuthenticatedState;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseAuthenticatedState;
 import org.junit.Test;
 
-public abstract class Search extends FrameworkForAuthenticatedState {
+public abstract class Search extends BaseAuthenticatedState {
 
     public Search(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Security.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Security.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Security.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Security.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.ImapProtocolFramework;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseImapProtocol;
 import org.junit.Test;
 
-public abstract class Security extends ImapProtocolFramework {
+public abstract class Security extends BaseImapProtocol {
 
     public Security(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Select.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Select.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Select.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/Select.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForAuthenticatedState;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseAuthenticatedState;
 import org.junit.Test;
 
-public abstract class Select extends FrameworkForAuthenticatedState {
+public abstract class Select extends BaseAuthenticatedState {
 
     public Select(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/SelectedInbox.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/SelectedInbox.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/SelectedInbox.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/SelectedInbox.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForSelectedInbox;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseSelectedInbox;
 import org.junit.Test;
 
-public abstract class SelectedInbox extends FrameworkForSelectedInbox {
+public abstract class SelectedInbox extends BaseSelectedInbox {
 
     public SelectedInbox(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/SelectedState.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/SelectedState.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/SelectedState.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/SelectedState.java Mon Mar 11 06:59:58 2013
@@ -22,10 +22,10 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForSelectedStateBase;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseSelectedState;
 import org.junit.Test;
 
-public abstract class SelectedState extends FrameworkForSelectedStateBase {
+public abstract class SelectedState extends BaseSelectedState {
 
     public SelectedState(HostSystem system) throws Exception {
         super(system);

Modified: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/UidSearch.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/UidSearch.java?rev=1455020&r1=1455019&r2=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/UidSearch.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/UidSearch.java Mon Mar 11 06:59:58 2013
@@ -22,11 +22,11 @@ package org.apache.james.mpt.imapmailbox
 import java.util.Locale;
 
 import org.apache.james.mpt.HostSystem;
-import org.apache.james.mpt.imapmailbox.FrameworkForAuthenticatedState;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseAuthenticatedState;
 import org.junit.Test;
 
 public abstract class UidSearch extends
-        FrameworkForAuthenticatedState {
+        BaseAuthenticatedState {
 
     public UidSearch(HostSystem system) throws Exception {
         super(system);

Copied: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseAuthenticatedState.java (from r1455017, james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForAuthenticatedState.java)
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseAuthenticatedState.java?p2=james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseAuthenticatedState.java&p1=james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForAuthenticatedState.java&r1=1455017&r2=1455020&rev=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForAuthenticatedState.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseAuthenticatedState.java Mon Mar 11 06:59:58 2013
@@ -17,9 +17,10 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mpt.imapmailbox;
+package org.apache.james.mpt.imapmailbox.suite.base;
 
 import org.apache.james.mpt.HostSystem;
+import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.junit.Before;
 
 /**
@@ -57,9 +58,9 @@ import org.junit.Before;
  * </ul>
  * </p>
  */
-public abstract class FrameworkForAuthenticatedState extends
-        ImapProtocolFramework implements ImapTestConstants {
-    public FrameworkForAuthenticatedState(HostSystem hostSystem) throws Exception {
+public abstract class BaseAuthenticatedState extends
+        BaseImapProtocol implements ImapTestConstants {
+    public BaseAuthenticatedState(HostSystem hostSystem) throws Exception {
         super(hostSystem);
     }
 

Copied: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseImapProtocol.java (from r1455017, james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapProtocolFramework.java)
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseImapProtocol.java?p2=james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseImapProtocol.java&p1=james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapProtocolFramework.java&r1=1455017&r2=1455020&rev=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/ImapProtocolFramework.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseImapProtocol.java Mon Mar 11 06:59:58 2013
@@ -16,17 +16,18 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.mpt.imapmailbox;
+package org.apache.james.mpt.imapmailbox.suite.base;
 
 import org.apache.james.mpt.AbstractSimpleScriptedTestProtocol;
 import org.apache.james.mpt.HostSystem;
+import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 
 /**
  * Specialise the protocol test framework for IMAP.
  */
-public abstract class ImapProtocolFramework extends AbstractSimpleScriptedTestProtocol implements ImapTestConstants {
+public abstract class BaseImapProtocol extends AbstractSimpleScriptedTestProtocol implements ImapTestConstants {
 
-    public ImapProtocolFramework(final HostSystem hostSystem) throws Exception {
+    public BaseImapProtocol(final HostSystem hostSystem) throws Exception {
         super(hostSystem, USER, PASSWORD, "/org/apache/james/imap/scripts/");
     }
 

Copied: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseNonAuthenticatedState.java (from r1455017, james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForNonAuthenticatedState.java)
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseNonAuthenticatedState.java?p2=james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseNonAuthenticatedState.java&p1=james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForNonAuthenticatedState.java&r1=1455017&r2=1455020&rev=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForNonAuthenticatedState.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseNonAuthenticatedState.java Mon Mar 11 06:59:58 2013
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mpt.imapmailbox;
+package org.apache.james.mpt.imapmailbox.suite.base;
 
 import org.apache.james.mpt.HostSystem;
 import org.junit.Before;
@@ -40,8 +40,8 @@ import org.junit.Before;
  * <li>Login</li>
  * </ul>
  */
-public abstract class FrameworkForNonAuthenticatedState extends ImapProtocolFramework {
-    public FrameworkForNonAuthenticatedState(HostSystem system) throws Exception {
+public abstract class BaseNonAuthenticatedState extends BaseImapProtocol {
+    public BaseNonAuthenticatedState(HostSystem system) throws Exception {
         super(system);
     }
 

Copied: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseSelectedInbox.java (from r1455017, james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForSelectedInbox.java)
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseSelectedInbox.java?p2=james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseSelectedInbox.java&p1=james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForSelectedInbox.java&r1=1455017&r2=1455020&rev=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForSelectedInbox.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseSelectedInbox.java Mon Mar 11 06:59:58 2013
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mpt.imapmailbox;
+package org.apache.james.mpt.imapmailbox.suite.base;
 
 import org.apache.james.mpt.HostSystem;
 
@@ -51,8 +51,8 @@ import org.apache.james.mpt.HostSystem;
  * 
  * @version $Revision: 560719 $
  */
-public abstract class FrameworkForSelectedInbox extends FrameworkForAuthenticatedState {
-    public FrameworkForSelectedInbox(HostSystem system) throws Exception {
+public abstract class BaseSelectedInbox extends BaseAuthenticatedState {
+    public BaseSelectedInbox(HostSystem system) throws Exception {
         super(system);
     }
 

Copied: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseSelectedState.java (from r1455017, james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForSelectedStateBase.java)
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseSelectedState.java?p2=james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseSelectedState.java&p1=james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForSelectedStateBase.java&r1=1455017&r2=1455020&rev=1455020&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/FrameworkForSelectedStateBase.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/suite/base/BaseSelectedState.java Mon Mar 11 06:59:58 2013
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mpt.imapmailbox;
+package org.apache.james.mpt.imapmailbox.suite.base;
 
 import org.apache.james.mpt.HostSystem;
 import org.junit.Before;
@@ -42,9 +42,9 @@ import org.junit.Before;
  * <li>Uid"</li>
  * </ul>
  */
-public abstract class FrameworkForSelectedStateBase extends FrameworkForAuthenticatedState {
+public abstract class BaseSelectedState extends BaseAuthenticatedState {
     
-    public FrameworkForSelectedStateBase(HostSystem system) throws Exception {
+    public BaseSelectedState(HostSystem system) throws Exception {
         super(system);
     }
 

Added: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/user/InMemoryMailboxUserManager.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/user/InMemoryMailboxUserManager.java?rev=1455020&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/user/InMemoryMailboxUserManager.java (added)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/user/InMemoryMailboxUserManager.java Mon Mar 11 06:59:58 2013
@@ -0,0 +1,103 @@
+/****************************************************************
+ * 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.user;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.SubscriptionManager;
+import org.apache.james.mailbox.exception.SubscriptionException;
+
+/**
+ * Stores users in memory.
+ */
+public class InMemoryMailboxUserManager implements SubscriptionManager {
+
+    private final Map<String, MailboxUser> users;
+
+    public InMemoryMailboxUserManager() {
+        this.users = new HashMap<String, MailboxUser>();
+    }
+
+    public boolean isAuthentic(String userid, CharSequence password) {
+        MailboxUser user = (MailboxUser) users.get(userid);
+        final boolean result;
+        if (user == null) {
+            result = false;
+        } else {
+            result = user.isPassword(password);
+        }
+        return result;
+    }
+
+    public void subscribe(MailboxSession session, String mailbox)
+            throws SubscriptionException {
+        MailboxSession.User u = session.getUser();
+        MailboxUser user = (MailboxUser) users.get(u.getUserName());
+        if (user == null) {
+            user = new MailboxUser(u.getUserName());
+            users.put(u.getUserName(), user);
+        }
+        user.addSubscription(mailbox);
+    }
+
+    public Collection<String> subscriptions(org.apache.james.mailbox.MailboxSession session) throws SubscriptionException {
+        MailboxSession.User u = session.getUser();
+        MailboxUser user = (MailboxUser) users.get(u.getUserName());
+        if (user == null) {
+            user = new MailboxUser(u.getUserName());
+            users.put(u.getUserName(), user);
+        }
+        return user.getSubscriptions();
+    }
+
+    public void unsubscribe(org.apache.james.mailbox.MailboxSession session, String mailbox)
+            throws SubscriptionException {
+        MailboxSession.User u = session.getUser();
+        MailboxUser user = (MailboxUser) users.get(u.getUserName());
+        if (user == null) {
+            user = new MailboxUser(u.getUserName());
+            users.put(u.getUserName(), user);
+        }
+        user.removeSubscription(mailbox);
+    }
+
+    public void addUser(String userid, CharSequence password) {
+        MailboxUser user = (MailboxUser) users.get(userid);
+        if (user == null) {
+            user = new MailboxUser(userid);
+            users.put(userid, user);
+        }
+        user.setPassword(password);
+    }
+
+    public void endProcessingRequest(MailboxSession session) {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void startProcessingRequest(MailboxSession session) {
+        // TODO Auto-generated method stub
+        
+    }
+
+}

Propchange: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/user/InMemoryMailboxUserManager.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Added: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/user/MailboxUser.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/user/MailboxUser.java?rev=1455020&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/user/MailboxUser.java (added)
+++ james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/user/MailboxUser.java Mon Mar 11 06:59:58 2013
@@ -0,0 +1,77 @@
+/****************************************************************
+ * 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.user;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+class MailboxUser {
+    private final String userName;
+
+    private CharSequence password;
+
+    private final Set<String> subscriptions;
+
+    public MailboxUser(final String userName) {
+        this.userName = userName;
+        this.subscriptions = new HashSet<String>();
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+    
+    public void setPassword(CharSequence password) {
+        this.password = password;
+    }
+
+    public Collection<String> getSubscriptions() {
+        return Collections.unmodifiableSet(subscriptions);
+    }
+
+    public void addSubscription(String subscription) {
+        this.subscriptions.add(subscription);
+    }
+
+    public void removeSubscription(String mailbox) {
+        this.subscriptions.remove(mailbox);
+    }
+
+    public boolean isPassword(CharSequence password) {
+        final boolean result;
+        if (password == null) {
+            result = this.password == null;
+        } else if (this.password == null) {
+            result = false;            
+        } else if (this.password.length() == password.length()) {
+            for (int i=0;i<password.length();i++) {
+                if (password.charAt(i) != this.password.charAt(i)) {
+                    return false;
+                }
+            }
+            result = true;
+        } else {
+            result = false;
+        }
+        return result;
+    }
+}

Propchange: james/mpt/trunk/impl/imap-mailbox/src/test/java/org/apache/james/mpt/imapmailbox/user/MailboxUser.java
------------------------------------------------------------------------------
    svn:mergeinfo = 



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


Mime
View raw message