KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > mail > folder > command > MoveFolderCommandTest


1 //The contents of this file are subject to the Mozilla Public License Version 1.1
2
//(the "License"); you may not use this file except in compliance with the
3
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
4
//
5
//Software distributed under the License is distributed on an "AS IS" basis,
6
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
7
//for the specific language governing rights and
8
//limitations under the License.
9
//
10
//The Original Code is "The Columba Project"
11
//
12
//The Initial Developers of the Original Code are Frederik Dietz and Timo Stich.
13
//Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
14
//
15
//All Rights Reserved.
16
package org.columba.mail.folder.command;
17
18 import org.columba.mail.folder.AbstractFolderTst;
19 import org.columba.mail.folder.MailboxTstFactory;
20
21 /**
22  * Test cases for the MoveFolder command.
23  *
24  * @author redsolo
25  */

26 public class MoveFolderCommandTest extends AbstractFolderTst {
27
28     public MoveFolderCommandTest(String JavaDoc arg0) {
29         super(arg0);
30     }
31
32     public MoveFolderCommandTest(MailboxTstFactory factory, String JavaDoc arg0) {
33         super(factory, arg0);
34     }
35
36     /**
37      * Tests the execute() method.
38      *
39      * @throws Exception
40      * thrown for any bad reason if the command goes wrong.
41      */

42     public void testMoveFolder() throws Exception JavaDoc {
43         // @author: fdietz
44
// Disabled this testcase, as it doesn't really fit into
45
// this category of message operations
46
// It fails because we would have to create a folder-hierarchy
47
// including parent folders to execute the move
48

49 // AbstractMessageFolder rootFolder = createFolder();
50
//
51
// // Is not supported by IMAP and TempFolder
52
// if (rootFolder instanceof IMAPFolder
53
// || rootFolder instanceof TempFolder) {
54
// return;
55
// }
56
//
57
// AbstractMessageFolder folderToBeMoved = createFolder();
58
// folderToBeMoved.moveTo(rootFolder);
59
//
60
// AbstractMessageFolder destinationFolder = createFolder();
61
// folderToBeMoved.moveTo(rootFolder);
62
//
63
// // create Command reference
64
// MailFolderCommandReference ref = new MailFolderCommandReference(
65
// folderToBeMoved, destinationFolder);
66
//
67
// MoveFolderCommand command = new MoveFolderCommand(ref);
68
// command.execute(NullWorkerStatusController.getInstance());
69
//
70
// assertEquals("The destination folders child size is incorrect.", 1,
71
// destinationFolder.getChildCount());
72
// assertEquals("The root folder has more than one child", 1,
73
// destinationFolder.getChildCount());
74
// assertEquals("The moved folders parent is not the destination folder",
75
// destinationFolder, folderToBeMoved.getParent());
76
}
77 }
Popular Tags