You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by rd...@apache.org on 2008/09/18 23:45:03 UTC
svn commit: r696828 [18/32] - in /james/protocols/imap/trunk:
api/src/main/java/org/apache/james/api/imap/
api/src/main/java/org/apache/james/api/imap/display/
api/src/main/java/org/apache/james/api/imap/imap4rev1/
api/src/main/java/org/apache/james/ap...
Modified: james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/CreateScript.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/CreateScript.java?rev=696828&r1=696827&r2=696828&view=diff
==============================================================================
--- james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/CreateScript.java (original)
+++ james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/CreateScript.java Thu Sep 18 14:44:56 2008
@@ -20,24 +20,34 @@
package org.apache.james.test.functional;
public class CreateScript {
-
+
public static final String RE = "Re:";
+
public static final String HEADER = "Delivered-To";
+
public static final String ANOTHER_HEADER = "Received";
+
public static final String COMMON_LETTER = "o";
+
public static final String COMMON_WORD = "the";
+
public static final String UNCOMMON_WORD = "thy";
+
public static final String UNCOMMON_PHRASE = "\"nothing worthy prove\"";
+
public static final String ANOTHER_NAME = "Robert";
+
public static final String NAME = "tim";
+
public static final String DOMAIN = "example.org";
+
public static final String ANOTHER_DOMAIN = "apache.org";
public static final void main(String[] args) throws Exception {
ScriptBuilder builder = ScriptBuilder.open("localhost", 143);
rfcFetch(builder);
}
-
+
public static void rfcFetch(ScriptBuilder builder) throws Exception {
try {
setup(builder);
@@ -72,8 +82,9 @@
builder.quit();
}
}
-
- public static void bodyStructureEmbedded(ScriptBuilder builder) throws Exception {
+
+ public static void bodyStructureEmbedded(ScriptBuilder builder)
+ throws Exception {
builder.login();
builder.create();
builder.select();
@@ -103,8 +114,9 @@
builder.fetchAllMessages();
builder.quit();
}
-
- public static void bodyStructureComplex(ScriptBuilder builder) throws Exception {
+
+ public static void bodyStructureComplex(ScriptBuilder builder)
+ throws Exception {
builder.login();
builder.create();
builder.select();
@@ -121,7 +133,7 @@
builder.setFile("mime-plain-text.mail");
builder.append();
builder.fetchAllMessages();
- for (int i=1;i<7;i++) {
+ for (int i = 1; i < 7; i++) {
builder.setMessageNumber(i);
builder.fetchSection("");
builder.fetchSection("TEXT");
@@ -148,8 +160,9 @@
builder.fetchAllMessages();
builder.quit();
}
-
- public static void bodyStructureSimple(ScriptBuilder builder) throws Exception {
+
+ public static void bodyStructureSimple(ScriptBuilder builder)
+ throws Exception {
builder.login();
builder.create();
builder.select();
@@ -184,8 +197,9 @@
builder.fetchAllMessages();
builder.quit();
}
-
- public static void bodyStructureMultipart(ScriptBuilder builder) throws Exception {
+
+ public static void bodyStructureMultipart(ScriptBuilder builder)
+ throws Exception {
builder.login();
builder.create();
builder.select();
@@ -218,7 +232,7 @@
builder.fetchAllMessages();
builder.quit();
}
-
+
public static void renameSelected(ScriptBuilder builder) throws Exception {
builder.login();
builder.create();
@@ -233,7 +247,8 @@
builder.setFile("rfc822-multiple-addresses.mail");
builder.append();
builder.select();
- builder.getFetch().setFlagsFetch(true).bodyPeekHeaders(ScriptBuilder.Fetch.SELECT_HEADERS).setUid(true);
+ builder.getFetch().setFlagsFetch(true).bodyPeekHeaders(
+ ScriptBuilder.Fetch.SELECT_HEADERS).setUid(true);
builder.fetchAllMessages();
builder.list();
builder.rename("anothermailbox");
@@ -248,7 +263,7 @@
builder.fetchAllMessages();
builder.quit();
}
-
+
public static void renameHierarchy(ScriptBuilder builder) throws Exception {
builder.login();
builder.setMailbox("one").create();
@@ -272,16 +287,18 @@
builder.list();
builder.quit();
}
-
+
public static void rename(ScriptBuilder builder) throws Exception {
setupSearch(builder, true);
builder.select();
String originalMailbox = builder.getMailbox();
- builder.getFetch().setFlagsFetch(true).bodyPeekHeaders(ScriptBuilder.Fetch.SELECT_HEADERS).setUid(true);
+ builder.getFetch().setFlagsFetch(true).bodyPeekHeaders(
+ ScriptBuilder.Fetch.SELECT_HEADERS).setUid(true);
builder.fetchAllMessages();
builder.setMailbox("other").create().select().append();
builder.setMailbox("base").create().select();
- builder.rename(originalMailbox, "moved").setMailbox("moved").select().fetchAllMessages();
+ builder.rename(originalMailbox, "moved").setMailbox("moved").select()
+ .fetchAllMessages();
builder.setMailbox(originalMailbox).select();
builder.rename("other", "base");
builder.setMailbox(originalMailbox).select();
@@ -306,7 +323,8 @@
builder.setMailbox("other").select();
builder.setMailbox("base").select();
builder.setMailbox("BOGUS").select();
- builder.setMailbox("WHATEVER").select();;
+ builder.setMailbox("WHATEVER").select();
+ ;
builder.setMailbox("BOGUS").delete();
builder.setMailbox("WHATEVER").delete();
builder.setMailbox(originalMailbox).delete();
@@ -315,7 +333,7 @@
builder.setMailbox("moved").delete();
builder.quit();
}
-
+
public static void mimePartialFetch(ScriptBuilder builder) throws Exception {
builder.login();
builder.create();
@@ -346,8 +364,9 @@
builder.partial(10000, 2048).fetchSection("4.1.MIME");
builder.quit();
}
-
- public static void headerPartialFetch(ScriptBuilder builder) throws Exception {
+
+ public static void headerPartialFetch(ScriptBuilder builder)
+ throws Exception {
builder.login();
builder.create();
builder.select();
@@ -377,8 +396,7 @@
builder.partial(10000, 2048).fetchSection("HEADER");
builder.quit();
}
-
-
+
public static void textPartialFetch(ScriptBuilder builder) throws Exception {
builder.login();
builder.create();
@@ -409,8 +427,7 @@
builder.partial(10000, 2048).fetchSection("TEXT");
builder.quit();
}
-
-
+
public static void bodyPartialFetch(ScriptBuilder builder) throws Exception {
builder.login();
builder.create();
@@ -435,38 +452,52 @@
builder.partial(10000, 100000).fetchSection("");
builder.quit();
}
-
- public static void searchCombinations(ScriptBuilder builder, boolean uids) throws Exception {
+
+ public static void searchCombinations(ScriptBuilder builder, boolean uids)
+ throws Exception {
setupSearch(builder, uids);
builder.body(COMMON_LETTER).undraft().unflagged().answered().search();
builder.to(COMMON_LETTER).draft().flagged().answered().search();
builder.to(COMMON_LETTER).smaller(10000).all().draft().search();
builder.bcc(COMMON_LETTER).larger(1000).search();
builder.from(COMMON_LETTER).larger(1000).flagged().search();
- builder.from(COMMON_LETTER).to(COMMON_LETTER).answered().flagged().all().body(COMMON_LETTER).sentbefore(2009, 1, 1).search();
- builder.or().openParen().from(COMMON_LETTER).to(COMMON_LETTER).answered().flagged()
- .all().body(COMMON_LETTER).sentbefore(2009, 1, 1).closeParen()
- .openParen().header(HEADER, "\"\"").draft().closeParen().search();
- builder.or().openParen().cc(COMMON_LETTER).text(COMMON_LETTER).unseen().larger(1000)
- .all().body(COMMON_LETTER).senton(2008, 4, 8).closeParen()
- .openParen().header(HEADER, "\"\"").draft().closeParen().search();
- builder.or().openParen().cc(COMMON_LETTER).to(COMMON_LETTER).draft().unseen()
- .all().text(COMMON_LETTER).sentsince(2000, 1, 1).closeParen()
- .openParen().header(HEADER, "\"\"").draft().closeParen().search();
- builder.or().openParen().or().openParen().or().openParen().not().text(COMMON_LETTER).cc(COMMON_LETTER).unseen().flagged()
- .all().body(COMMON_LETTER).not().senton(2008, 3, 1).closeParen()
- .openParen().header(HEADER, DOMAIN).flagged().closeParen().closeParen().
- openParen().from(COMMON_LETTER).to(COMMON_LETTER).answered().flagged().all().body(COMMON_LETTER).sentbefore(2009, 1, 1)
- .closeParen().closeParen().openParen().answered().flagged().draft().closeParen().all().deleted().search();
- builder.or().openParen().or().openParen().or().openParen().from(COMMON_LETTER).to(COMMON_LETTER).answered().flagged()
- .all().body(COMMON_LETTER).sentbefore(2009, 1, 1).closeParen()
- .openParen().header(HEADER, "\"\"").draft().closeParen().closeParen().
- openParen().from(COMMON_LETTER).to(COMMON_LETTER).answered().flagged().all().body(COMMON_LETTER).sentbefore(2009, 1, 1)
- .closeParen().closeParen().openParen().answered().flagged().draft().closeParen().all().unanswered().search();
+ builder.from(COMMON_LETTER).to(COMMON_LETTER).answered().flagged()
+ .all().body(COMMON_LETTER).sentbefore(2009, 1, 1).search();
+ builder.or().openParen().from(COMMON_LETTER).to(COMMON_LETTER)
+ .answered().flagged().all().body(COMMON_LETTER).sentbefore(
+ 2009, 1, 1).closeParen().openParen().header(HEADER,
+ "\"\"").draft().closeParen().search();
+ builder.or().openParen().cc(COMMON_LETTER).text(COMMON_LETTER).unseen()
+ .larger(1000).all().body(COMMON_LETTER).senton(2008, 4, 8)
+ .closeParen().openParen().header(HEADER, "\"\"").draft()
+ .closeParen().search();
+ builder.or().openParen().cc(COMMON_LETTER).to(COMMON_LETTER).draft()
+ .unseen().all().text(COMMON_LETTER).sentsince(2000, 1, 1)
+ .closeParen().openParen().header(HEADER, "\"\"").draft()
+ .closeParen().search();
+ builder.or().openParen().or().openParen().or().openParen().not().text(
+ COMMON_LETTER).cc(COMMON_LETTER).unseen().flagged().all().body(
+ COMMON_LETTER).not().senton(2008, 3, 1).closeParen()
+ .openParen().header(HEADER, DOMAIN).flagged().closeParen()
+ .closeParen().openParen().from(COMMON_LETTER).to(COMMON_LETTER)
+ .answered().flagged().all().body(COMMON_LETTER).sentbefore(
+ 2009, 1, 1).closeParen().closeParen().openParen()
+ .answered().flagged().draft().closeParen().all().deleted()
+ .search();
+ builder.or().openParen().or().openParen().or().openParen().from(
+ COMMON_LETTER).to(COMMON_LETTER).answered().flagged().all()
+ .body(COMMON_LETTER).sentbefore(2009, 1, 1).closeParen()
+ .openParen().header(HEADER, "\"\"").draft().closeParen()
+ .closeParen().openParen().from(COMMON_LETTER).to(COMMON_LETTER)
+ .answered().flagged().all().body(COMMON_LETTER).sentbefore(
+ 2009, 1, 1).closeParen().closeParen().openParen()
+ .answered().flagged().draft().closeParen().all().unanswered()
+ .search();
builder.quit();
}
-
- public static void searchAtoms(ScriptBuilder builder, boolean uids) throws Exception {
+
+ public static void searchAtoms(ScriptBuilder builder, boolean uids)
+ throws Exception {
setupSearch(builder, uids);
builder.all().search();
builder.answered().search();
@@ -581,7 +612,8 @@
builder.quit();
}
- private static void setupSearch(ScriptBuilder builder, boolean uids) throws Exception {
+ private static void setupSearch(ScriptBuilder builder, boolean uids)
+ throws Exception {
builder.setUidSearch(uids);
setup(builder);
padUids(builder);
@@ -602,7 +634,7 @@
builder.store(builder.flags().add().draft().msn(13));
builder.store(builder.flags().add().draft().msn(15));
builder.store(builder.flags().add().draft().msn(17));
- builder.store(builder.flags().add().deleted().range(1,3));
+ builder.store(builder.flags().add().deleted().range(1, 3));
}
private static void setup(ScriptBuilder builder) throws Exception {
@@ -613,12 +645,12 @@
private static void padUids(ScriptBuilder builder) throws Exception {
builder.setFile("rfc822.mail");
- for (int i=0;i<20;i++) {
+ for (int i = 0; i < 20; i++) {
builder.append();
builder.flagDeleted().expunge();
}
}
-
+
private static void loadLotsOfMail(ScriptBuilder builder) throws Exception {
builder.append();
builder.setFile("wild-example.mail");
@@ -658,7 +690,7 @@
builder.setFile("wild-alt-reply4.mail");
builder.append();
}
-
+
public static void notHeaderFetches(ScriptBuilder builder) throws Exception {
builder.login();
builder.create();
@@ -684,13 +716,15 @@
builder.getFetch().bodyPeekCompleteMessage();
builder.fetchAllMessages();
builder.resetFetch();
- builder.getFetch().bodyPeekNotHeaders(ScriptBuilder.Fetch.SELECT_HEADERS);
+ builder.getFetch().bodyPeekNotHeaders(
+ ScriptBuilder.Fetch.SELECT_HEADERS);
builder.fetchAllMessages();
builder.select();
builder.quit();
}
-
- public static void simpleCombinedFetches(ScriptBuilder builder) throws Exception {
+
+ public static void simpleCombinedFetches(ScriptBuilder builder)
+ throws Exception {
builder.login();
builder.create();
builder.select();
@@ -715,12 +749,13 @@
builder.getFetch().bodyPeekCompleteMessage();
builder.fetchAllMessages();
builder.resetFetch();
- builder.getFetch().bodyPeekHeaders(ScriptBuilder.Fetch.COMPREHENSIVE_HEADERS);
+ builder.getFetch().bodyPeekHeaders(
+ ScriptBuilder.Fetch.COMPREHENSIVE_HEADERS);
builder.fetchAllMessages();
builder.select();
builder.quit();
}
-
+
public static void recent(ScriptBuilder builder) throws Exception {
builder.login();
builder.create();
@@ -733,12 +768,14 @@
builder.quit();
}
- public static void multipartMixedMessagesPeek(ScriptBuilder builder) throws Exception {
+ public static void multipartMixedMessagesPeek(ScriptBuilder builder)
+ throws Exception {
builder.setPeek(true);
multipartMixedMessages(builder);
}
-
- public static void multipartMixedMessages(ScriptBuilder builder) throws Exception {
+
+ public static void multipartMixedMessages(ScriptBuilder builder)
+ throws Exception {
builder.login();
builder.create();
builder.select();
@@ -768,13 +805,15 @@
builder.select();
builder.quit();
}
-
- public static void multipartAlternativePeek(ScriptBuilder builder) throws Exception {
+
+ public static void multipartAlternativePeek(ScriptBuilder builder)
+ throws Exception {
builder.setPeek(true);
multipartAlternative(builder);
}
-
- public static void multipartAlternative(ScriptBuilder builder) throws Exception {
+
+ public static void multipartAlternative(ScriptBuilder builder)
+ throws Exception {
builder.login();
builder.create();
builder.select();
@@ -790,12 +829,13 @@
builder.select();
builder.quit();
}
-
- public static void multipartMixedPeek(ScriptBuilder builder) throws Exception {
+
+ public static void multipartMixedPeek(ScriptBuilder builder)
+ throws Exception {
builder.setPeek(true);
multipartMixed(builder);
}
-
+
public static void multipartMixed(ScriptBuilder builder) throws Exception {
builder.login();
builder.create();
@@ -813,5 +853,5 @@
builder.select();
builder.quit();
}
-
+
}
Modified: james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/ScriptBuilder.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/ScriptBuilder.java?rev=696828&r1=696827&r2=696828&view=diff
==============================================================================
--- james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/ScriptBuilder.java (original)
+++ james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/ScriptBuilder.java Thu Sep 18 14:44:56 2008
@@ -31,9 +31,8 @@
import org.apache.commons.lang.StringUtils;
-
public class ScriptBuilder {
-
+
public static ScriptBuilder open(String host, int port) throws Exception {
InetSocketAddress address = new InetSocketAddress(host, port);
SocketChannel socket = SocketChannel.open(address);
@@ -41,29 +40,40 @@
Client client = new Client(socket, socket);
return new ScriptBuilder(client);
}
-
+
private int tagCount = 0;
-
+
private boolean uidSearch = false;
+
private boolean peek = false;
+
private int messageNumber = 1;
+
private String user = "imapuser";
+
private String password = "password";
+
private String mailbox = "testmailbox";
+
private String file = "rfc822.mail";
+
private String basedir = "/org/apache/james/test/functional/";
+
private boolean createdMailbox = false;
+
private final Client client;
+
private Fetch fetch = new Fetch();
+
private Search search = new Search();
+
private String partialFetch = "";
-
-
+
public ScriptBuilder(final Client client) {
super();
this.client = client;
}
-
+
public final boolean isPeek() {
return peek;
}
@@ -95,12 +105,13 @@
public final void setFile(String file) {
this.file = file;
}
-
+
private InputStream openFile() throws Exception {
- InputStream result = this.getClass().getResourceAsStream( basedir + file );
+ InputStream result = this.getClass()
+ .getResourceAsStream(basedir + file);
return new IgnoreHeaderInputStream(result);
}
-
+
public final Fetch getFetch() {
return fetch;
}
@@ -108,12 +119,12 @@
public final void setFetch(Fetch fetch) {
this.fetch = fetch;
}
-
+
public final Fetch resetFetch() {
this.fetch = new Fetch();
return fetch;
}
-
+
public final int getMessageNumber() {
return messageNumber;
}
@@ -157,59 +168,59 @@
lineEnd();
response();
}
-
+
public ScriptBuilder rename(String to) throws Exception {
return rename(getMailbox(), to);
}
-
+
public ScriptBuilder rename(String from, String to) throws Exception {
command("RENAME " + from + " " + to);
return this;
}
-
+
public ScriptBuilder select() throws Exception {
command("SELECT " + mailbox);
return this;
}
-
+
public ScriptBuilder create() throws Exception {
command("CREATE " + mailbox);
createdMailbox = true;
return this;
}
-
+
public ScriptBuilder flagDeleted() throws Exception {
store(new Flags().deleted().msn(messageNumber));
return this;
}
-
+
public ScriptBuilder expunge() throws Exception {
command("EXPUNGE");
return this;
}
-
+
public void delete() throws Exception {
if (createdMailbox) {
command("DELETE " + mailbox);
}
}
-
+
public void search() throws Exception {
search.setUidSearch(uidSearch);
command(search.command());
search = new Search();
}
-
+
public ScriptBuilder all() {
search.all();
return this;
}
-
+
public ScriptBuilder answered() {
search.answered();
return this;
}
-
+
public ScriptBuilder bcc(String address) {
search.bcc(address);
return this;
@@ -219,11 +230,11 @@
search.before(year, month, day);
return this;
}
-
+
public ScriptBuilder body(String text) {
search.body(text);
return this;
- }
+ }
public ScriptBuilder cc(String address) {
search.cc(address);
@@ -234,7 +245,7 @@
search.deleted();
return this;
}
-
+
public ScriptBuilder draft() {
search.draft();
return this;
@@ -252,14 +263,14 @@
public ScriptBuilder header(String field, String value) {
search.header(field, value);
- return this;
+ return this;
}
-
+
public ScriptBuilder keyword(String flag) {
search.keyword(flag);
return this;
}
-
+
public ScriptBuilder larger(long size) {
search.larger(size);
return this;
@@ -269,17 +280,17 @@
search.NEW();
return this;
}
-
+
public ScriptBuilder not() {
search.not();
return this;
}
-
+
public ScriptBuilder old() {
search.old();
return this;
}
-
+
public ScriptBuilder on(int year, int month, int day) {
search.on(year, month, day);
return this;
@@ -307,19 +318,19 @@
public ScriptBuilder senton(int year, int month, int day) {
search.senton(year, month, day);
- return this;
+ return this;
}
public ScriptBuilder sentsince(int year, int month, int day) {
search.sentsince(year, month, day);
return this;
}
-
+
public ScriptBuilder since(int year, int month, int day) {
search.since(year, month, day);
- return this;
+ return this;
}
-
+
public ScriptBuilder smaller(int size) {
search.smaller(size);
return this;
@@ -329,17 +340,17 @@
search.subject(address);
return this;
}
-
+
public ScriptBuilder text(String text) {
search.text(text);
return this;
}
-
+
public ScriptBuilder to(String address) {
search.to(address);
return this;
}
-
+
public ScriptBuilder uid() {
search.uid();
return this;
@@ -349,7 +360,7 @@
search.unanswered();
return this;
}
-
+
public ScriptBuilder undeleted() {
search.undeleted();
return this;
@@ -359,7 +370,7 @@
search.undraft();
return this;
}
-
+
public ScriptBuilder unflagged() {
search.unflagged();
return this;
@@ -369,55 +380,55 @@
search.unkeyword(flag);
return this;
}
-
+
public ScriptBuilder unseen() {
search.unseen();
return this;
}
-
+
public ScriptBuilder openParen() {
search.openParen();
return this;
}
-
+
public ScriptBuilder closeParen() {
search.closeParen();
return this;
}
-
+
public ScriptBuilder msn(int low, int high) {
search.msn(low, high);
return this;
}
-
+
public ScriptBuilder msnAndUp(int limit) {
search.msnAndUp(limit);
return this;
}
-
+
public ScriptBuilder msnAndDown(int limit) {
search.msnAndDown(limit);
return this;
}
-
+
public Flags flags() {
return new Flags();
}
-
+
public void store(Flags flags) throws Exception {
String command = flags.command();
command(command);
}
-
+
public Search getSearch() throws Exception {
return search;
}
-
+
public ScriptBuilder partial(long start, long octets) {
- partialFetch = "<" + start + "." + octets + ">";
+ partialFetch = "<" + start + "." + octets + ">";
return this;
}
-
+
public ScriptBuilder fetchSection(String section) throws Exception {
final String body;
if (peek) {
@@ -425,35 +436,36 @@
} else {
body = " (BODY[";
}
- final String command = "FETCH " + messageNumber + body + section + "]" + partialFetch + ")";
+ final String command = "FETCH " + messageNumber + body + section + "]"
+ + partialFetch + ")";
command(command);
return this;
}
-
+
public void fetchAllMessages() throws Exception {
final String command = fetch.command();
command(command);
}
-
+
public ScriptBuilder list() throws Exception {
command("LIST \"\" \"*\"");
return this;
}
-
+
public void fetchBody() throws Exception {
-
+
}
-
+
public void fetch() throws Exception {
final String command = fetch.command(messageNumber);
command(command);
}
-
+
public void fetchFlags() throws Exception {
final String command = "FETCH " + messageNumber + " (FLAGS)";
command(command);
}
-
+
public void append() throws Exception {
tag();
write("APPEND " + mailbox);
@@ -469,12 +481,12 @@
private void response() throws Exception {
client.readResponse();
}
-
+
private void tag() throws Exception {
client.lineStart();
write("A" + ++tagCount + " ");
}
-
+
private void lineEnd() throws Exception {
client.lineEnd();
}
@@ -482,29 +494,34 @@
private void write(String phrase) throws Exception {
client.write(phrase);
}
-
+
public void close() throws Exception {
client.close();
}
-
+
public void logout() throws Exception {
command("LOGOUT");
}
-
+
public void quit() throws Exception {
delete();
logout();
close();
}
-
+
public static final class Flags {
private StringBuffer flags;
+
private StringBuffer msn;
+
private boolean first;
+
private boolean silent;
+
private boolean add;
+
private boolean subtract;
-
+
public Flags() {
add = false;
subtract = false;
@@ -513,13 +530,13 @@
flags = new StringBuffer("(");
msn = new StringBuffer();
}
-
+
public Flags msn(long number) {
msn.append(number);
msn.append(' ');
return this;
}
-
+
public Flags range(long low, long high) {
msn.append(low);
msn.append(':');
@@ -527,63 +544,63 @@
msn.append(' ');
return this;
}
-
+
public Flags rangeTill(long number) {
msn.append("*:");
msn.append(number);
msn.append(' ');
return this;
}
-
+
public Flags rangeFrom(long number) {
msn.append(number);
msn.append(":* ");
return this;
}
-
+
public Flags add() {
add = true;
subtract = false;
return this;
}
-
+
public Flags subtract() {
add = false;
subtract = true;
return this;
}
-
+
public Flags silent() {
silent = true;
return this;
}
-
+
public Flags deleted() {
return append("\\DELETED");
}
-
+
public Flags flagged() {
return append("\\FLAGGED");
}
-
+
public Flags answered() {
return append("\\ANSWERED");
}
-
+
public Flags seen() {
return append("\\SEEN");
}
-
+
public Flags draft() {
return append("\\DRAFT");
}
-
+
public String command() {
String flags;
if (add) {
- flags =" +FLAGS " ;
+ flags = " +FLAGS ";
} else if (subtract) {
- flags =" -FLAGS " ;
+ flags = " -FLAGS ";
} else {
flags = " FLAGS ";
}
@@ -592,7 +609,7 @@
}
return "STORE " + msn + flags + this.flags + ")";
}
-
+
private Flags append(String term) {
if (first) {
first = false;
@@ -603,17 +620,19 @@
return this;
}
}
-
+
public static final class Search {
private StringBuffer buffer;
+
private boolean first;
+
private boolean uidSearch = false;
-
+
public Search() {
clear();
}
-
+
public final boolean isUidSearch() {
return uidSearch;
}
@@ -629,16 +648,16 @@
return "SEARCH " + buffer.toString();
}
}
-
+
public void clear() {
buffer = new StringBuffer();
- first = true;
+ first = true;
}
-
+
private Search append(long term) {
return append(new Long(term).toString());
}
-
+
private Search append(String term) {
if (first) {
first = false;
@@ -648,59 +667,59 @@
buffer.append(term);
return this;
}
-
+
private Search date(int year, int month, int day) {
append(day);
switch (month) {
- case 1:
+ case 1:
buffer.append("-Jan-");
break;
- case 2:
+ case 2:
buffer.append("-Feb-");
break;
- case 3:
+ case 3:
buffer.append("-Mar-");
break;
- case 4:
+ case 4:
buffer.append("-Apr-");
break;
- case 5:
+ case 5:
buffer.append("-May-");
break;
- case 6:
+ case 6:
buffer.append("-Jun-");
break;
- case 7:
+ case 7:
buffer.append("-Jul-");
break;
- case 8:
+ case 8:
buffer.append("-Aug-");
break;
- case 9:
+ case 9:
buffer.append("-Sep-");
break;
- case 10:
+ case 10:
buffer.append("-Oct-");
break;
- case 11:
+ case 11:
buffer.append("-Nov-");
break;
- case 12:
+ case 12:
buffer.append("-Dec-");
break;
}
buffer.append(year);
return this;
}
-
+
public Search all() {
return append("ALL");
}
-
+
public Search answered() {
return append("ANSWERED");
}
-
+
public Search bcc(String address) {
return append("BCC " + address);
}
@@ -708,10 +727,10 @@
public Search before(int year, int month, int day) {
return append("BEFORE").date(year, month, day);
}
-
+
public Search body(String text) {
return append("BODY").append(text);
- }
+ }
public Search cc(String address) {
return append("CC").append(address);
@@ -720,7 +739,7 @@
public Search deleted() {
return append("DELETED");
}
-
+
public Search draft() {
return append("DRAFT");
}
@@ -734,13 +753,13 @@
}
public Search header(String field, String value) {
- return append("HEADER").append(field).append(value);
+ return append("HEADER").append(field).append(value);
}
-
+
public Search keyword(String flag) {
return append("KEYWORD").append(flag);
}
-
+
public Search larger(long size) {
return append("LARGER").append(size);
}
@@ -748,15 +767,15 @@
public Search NEW() {
return append("NEW");
}
-
+
public Search not() {
return append("NOT");
}
-
+
public Search old() {
return append("OLD");
}
-
+
public Search on(int year, int month, int day) {
return append("ON").date(year, month, day);
}
@@ -778,32 +797,33 @@
}
public Search senton(int year, int month, int day) {
- return append("SENTON").date(year, month, day);
+ return append("SENTON").date(year, month, day);
}
public Search sentsince(int year, int month, int day) {
return append("SENTSINCE").date(year, month, day);
}
-
+
public Search since(int year, int month, int day) {
- return append("SINCE").date(year, month, day);
+ return append("SINCE").date(year, month, day);
}
-
+
public Search smaller(int size) {
- return append("SMALLER").append(size);}
+ return append("SMALLER").append(size);
+ }
public Search subject(String address) {
return append("SUBJECT").append(address);
}
-
+
public Search text(String text) {
return append("TEXT").append(text);
}
-
+
public Search to(String address) {
return append("TO").append(address);
}
-
+
public Search uid() {
return append("UID");
}
@@ -811,7 +831,7 @@
public Search unanswered() {
return append("UNANSWERED");
}
-
+
public Search undeleted() {
return append("UNDELETED");
}
@@ -819,7 +839,7 @@
public Search undraft() {
return append("UNDRAFT");
}
-
+
public Search unflagged() {
return append("UNFLAGGED");
}
@@ -827,54 +847,63 @@
public Search unkeyword(String flag) {
return append("UNKEYWORD").append(flag);
}
-
+
public Search unseen() {
return append("UNSEEN");
}
-
+
public Search openParen() {
return append("(");
}
-
+
public Search closeParen() {
return append(")");
}
-
+
public Search msn(int low, int high) {
return append(low + ":" + high);
}
-
+
public Search msnAndUp(int limit) {
return append(limit + ":*");
}
-
+
public Search msnAndDown(int limit) {
return append("*:" + limit);
}
}
-
+
public static final class Fetch {
-
-
- public static final String[] COMPREHENSIVE_HEADERS = {"DATE", "FROM", "TO", "CC", "SUBJECT",
- "REFERENCES", "IN-REPLY-TO", "MESSAGE-ID", "MIME-VERSION", "CONTENT-TYPE",
- "X-MAILING-LIST", "X-LOOP", "LIST-ID", "LIST-POST", "MAILING-LIST", "ORIGINATOR", "X-LIST",
- "SENDER", "RETURN-PATH", "X-BEENTHERE"};
-
-
- public static final String[] SELECT_HEADERS = {"DATE", "FROM", "TO", "ORIGINATOR", "X-LIST"};
-
+
+ public static final String[] COMPREHENSIVE_HEADERS = { "DATE", "FROM",
+ "TO", "CC", "SUBJECT", "REFERENCES", "IN-REPLY-TO",
+ "MESSAGE-ID", "MIME-VERSION", "CONTENT-TYPE", "X-MAILING-LIST",
+ "X-LOOP", "LIST-ID", "LIST-POST", "MAILING-LIST", "ORIGINATOR",
+ "X-LIST", "SENDER", "RETURN-PATH", "X-BEENTHERE" };
+
+ public static final String[] SELECT_HEADERS = { "DATE", "FROM", "TO",
+ "ORIGINATOR", "X-LIST" };
+
private boolean flagsFetch = false;
+
private boolean rfc822Size = false;
+
private boolean rfc = false;
+
private boolean rfcText = false;
+
private boolean rfcHeaders = false;
+
private boolean internalDate = false;
+
private boolean uid = false;
+
private String body = null;
+
private boolean bodyFetch = false;
+
private boolean bodyStructureFetch = false;
-
+
public final boolean isBodyFetch() {
return bodyFetch;
}
@@ -896,11 +925,11 @@
public String command(int messageNumber) {
return "FETCH " + messageNumber + "(" + fetchData() + ")";
}
-
+
public String command() {
return "FETCH 1:* (" + fetchData() + ")";
}
-
+
public final boolean isFlagsFetch() {
return flagsFetch;
}
@@ -909,7 +938,7 @@
this.flagsFetch = flagsFetch;
return this;
}
-
+
public final boolean isUid() {
return uid;
}
@@ -927,7 +956,7 @@
this.rfc822Size = rfc822Size;
return this;
}
-
+
public final boolean isRfc() {
return rfc;
}
@@ -963,7 +992,7 @@
this.internalDate = internalDate;
return this;
}
-
+
public final String getBody() {
return body;
}
@@ -975,27 +1004,27 @@
public void bodyPeekCompleteMessage() {
setBody(buildBody(true, ""));
}
-
+
public void bodyPeekNotHeaders(String[] fields) {
setBody(buildBody(true, buildHeaderFields(fields, true)));
}
-
+
public Fetch bodyPeekHeaders(String[] fields) {
setBody(buildBody(true, buildHeaderFields(fields, false)));
return this;
}
-
+
public String buildBody(boolean peek, String section) {
String result;
if (peek) {
- result = "BODY.PEEK[";
+ result = "BODY.PEEK[";
} else {
result = "BODY[";
}
result = result + section + "]";
return result;
}
-
+
public String buildHeaderFields(String[] fields, boolean not) {
String result;
if (not) {
@@ -1004,7 +1033,7 @@
result = "HEADER.FIELDS (";
}
for (int i = 0; i < fields.length; i++) {
- if (i>0) {
+ if (i > 0) {
result = result + " ";
}
result = result + fields[i];
@@ -1012,7 +1041,7 @@
result = result + ")";
return result;
}
-
+
public String fetchData() {
final StringBuffer buffer = new StringBuffer();
boolean first = true;
@@ -1047,7 +1076,8 @@
return buffer.toString();
}
- private boolean add(final StringBuffer buffer, boolean first, String atom) {
+ private boolean add(final StringBuffer buffer, boolean first,
+ String atom) {
if (atom != null) {
if (first) {
first = false;
@@ -1059,26 +1089,34 @@
return first;
}
}
-
+
public static final class Client {
-
+
private static final Charset ASCII = Charset.forName("us-ascii");
-
+
private final Out out;
+
private final ReadableByteChannel source;
+
private final WritableByteChannel sump;
+
private ByteBuffer inBuffer = ByteBuffer.allocate(256);
+
private final ByteBuffer outBuffer = ByteBuffer.allocate(262144);
+
private final ByteBuffer crlf;
+
private boolean isLineTagged = false;
+
private int continuationBytes = 0;
-
- public Client(ReadableByteChannel source, WritableByteChannel sump) throws Exception {
+
+ public Client(ReadableByteChannel source, WritableByteChannel sump)
+ throws Exception {
super();
this.source = source;
this.sump = sump;
this.out = new Out();
- byte[] crlf = {'\r', '\n'};
+ byte[] crlf = { '\r', '\n' };
this.crlf = ByteBuffer.wrap(crlf);
inBuffer.flip();
readLine();
@@ -1086,14 +1124,14 @@
public void write(InputStream in) throws Exception {
outBuffer.clear();
- int next = in.read();
- while(next != -1) {
+ int next = in.read();
+ while (next != -1) {
if (next == '\n') {
- outBufferNext((byte)'\r');
- outBufferNext((byte)'\n');
+ outBufferNext((byte) '\r');
+ outBufferNext((byte) '\n');
} else if (next == '\r') {
- outBufferNext((byte)'\r');
- outBufferNext((byte)'\n');
+ outBufferNext((byte) '\r');
+ outBufferNext((byte) '\n');
next = in.read();
if (next == '\n') {
next = in.read();
@@ -1105,10 +1143,10 @@
}
next = in.read();
}
-
+
writeOutBuffer();
}
-
+
public void outBufferNext(byte next) throws Exception {
outBuffer.put(next);
}
@@ -1122,7 +1160,7 @@
out.client();
while (outBuffer.hasRemaining()) {
final byte next = outBuffer.get();
- print (next);
+ print(next);
if (next == '\n') {
out.client();
}
@@ -1139,7 +1177,7 @@
readLine();
}
}
-
+
private byte next() throws Exception {
byte result;
if (inBuffer.hasRemaining()) {
@@ -1148,32 +1186,34 @@
} else {
inBuffer.compact();
int i = 0;
- while ((i = source.read(inBuffer)) == 0);
- if (i == -1) throw new RuntimeException("Unexpected EOF");
+ while ((i = source.read(inBuffer)) == 0)
+ ;
+ if (i == -1)
+ throw new RuntimeException("Unexpected EOF");
inBuffer.flip();
result = next();
}
return result;
}
-
+
private void print(char next) {
out.print(next);
}
-
+
private void print(byte next) {
print((char) next);
}
-
+
public void lineStart() throws Exception {
out.client();
}
-
+
public void write(String phrase) throws Exception {
out.print(phrase);
final ByteBuffer buffer = ASCII.encode(phrase);
writeRemaining(buffer);
}
-
+
public void writeLine(String line) throws Exception {
lineStart();
write(line);
@@ -1185,16 +1225,16 @@
sump.write(buffer);
}
}
-
+
public void lineEnd() throws Exception {
out.lineEnd();
crlf.rewind();
writeRemaining(crlf);
}
-
+
private void readLine() throws Exception {
out.server();
-
+
final byte next = next();
isLineTagged = next != '*';
readRestOfLine(next);
@@ -1214,10 +1254,10 @@
continuationBytes = 0;
continuation();
}
-
+
private void continuation() throws Exception {
byte next = next();
- switch(next) {
+ switch (next) {
case '0':
continuationDigit(0);
break;
@@ -1250,7 +1290,7 @@
break;
case '+':
next();
- next();
+ next();
readContinuation();
break;
default:
@@ -1260,47 +1300,46 @@
break;
}
}
-
+
private void readContinuation() throws Exception {
- out.server();
+ out.server();
while (continuationBytes-- > 0) {
int next = next();
if (next == '\n') {
- out.server();
+ out.server();
}
}
}
-
+
private void continuationDigit(int digit) throws Exception {
- continuationBytes = 10*continuationBytes + digit;
+ continuationBytes = 10 * continuationBytes + digit;
continuation();
}
-
+
public void close() throws Exception {
source.close();
sump.close();
}
}
-
+
private static final class Out {
- private static final String[] IGNORE_LINES_STARTING_WITH = {
- "S: \\* OK \\[PERMANENTFLAGS",
- "C: A22 LOGOUT",
- "S: \\* BYE Logging out",
- "S: \\* OK Dovecot ready\\."};
+ private static final String[] IGNORE_LINES_STARTING_WITH = {
+ "S: \\* OK \\[PERMANENTFLAGS", "C: A22 LOGOUT",
+ "S: \\* BYE Logging out", "S: \\* OK Dovecot ready\\." };
+
private static final String[] IGNORE_LINES_CONTAINING = {
- "OK Logout completed.",
- "LOGIN imapuser password",
- "OK Logged in",
- "LOGOUT"};
-
+ "OK Logout completed.", "LOGIN imapuser password",
+ "OK Logged in", "LOGOUT" };
+
private final CharBuffer lineBuffer = CharBuffer.allocate(131072);
+
private boolean isClient = false;
+
public void client() {
lineBuffer.put("C: ");
isClient = true;
}
-
+
public void print(char next) {
if (!isClient) {
escape(next);
@@ -1309,8 +1348,9 @@
}
private void escape(char next) {
- if (next == '\\' || next == '*' || next=='.' || next == '[' || next == ']' || next == '+'
- || next == '(' || next == ')' || next == '{' || next == '}' || next == '?') {
+ if (next == '\\' || next == '*' || next == '.' || next == '['
+ || next == ']' || next == '+' || next == '(' || next == ')'
+ || next == '{' || next == '}' || next == '?') {
lineBuffer.put('\\');
}
}
@@ -1319,7 +1359,7 @@
lineBuffer.put("S: ");
isClient = false;
}
-
+
public void print(String phrase) {
if (!isClient) {
phrase = StringUtils.replace(phrase, "\\", "\\\\");
@@ -1336,28 +1376,42 @@
}
lineBuffer.put(phrase);
}
-
+
public void lineEnd() {
lineBuffer.flip();
final String text = lineBuffer.toString();
String[] lines = text.split("\r\n");
for (int i = 0; i < lines.length; i++) {
- String line = StringUtils.chomp(lines[i]);
+ String line = StringUtils.chomp(lines[i]);
if (!ignoreLine(line)) {
- line = StringUtils.replace(line, "OK Create completed", "OK CREATE completed");
- line = StringUtils.replace(line, "OK Fetch completed", "OK FETCH completed");
- line = StringUtils.replace(line, "OK Append completed", "OK APPEND completed");
- line = StringUtils.replace(line, "OK Delete completed", "OK DELETE completed");
- line = StringUtils.replace(line, "OK Store completed", "OK STORE completed");
- line = StringUtils.replace(line, "OK Rename completed", "OK RENAME completed");
- line = StringUtils.replace(line, "OK Expunge completed", "OK EXPUNGE completed");
- line = StringUtils.replace(line, "OK List completed", "OK LIST completed");
- line = StringUtils.replace(line, "Select completed", "SELECT completed");
- line = StringUtils.replace(line, "\\\\Seen \\\\Draft", "\\\\Draft \\\\Seen");
- line = StringUtils.replace(line, "\\\\Flagged \\\\Deleted", "\\\\Deleted \\\\Flagged");
- line = StringUtils.replace(line, "\\\\Flagged \\\\Draft", "\\\\Draft \\\\Flagged");
- line = StringUtils.replace(line, "\\\\Seen \\\\Recent", "\\\\Recent \\\\Seen");
- line = StringUtils.replace(line, "\\] First unseen\\.", "\\](.)*");
+ line = StringUtils.replace(line, "OK Create completed",
+ "OK CREATE completed");
+ line = StringUtils.replace(line, "OK Fetch completed",
+ "OK FETCH completed");
+ line = StringUtils.replace(line, "OK Append completed",
+ "OK APPEND completed");
+ line = StringUtils.replace(line, "OK Delete completed",
+ "OK DELETE completed");
+ line = StringUtils.replace(line, "OK Store completed",
+ "OK STORE completed");
+ line = StringUtils.replace(line, "OK Rename completed",
+ "OK RENAME completed");
+ line = StringUtils.replace(line, "OK Expunge completed",
+ "OK EXPUNGE completed");
+ line = StringUtils.replace(line, "OK List completed",
+ "OK LIST completed");
+ line = StringUtils.replace(line, "Select completed",
+ "SELECT completed");
+ line = StringUtils.replace(line, "\\\\Seen \\\\Draft",
+ "\\\\Draft \\\\Seen");
+ line = StringUtils.replace(line, "\\\\Flagged \\\\Deleted",
+ "\\\\Deleted \\\\Flagged");
+ line = StringUtils.replace(line, "\\\\Flagged \\\\Draft",
+ "\\\\Draft \\\\Flagged");
+ line = StringUtils.replace(line, "\\\\Seen \\\\Recent",
+ "\\\\Recent \\\\Seen");
+ line = StringUtils.replace(line, "\\] First unseen\\.",
+ "\\](.)*");
if (line.startsWith("S: \\* OK \\[UIDVALIDITY ")) {
line = "S: \\* OK \\[UIDVALIDITY \\d+\\]";
} else if (line.startsWith("S: \\* OK \\[UIDNEXT")) {
@@ -1377,7 +1431,7 @@
break;
}
}
- for (int i = 0; i < IGNORE_LINES_STARTING_WITH.length && ! result; i++) {
+ for (int i = 0; i < IGNORE_LINES_STARTING_WITH.length && !result; i++) {
if (line.startsWith(IGNORE_LINES_STARTING_WITH[i])) {
result = true;
break;
@@ -1386,12 +1440,13 @@
return result;
}
}
-
+
private static final class IgnoreHeaderInputStream extends InputStream {
private boolean isFinishedHeaders = false;
+
private final InputStream delegate;
-
+
public IgnoreHeaderInputStream(final InputStream delegate) {
super();
this.delegate = delegate;
@@ -1412,14 +1467,14 @@
readLine();
result = read();
break;
-
+
case '\r':
case '\n':
case ' ':
case '\t':
result = read();
break;
-
+
default:
isFinishedHeaders = true;
result = next;
@@ -1428,9 +1483,10 @@
}
return result;
}
+
private void readLine() throws IOException {
int next = delegate.read();
- while (next != -1 && next !='\r' && next !='\n') {
+ while (next != -1 && next != '\r' && next != '\n') {
next = delegate.read();
}
}
Modified: james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractAuthenticatedStateTestSuite.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractAuthenticatedStateTestSuite.java?rev=696828&r1=696827&r2=696828&view=diff
==============================================================================
--- james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractAuthenticatedStateTestSuite.java (original)
+++ james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractAuthenticatedStateTestSuite.java Thu Sep 18 14:44:56 2008
@@ -21,26 +21,26 @@
import java.util.Locale;
+abstract public class AbstractAuthenticatedStateTestSuite extends
+ AbstractTestForAuthenticatedState {
-abstract public class AbstractAuthenticatedStateTestSuite extends AbstractTestForAuthenticatedState {
-
- public AbstractAuthenticatedStateTestSuite(HostSystem system) throws Exception
- {
+ public AbstractAuthenticatedStateTestSuite(HostSystem system)
+ throws Exception {
super(system);
}
public void testNoopUS() throws Exception {
- scriptTest("Noop", Locale.US);
+ scriptTest("Noop", Locale.US);
}
-
+
public void testLogoutUS() throws Exception {
- scriptTest("Logout", Locale.US);
+ scriptTest("Logout", Locale.US);
}
-
+
public void testCapabilityUS() throws Exception {
- scriptTest("Capability", Locale.US);
+ scriptTest("Capability", Locale.US);
}
-
+
public void testAppendExamineInboxUS() throws Exception {
scriptTest("AppendExamineInbox", Locale.US);
}
@@ -48,72 +48,71 @@
public void testAppendSelectInboxUS() throws Exception {
scriptTest("AppendSelectInbox", Locale.US);
}
-
+
public void testCreateUS() throws Exception {
- scriptTest("Create", Locale.US);
+ scriptTest("Create", Locale.US);
}
-
+
public void testExamineEmptyUS() throws Exception {
- scriptTest("ExamineEmpty", Locale.US);
+ scriptTest("ExamineEmpty", Locale.US);
}
-
+
public void testSelectEmptyUS() throws Exception {
scriptTest("SelectEmpty", Locale.US);
}
-
+
public void testListNamespaceUS() throws Exception {
- scriptTest("ListNamespace", Locale.US);
+ scriptTest("ListNamespace", Locale.US);
}
-
+
public void testListMailboxesUS() throws Exception {
scriptTest("ListMailboxes", Locale.US);
}
-
+
public void testStatusUS() throws Exception {
- scriptTest("Status", Locale.US);
+ scriptTest("Status", Locale.US);
}
-
+
public void testSubscribeUS() throws Exception {
scriptTest("Subscribe", Locale.US);
}
-
+
public void testDeleteUS() throws Exception {
- scriptTest("Delete", Locale.US);
+ scriptTest("Delete", Locale.US);
}
-
+
public void testAppendUS() throws Exception {
scriptTest("Append", Locale.US);
}
-
+
public void testAppendExpungeUS() throws Exception {
scriptTest("AppendExpunge", Locale.US);
}
-
+
public void testSelectAppendUS() throws Exception {
scriptTest("SelectAppend", Locale.US);
}
-
+
public void testStringArgsUS() throws Exception {
scriptTest("StringArgs", Locale.US);
}
-
+
public void testValidNonAuthenticatedUS() throws Exception {
scriptTest("ValidNonAuthenticated", Locale.US);
}
-
public void testNoopITALY() throws Exception {
- scriptTest("Noop", Locale.ITALY);
+ scriptTest("Noop", Locale.ITALY);
}
-
+
public void testLogoutITALY() throws Exception {
- scriptTest("Logout", Locale.ITALY);
+ scriptTest("Logout", Locale.ITALY);
}
-
+
public void testCapabilityITALY() throws Exception {
- scriptTest("Capability", Locale.ITALY);
+ scriptTest("Capability", Locale.ITALY);
}
-
+
public void testAppendExamineInboxITALY() throws Exception {
scriptTest("AppendExamineInbox", Locale.ITALY);
}
@@ -121,72 +120,71 @@
public void testAppendSelectInboxITALY() throws Exception {
scriptTest("AppendSelectInbox", Locale.ITALY);
}
-
+
public void testCreateITALY() throws Exception {
- scriptTest("Create", Locale.ITALY);
+ scriptTest("Create", Locale.ITALY);
}
-
+
public void testExamineEmptyITALY() throws Exception {
- scriptTest("ExamineEmpty", Locale.ITALY);
+ scriptTest("ExamineEmpty", Locale.ITALY);
}
-
+
public void testSelectEmptyITALY() throws Exception {
scriptTest("SelectEmpty", Locale.ITALY);
}
-
+
public void testListNamespaceITALY() throws Exception {
- scriptTest("ListNamespace", Locale.ITALY);
+ scriptTest("ListNamespace", Locale.ITALY);
}
-
+
public void testListMailboxesITALY() throws Exception {
scriptTest("ListMailboxes", Locale.ITALY);
}
-
+
public void testStatusITALY() throws Exception {
- scriptTest("Status", Locale.ITALY);
+ scriptTest("Status", Locale.ITALY);
}
-
+
public void testSubscribeITALY() throws Exception {
scriptTest("Subscribe", Locale.ITALY);
}
-
+
public void testDeleteITALY() throws Exception {
- scriptTest("Delete", Locale.ITALY);
+ scriptTest("Delete", Locale.ITALY);
}
-
+
public void testAppendITALY() throws Exception {
scriptTest("Append", Locale.ITALY);
}
-
+
public void testAppendExpungeITALY() throws Exception {
scriptTest("AppendExpunge", Locale.ITALY);
}
-
+
public void testSelectAppendITALY() throws Exception {
scriptTest("SelectAppend", Locale.ITALY);
}
-
+
public void testStringArgsITALY() throws Exception {
scriptTest("StringArgs", Locale.ITALY);
}
-
+
public void testValidNonAuthenticatedITALY() throws Exception {
scriptTest("ValidNonAuthenticated", Locale.ITALY);
}
-
public void testNoopKOREA() throws Exception {
- scriptTest("Noop", Locale.KOREA);
+ scriptTest("Noop", Locale.KOREA);
}
-
+
public void testLogoutKOREA() throws Exception {
- scriptTest("Logout", Locale.KOREA);
+ scriptTest("Logout", Locale.KOREA);
}
-
+
public void testCapabilityKOREA() throws Exception {
- scriptTest("Capability", Locale.KOREA);
+ scriptTest("Capability", Locale.KOREA);
}
-
+
public void testAppendExamineInboxKOREA() throws Exception {
scriptTest("AppendExamineInbox", Locale.KOREA);
}
@@ -194,57 +192,57 @@
public void testAppendSelectInboxKOREA() throws Exception {
scriptTest("AppendSelectInbox", Locale.KOREA);
}
-
+
public void testCreateKOREA() throws Exception {
- scriptTest("Create", Locale.KOREA);
+ scriptTest("Create", Locale.KOREA);
}
-
+
public void testExamineEmptyKOREA() throws Exception {
- scriptTest("ExamineEmpty", Locale.KOREA);
+ scriptTest("ExamineEmpty", Locale.KOREA);
}
-
+
public void testSelectEmptyKOREA() throws Exception {
scriptTest("SelectEmpty", Locale.KOREA);
}
-
+
public void testListNamespaceKOREA() throws Exception {
- scriptTest("ListNamespace", Locale.KOREA);
+ scriptTest("ListNamespace", Locale.KOREA);
}
-
+
public void testListMailboxesKOREA() throws Exception {
scriptTest("ListMailboxes", Locale.KOREA);
}
-
+
public void testStatusKOREA() throws Exception {
- scriptTest("Status", Locale.KOREA);
+ scriptTest("Status", Locale.KOREA);
}
-
+
public void testSubscribeKOREA() throws Exception {
scriptTest("Subscribe", Locale.KOREA);
}
-
+
public void testDeleteKOREA() throws Exception {
- scriptTest("Delete", Locale.KOREA);
+ scriptTest("Delete", Locale.KOREA);
}
-
+
public void testAppendKOREA() throws Exception {
scriptTest("Append", Locale.KOREA);
}
-
+
public void testAppendExpungeKOREA() throws Exception {
scriptTest("AppendExpunge", Locale.KOREA);
}
-
+
public void testSelectAppendKOREA() throws Exception {
scriptTest("SelectAppend", Locale.KOREA);
}
-
+
public void testStringArgsKOREA() throws Exception {
scriptTest("StringArgs", Locale.KOREA);
}
-
+
public void testValidNonAuthenticatedKOREA() throws Exception {
scriptTest("ValidNonAuthenticated", Locale.KOREA);
}
-
+
}
Modified: james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractBaseTestSelectedInbox.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractBaseTestSelectedInbox.java?rev=696828&r1=696827&r2=696828&view=diff
==============================================================================
--- james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractBaseTestSelectedInbox.java (original)
+++ james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractBaseTestSelectedInbox.java Thu Sep 18 14:44:56 2008
@@ -17,18 +17,18 @@
* under the License. *
****************************************************************/
-
package org.apache.james.test.functional.imap;
-
-
/**
- * <p>Tests commands which are valid in AUTHENTICATED and NONAUTHENTICATED by running
- * them in the SELECTED state. Many commands function identically, while others
- * are invalid in this state.
- * </p><p>
+ * <p>
+ * Tests commands which are valid in AUTHENTICATED and NONAUTHENTICATED by
+ * running them in the SELECTED state. Many commands function identically, while
+ * others are invalid in this state.
+ * </p>
+ * <p>
* Recommended scripts:
- * </p><ul>
+ * </p>
+ * <ul>
* <li>ValidNonAuthenticated</li>
* <li>Capability</li>
* <li>Noop</li>
@@ -44,33 +44,31 @@
* <li>Append</li>
* <li>Delete</li>
* </ul>
- *
- * @author Darrell DeBoer <da...@apache.org>
- *
+ *
+ * @author Darrell DeBoer <da...@apache.org>
+ *
* @version $Revision: 560719 $
*/
-public abstract class AbstractBaseTestSelectedInbox
- extends AbstractTestForAuthenticatedState
-{
- public AbstractBaseTestSelectedInbox( HostSystem system )
- {
- super( system );
+public abstract class AbstractBaseTestSelectedInbox extends
+ AbstractTestForAuthenticatedState {
+ public AbstractBaseTestSelectedInbox(HostSystem system) {
+ super(system);
}
/**
- * Superclass sets up welcome message and login session in {@link #preElements}.
- * A "SELECT INBOX" session is then added to these elements.
+ * Superclass sets up welcome message and login session in
+ * {@link #preElements}. A "SELECT INBOX" session is then added to these
+ * elements.
+ *
* @throws Exception
*/
- public void setUp() throws Exception
- {
+ public void setUp() throws Exception {
super.setUp();
- addTestFile( "SelectInbox.test", preElements );
+ addTestFile("SelectInbox.test", preElements);
}
- protected void addCloseInbox()
- {
- postElements.CL( "a CLOSE");
- postElements.SL( ".*", "AbstractBaseTestSelectedInbox.java:76");
+ protected void addCloseInbox() {
+ postElements.CL("a CLOSE");
+ postElements.SL(".*", "AbstractBaseTestSelectedInbox.java:76");
}
}
Modified: james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractProtocolTest.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractProtocolTest.java?rev=696828&r1=696827&r2=696828&view=diff
==============================================================================
--- james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractProtocolTest.java (original)
+++ james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractProtocolTest.java Thu Sep 18 14:44:56 2008
@@ -21,73 +21,71 @@
import junit.framework.TestCase;
-
/**
* Abstract Protocol Test is the root of all of the James Imap Server test
- * cases. It provides basic functionality for running a protocol session
- * as a JUnit test, and failing if exceptions are thrown.
- * To create a test which reads the entire protocol session from a single
- * protocol definition file, use the {@link AbstractSimpleScriptedTestProtocol}.
- *
+ * cases. It provides basic functionality for running a protocol session as a
+ * JUnit test, and failing if exceptions are thrown. To create a test which
+ * reads the entire protocol session from a single protocol definition file, use
+ * the {@link AbstractSimpleScriptedTestProtocol}.
+ *
* @author Darrell DeBoer
* @author Andrew C. Oliver
*/
-public abstract class AbstractProtocolTest
- extends TestCase implements ImapTestConstants
-{
+public abstract class AbstractProtocolTest extends TestCase implements
+ ImapTestConstants {
/** The Protocol session which is run before the testElements */
protected ProtocolSession preElements = new ProtocolSession();
+
/** The Protocol session which contains the tests elements */
protected ProtocolSession testElements = new ProtocolSession();
+
/** The Protocol session which is run after the testElements. */
protected ProtocolSession postElements = new ProtocolSession();
-
+
private final HostSystem hostSystem;
-
- public AbstractProtocolTest( HostSystem hostSystem )
- {
+
+ public AbstractProtocolTest(HostSystem hostSystem) {
this.hostSystem = hostSystem;
}
-
- protected void setUp() throws Exception
- {
+
+ protected void setUp() throws Exception {
super.setUp();
setUpEnvironment();
}
-
+
protected void continueAfterFailure() {
preElements.setContinueAfterFailure(true);
testElements.setContinueAfterFailure(true);
postElements.setContinueAfterFailure(true);
}
-
/**
- * Runs the pre,test and post protocol sessions against a local copy of the ImapServer.
- * This does not require that James be running, and is useful for rapid development and
- * debugging.
- *
- * Instead of sending requests to a socket connected to a running instance of James,
- * this method uses the {@link MockImapServer} to simplify testing. One mock instance
- * is required per protocol session/connection. These share the same underlying
- * Mailboxes, because of the way {@link MockImapServer#getImapSession()} works.
+ * Runs the pre,test and post protocol sessions against a local copy of the
+ * ImapServer. This does not require that James be running, and is useful
+ * for rapid development and debugging.
+ *
+ * Instead of sending requests to a socket connected to a running instance
+ * of James, this method uses the {@link MockImapServer} to simplify
+ * testing. One mock instance is required per protocol session/connection.
+ * These share the same underlying Mailboxes, because of the way
+ * {@link MockImapServer#getImapSession()} works.
*/
- protected void runSessions() throws Exception
- {
+ protected void runSessions() throws Exception {
class SessionContinuation implements HostSystem.Continuation {
public ProtocolSession session;
-
+
public void doContinue() {
if (session != null) {
session.doContinue();
}
}
-
+
}
SessionContinuation continuation = new SessionContinuation();
-
- HostSystem.Session[] sessions = new HostSystem.Session[testElements.getSessionCount()];
+
+ HostSystem.Session[] sessions = new HostSystem.Session[testElements
+ .getSessionCount()];
for (int i = 0; i < sessions.length; i++) {
sessions[i] = hostSystem.newSession(continuation);
@@ -95,9 +93,9 @@
}
try {
continuation.session = preElements;
- preElements.runSessions( sessions );
+ preElements.runSessions(sessions);
continuation.session = testElements;
- testElements.runSessions( sessions );
+ testElements.runSessions(sessions);
continuation.session = postElements;
postElements.runSessions(sessions);
} finally {
@@ -110,9 +108,8 @@
/**
* Initialises the UsersRepository and ImapHost on first call.
*/
- private void setUpEnvironment() throws Exception
- {
+ private void setUpEnvironment() throws Exception {
hostSystem.reset();
- hostSystem.addUser( USER, PASSWORD );
+ hostSystem.addUser(USER, PASSWORD);
}
}
Modified: james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractSimpleScriptedTestProtocol.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractSimpleScriptedTestProtocol.java?rev=696828&r1=696827&r2=696828&view=diff
==============================================================================
--- james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractSimpleScriptedTestProtocol.java (original)
+++ james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractSimpleScriptedTestProtocol.java Thu Sep 18 14:44:56 2008
@@ -17,36 +17,34 @@
* under the License. *
****************************************************************/
-
package org.apache.james.test.functional.imap;
import java.io.InputStream;
import java.util.Locale;
/**
- * A Protocol test which reads the test protocol session from a file. The
- * file read is taken as "<test-name>.test", where <test-name> is the value
- * passed into the constructor.
- * Subclasses of this test can set up {@link #preElements} and {@link #postElements}
- * for extra elements not defined in the protocol session file.
+ * A Protocol test which reads the test protocol session from a file. The file
+ * read is taken as "<test-name>.test", where <test-name> is the value passed
+ * into the constructor. Subclasses of this test can set up {@link #preElements}
+ * and {@link #postElements} for extra elements not defined in the protocol
+ * session file.
*/
-public abstract class AbstractSimpleScriptedTestProtocol
- extends AbstractProtocolTest
-{
- private FileProtocolSessionBuilder builder =
- new FileProtocolSessionBuilder();
+public abstract class AbstractSimpleScriptedTestProtocol extends
+ AbstractProtocolTest {
+ private FileProtocolSessionBuilder builder = new FileProtocolSessionBuilder();
private static final Locale BASE_DEFAULT_LOCALE = Locale.getDefault();
-
+
/**
- * Sets up a SimpleFileProtocolTest which reads the protocol session from
- * a file of name "<fileName>.test". This file should be available in the classloader
- * in the same location as this test class.
- * @param fileName The name of the file to read protocol elements from.
+ * Sets up a SimpleFileProtocolTest which reads the protocol session from a
+ * file of name "<fileName>.test". This file should be available in the
+ * classloader in the same location as this test class.
+ *
+ * @param fileName
+ * The name of the file to read protocol elements from.
*/
- public AbstractSimpleScriptedTestProtocol( HostSystem hostSystem )
- {
- super( hostSystem );
+ public AbstractSimpleScriptedTestProtocol(HostSystem hostSystem) {
+ super(hostSystem);
}
protected void tearDown() throws Exception {
@@ -54,36 +52,38 @@
super.tearDown();
}
-
-
/**
* Reads test elements from the protocol session file and adds them to the
* {@link #testElements} ProtocolSession. Then calls {@link #runSessions}.
- * @param locale TODO
+ *
+ * @param locale
+ * TODO
*/
- protected void scriptTest(String fileName, Locale locale) throws Exception
- {
+ protected void scriptTest(String fileName, Locale locale) throws Exception {
Locale.setDefault(locale);
- addTestFile( fileName + ".test", testElements );
+ addTestFile(fileName + ".test", testElements);
runSessions();
}
/**
* Finds the protocol session file identified by the test name, and builds
- * protocol elements from it. All elements from the definition file are added
- * to the supplied ProtocolSession.
- * @param fileName The name of the file to read
- * @param session The ProtocolSession to add elements to.
- */
- protected void addTestFile( String fileName, ProtocolSession session) throws Exception
- {
+ * protocol elements from it. All elements from the definition file are
+ * added to the supplied ProtocolSession.
+ *
+ * @param fileName
+ * The name of the file to read
+ * @param session
+ * The ProtocolSession to add elements to.
+ */
+ protected void addTestFile(String fileName, ProtocolSession session)
+ throws Exception {
fileName = "/org/apache/james/test/functional/imap/scripts/" + fileName;
// Need to find local resource.
- InputStream is = this.getClass().getResourceAsStream( fileName );
- if ( is == null ) {
- throw new Exception( "Test Resource '" + fileName + "' not found." );
+ InputStream is = this.getClass().getResourceAsStream(fileName);
+ if (is == null) {
+ throw new Exception("Test Resource '" + fileName + "' not found.");
}
- builder.addProtocolLinesFromStream( is, session, fileName );
+ builder.addProtocolLinesFromStream(is, session, fileName);
}
}
Modified: james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestConcurrentSessions.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestConcurrentSessions.java?rev=696828&r1=696827&r2=696828&view=diff
==============================================================================
--- james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestConcurrentSessions.java (original)
+++ james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestConcurrentSessions.java Thu Sep 18 14:44:56 2008
@@ -21,7 +21,8 @@
import java.util.Locale;
-public abstract class AbstractTestConcurrentSessions extends AbstractTestForAuthenticatedState {
+public abstract class AbstractTestConcurrentSessions extends
+ AbstractTestForAuthenticatedState {
public AbstractTestConcurrentSessions(HostSystem system) {
super(system);
@@ -30,47 +31,47 @@
public void testConcurrentExistsResponseUS() throws Exception {
scriptTest("ConcurrentExistsResponse", Locale.US);
}
-
+
public void testConcurrentDeleteSelectedUS() throws Exception {
scriptTest("ConcurrentDeleteSelected", Locale.US);
}
-
+
public void testConcurrentFetchResponseUS() throws Exception {
scriptTest("ConcurrentFetchResponse", Locale.US);
}
-
+
public void testConcurrentRenameSelectedUS() throws Exception {
scriptTest("ConcurrentRenameSelected", Locale.US);
}
-
+
public void testConcurrentExistsResponseKOREA() throws Exception {
scriptTest("ConcurrentExistsResponse", Locale.KOREA);
}
-
+
public void testConcurrentDeleteSelectedKOREA() throws Exception {
scriptTest("ConcurrentDeleteSelected", Locale.KOREA);
}
-
+
public void testConcurrentFetchResponseKOREA() throws Exception {
scriptTest("ConcurrentFetchResponse", Locale.KOREA);
}
-
+
public void testConcurrentRenameSelectedKOREA() throws Exception {
scriptTest("ConcurrentRenameSelected", Locale.KOREA);
}
-
+
public void testConcurrentExistsResponseITALY() throws Exception {
scriptTest("ConcurrentExistsResponse", Locale.ITALY);
}
-
+
public void testConcurrentDeleteSelectedITALY() throws Exception {
scriptTest("ConcurrentDeleteSelected", Locale.ITALY);
}
-
+
public void testConcurrentFetchResponseITALY() throws Exception {
scriptTest("ConcurrentFetchResponse", Locale.ITALY);
}
-
+
public void testConcurrentRenameSelectedITALY() throws Exception {
scriptTest("ConcurrentRenameSelected", Locale.ITALY);
}
Modified: james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestEvents.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestEvents.java?rev=696828&r1=696827&r2=696828&view=diff
==============================================================================
--- james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestEvents.java (original)
+++ james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestEvents.java Thu Sep 18 14:44:56 2008
@@ -30,11 +30,11 @@
public void testAppendToSelectedUS() throws Exception {
scriptTest("AppendToSelected", Locale.US);
}
-
+
public void testAppendToSelectedKOREA() throws Exception {
scriptTest("AppendToSelected", Locale.KOREA);
}
-
+
public void testAppendToSelectedITALY() throws Exception {
scriptTest("AppendToSelected", Locale.ITALY);
}
Modified: james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetch.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetch.java?rev=696828&r1=696827&r2=696828&view=diff
==============================================================================
--- james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetch.java (original)
+++ james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetch.java Thu Sep 18 14:44:56 2008
@@ -31,7 +31,6 @@
scriptTest("FetchEnvelope", Locale.US);
}
-
public void testFetchEnvelopeIT() throws Exception {
scriptTest("FetchEnvelope", Locale.ITALY);
}
@@ -102,24 +101,24 @@
public void testFetchInternalDateUS() throws Exception {
scriptTest("FetchInternalDate", Locale.US);
- }
+ }
public void testFetchInternalDateITALY() throws Exception {
scriptTest("FetchInternalDate", Locale.ITALY);
- }
+ }
public void testFetchInternalDateKOREA() throws Exception {
scriptTest("FetchInternalDate", Locale.KOREA);
- }
-
+ }
+
public void testFetchFetchRfcMixedUS() throws Exception {
scriptTest("FetchRFC822Mixed", Locale.US);
}
-
+
public void testFetchFetchRfcMixedKOREA() throws Exception {
scriptTest("FetchRFC822Mixed", Locale.KOREA);
}
-
+
public void testFetchFetchRfcMixedITALY() throws Exception {
scriptTest("FetchRFC822Mixed", Locale.ITALY);
}
Modified: james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetchBodySection.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetchBodySection.java?rev=696828&r1=696827&r2=696828&view=diff
==============================================================================
--- james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetchBodySection.java (original)
+++ james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetchBodySection.java Thu Sep 18 14:44:56 2008
@@ -21,7 +21,8 @@
import java.util.Locale;
-public abstract class AbstractTestFetchBodySection extends AbstractTestSelectedStateBase {
+public abstract class AbstractTestFetchBodySection extends
+ AbstractTestSelectedStateBase {
public AbstractTestFetchBodySection(HostSystem system) {
super(system);
@@ -42,23 +43,23 @@
public void testFetchMultipartMixedUS() throws Exception {
scriptTest("FetchMultipartMixed", Locale.US);
}
-
+
public void testFetchMultipartMixedITALY() throws Exception {
scriptTest("FetchMultipartMixed", Locale.ITALY);
}
-
+
public void testFetchMultipartMixedKOREA() throws Exception {
scriptTest("FetchMultipartMixed", Locale.KOREA);
}
-
+
public void testFetchMultipartMixedComplexUS() throws Exception {
scriptTest("FetchMultipartMixedComplex", Locale.US);
}
-
+
public void testFetchMultipartMixedComplexITALY() throws Exception {
scriptTest("FetchMultipartMixedComplex", Locale.ITALY);
}
-
+
public void testFetchMultipartMixedComplexKOREA() throws Exception {
scriptTest("FetchMultipartMixedComplex", Locale.KOREA);
}
Modified: james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetchBodyStructure.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetchBodyStructure.java?rev=696828&r1=696827&r2=696828&view=diff
==============================================================================
--- james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetchBodyStructure.java (original)
+++ james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetchBodyStructure.java Thu Sep 18 14:44:56 2008
@@ -21,7 +21,8 @@
import java.util.Locale;
-public abstract class AbstractTestFetchBodyStructure extends AbstractTestSelectedStateBase {
+public abstract class AbstractTestFetchBodyStructure extends
+ AbstractTestSelectedStateBase {
public AbstractTestFetchBodyStructure(HostSystem system) {
super(system);
Modified: james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetchHeaders.java
URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetchHeaders.java?rev=696828&r1=696827&r2=696828&view=diff
==============================================================================
--- james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetchHeaders.java (original)
+++ james/protocols/imap/trunk/seda/src/test/java/org/apache/james/test/functional/imap/AbstractTestFetchHeaders.java Thu Sep 18 14:44:56 2008
@@ -21,7 +21,8 @@
import java.util.Locale;
-public abstract class AbstractTestFetchHeaders extends AbstractTestSelectedStateBase {
+public abstract class AbstractTestFetchHeaders extends
+ AbstractTestSelectedStateBase {
public AbstractTestFetchHeaders(HostSystem system) {
super(system);
@@ -30,23 +31,23 @@
public void testFetchHeaderFieldsUS() throws Exception {
scriptTest("FetchHeaderFields", Locale.US);
}
-
+
public void testFetchHeaderFieldsITALY() throws Exception {
scriptTest("FetchHeaderFields", Locale.ITALY);
}
-
+
public void testFetchHeaderFieldsKOREA() throws Exception {
scriptTest("FetchHeaderFields", Locale.KOREA);
}
-
+
public void testFetchHeaderFieldsNotUS() throws Exception {
scriptTest("FetchHeaderFieldsNot", Locale.US);
}
-
+
public void testFetchHeaderFieldsNotITALY() throws Exception {
scriptTest("FetchHeaderFieldsNot", Locale.ITALY);
}
-
+
public void testFetchHeaderFieldsNotKOREA() throws Exception {
scriptTest("FetchHeaderFieldsNot", Locale.KOREA);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org