Source Code Cross Referenced for MarkMessageTest.java in  » Mail-Clients » columba-1.4 » org » columba » mail » folder » command » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Mail Clients » columba 1.4 » org.columba.mail.folder.command 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //The contents of this file are subject to the Mozilla Public License Version
002:        //1.1
003:        //(the "License"); you may not use this file except in compliance with the
004:        //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
005:        //
006:        //Software distributed under the License is distributed on an "AS IS" basis,
007:        //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
008:        //for the specific language governing rights and
009:        //limitations under the License.
010:        //
011:        //The Original Code is "The Columba Project"
012:        //
013:        //The Initial Developers of the Original Code are Frederik Dietz and Timo
014:        //Stich.
015:        //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
016:        //
017:        //All Rights Reserved.
018:
019:        package org.columba.mail.folder.command;
020:
021:        import java.io.ByteArrayInputStream;
022:
023:        import org.columba.core.command.NullWorkerStatusController;
024:        import org.columba.mail.command.MailFolderCommandReference;
025:        import org.columba.mail.folder.AbstractFolderTst;
026:        import org.columba.mail.folder.FolderTstHelper;
027:        import org.columba.mail.folder.MailboxTstFactory;
028:        import org.columba.ristretto.message.Flags;
029:
030:        /**
031:         * @author fdietz
032:         */
033:        public class MarkMessageTest extends AbstractFolderTst {
034:
035:            private Object uid;
036:
037:            private ByteArrayInputStream inputStream;
038:
039:            public MarkMessageTest(String arg0) {
040:                super (arg0);
041:            }
042:
043:            /**
044:             * @param arg0
045:             */
046:            public MarkMessageTest(MailboxTstFactory factory, String arg0) {
047:                super (factory, arg0);
048:            }
049:
050:            public void testMarkAsReadMessage() throws Exception {
051:
052:                //    	 create Command reference
053:                MailFolderCommandReference ref = new MailFolderCommandReference(
054:                        getSourceFolder(), new Object[] { uid });
055:                ref.setMarkVariant(MarkMessageCommand.MARK_AS_READ);
056:
057:                // create copy command
058:                MarkMessageCommand command = new MarkMessageCommand(ref);
059:
060:                // execute command -> use mock object class as worker which does
061:                // nothing
062:                command.execute(NullWorkerStatusController.getInstance());
063:
064:                Flags flags = getSourceFolder().getFlags(uid);
065:
066:                assertEquals("message should be marked as read", true, flags
067:                        .getSeen());
068:
069:            }
070:
071:            public void testMarkAsFlaggedMessage() throws Exception {
072:
073:                //    	 create Command reference
074:                MailFolderCommandReference ref = new MailFolderCommandReference(
075:                        getSourceFolder(), new Object[] { uid });
076:
077:                ref.setMarkVariant(MarkMessageCommand.MARK_AS_FLAGGED);
078:
079:                // create copy command
080:                MarkMessageCommand command = new MarkMessageCommand(ref);
081:
082:                // execute command -> use mock object class as worker which does
083:                // nothing
084:                command.execute(NullWorkerStatusController.getInstance());
085:
086:                Flags flags = getSourceFolder().getFlags(uid);
087:
088:                assertEquals("message should be marked as flagged", true, flags
089:                        .getFlagged());
090:
091:            }
092:
093:            public void testMarkAsExpungedMessage() throws Exception {
094:
095:                //   	 create Command reference
096:                MailFolderCommandReference ref = new MailFolderCommandReference(
097:                        getSourceFolder(), new Object[] { uid });
098:                ref.setMarkVariant(MarkMessageCommand.MARK_AS_EXPUNGED);
099:
100:                // create copy command
101:                MarkMessageCommand command = new MarkMessageCommand(ref);
102:
103:                // execute command -> use mock object class as worker which does
104:                // nothing
105:                command.execute(NullWorkerStatusController.getInstance());
106:
107:                Flags flags = getSourceFolder().getFlags(uid);
108:
109:                assertEquals("message should be marked as expunged", true,
110:                        flags.getDeleted());
111:
112:            }
113:
114:            /**
115:             * @see junit.framework.TestCase#setUp()
116:             */
117:            protected void setUp() throws Exception {
118:                // create folders, etc.
119:                super .setUp();
120:
121:                // add message "0.eml" as inputstream to folder
122:                String input = FolderTstHelper.getString(0);
123:                System.out.println("input=" + input);
124:                // create stream from string
125:                inputStream = FolderTstHelper.getByteArrayInputStream(input);
126:                // add stream to folder
127:                uid = getSourceFolder().addMessage(inputStream);
128:
129:            }
130:
131:            /**
132:             * @see junit.framework.TestCase#tearDown()
133:             */
134:            protected void tearDown() throws Exception {
135:                // close streams
136:                inputStream.close();
137:
138:                // delete folders
139:                super.tearDown();
140:
141:            }
142:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.