Source Code Cross Referenced for AddressListRendererTest.java in  » Mail-Clients » columba-1.4 » org » columba » mail » gui » util » 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.gui.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        //The contents of this file are subject to the Mozilla Public License Version 1.1
02:        //(the "License"); you may not use this file except in compliance with the
03:        //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
04:        //
05:        //Software distributed under the License is distributed on an "AS IS" basis,
06:        //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
07:        //for the specific language governing rights and
08:        //limitations under the License.
09:        //
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.gui.util;
17:
18:        import junit.framework.TestCase;
19:
20:        import org.columba.ristretto.message.Address;
21:
22:        /**
23:         */
24:        public class AddressListRendererTest extends TestCase {
25:
26:            /**
27:             * Test to send an empty Address array to the list.
28:             * The method should not throw an <code>IndexOutOfBoundsException</code> if
29:             * an empty array is sent in.
30:             * @author redsolo
31:             */
32:            public void testRenderWithEmptyArray() {
33:                Address[] addresses = new Address[0];
34:                AddressListRenderer.renderToHTMLWithLinks(addresses);
35:            }
36:
37:            /**
38:             * Test the rendering with only one address.
39:             */
40:            public void testRenderWithSingleItem() {
41:                Address[] addresses = new Address[] { new Address(
42:                        "email@internet.org") };
43:                String actual = AddressListRenderer.renderToHTMLWithLinks(
44:                        addresses).toString();
45:                String expected = "<a href=\"mailto:email@internet.org\">email@internet.org</a>";
46:                assertEquals("address wasnt rendered correctly", expected
47:                        .toLowerCase(), actual.toLowerCase());
48:            }
49:
50:            /**
51:             * Test the rendering with multiple addresses.
52:             */
53:            public void testRenderWithMultipleItems() {
54:                Address[] addresses = new Address[] {
55:                        new Address("email@internet.org"),
56:                        new Address("ftp@internet.org"),
57:                        new Address("web@internet.org") };
58:                String actual = AddressListRenderer.renderToHTMLWithLinks(
59:                        addresses).toString();
60:                String expected = "<a href=\"mailto:email@internet.org\">email@internet.org</a>, "
61:                        + "<a href=\"mailto:ftp@internet.org\">ftp@internet.org</a>, "
62:                        + "<a href=\"mailto:web@internet.org\">web@internet.org</a>";
63:                assertEquals("addresses wasnt rendered correctly", expected
64:                        .toLowerCase(), actual.toLowerCase());
65:            }
66:
67:            /**
68:             * Test the rendering with multiple addresses with display names.
69:             */
70:            public void testRenderWithDisplayName() {
71:                Address[] addresses = new Address[] {
72:                        new Address("Emil", "email@internet.org"),
73:                        new Address("Alfred", "ftp@internet.org") };
74:                String actual = AddressListRenderer.renderToHTMLWithLinks(
75:                        addresses).toString();
76:                String expected = "<a href=\"mailto:email@internet.org\">Emil</a>, "
77:                        + "<a href=\"mailto:ftp@internet.org\">Alfred</a>";
78:                assertEquals("address wasnt rendered correctly", expected
79:                        .toLowerCase(), actual.toLowerCase());
80:            }
81:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.