Source Code Cross Referenced for ClassSelectorTestCase.java in  » Web-Server » JicarillaHTTP » org » jicarilla » container » test » selectors » 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 » Web Server » JicarillaHTTP » org.jicarilla.container.test.selectors 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* ====================================================================
002:        The Jicarilla Software License
003:
004:        Copyright (c) 2003 Leo Simons.
005:        All rights reserved.
006:
007:        Permission is hereby granted, free of charge, to any person obtaining
008:        a copy of this software and associated documentation files (the
009:        "Software"), to deal in the Software without restriction, including
010:        without limitation the rights to use, copy, modify, merge, publish,
011:        distribute, sublicense, and/or sell copies of the Software, and to
012:        permit persons to whom the Software is furnished to do so, subject to
013:        the following conditions:
014:
015:        The above copyright notice and this permission notice shall be
016:        included in all copies or substantial portions of the Software.
017:
018:        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
019:        EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
020:        MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
021:        IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
022:        CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
023:        TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
024:        SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
025:        ==================================================================== */
026:        package org.jicarilla.container.test.selectors;
027:
028:        import junit.framework.TestCase;
029:        import org.jicarilla.container.selectors.ClassSelector;
030:        import org.jicarilla.container.tck.components.interfaces.Homer;
031:        import org.jicarilla.container.tck.components.interfaces.HotdogBuyer;
032:        import org.jicarilla.container.tck.components.type3.rich.HomerImpl;
033:        import org.jicarilla.lang.StringSelector;
034:        import org.jicarilla.lang.TrueSelector;
035:
036:        /**
037:         * @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
038:         * @version $Id: ClassSelectorTestCase.java,v 1.7 2004/03/23 13:37:53 lsimons Exp $
039:         */
040:        public class ClassSelectorTestCase extends TestCase {
041:            public void testEverything() {
042:                ClassSelector selector = new ClassSelector(HomerImpl.class);
043:
044:                assertFalse(selector.select(null));
045:                assertFalse(selector.select(this ));
046:
047:                assertTrue(selector.select(Homer.class));
048:                assertTrue(selector.select(HomerImpl.class));
049:                assertTrue(selector.select(HotdogBuyer.class));
050:
051:                assertTrue(selector.select(Homer.class.getName()));
052:                assertTrue(selector.select(HomerImpl.class.getName()));
053:                assertTrue(selector.select(HotdogBuyer.class.getName()));
054:
055:                assertFalse(selector.select(new HomerImpl()));
056:            }
057:
058:            public void testExceptions() {
059:                Throwable t = null;
060:                try {
061:                    new ClassSelector(null);
062:                } catch (AssertionError th) {
063:                    t = th;
064:                }
065:                assertNotNull(t);
066:            }
067:
068:            public void testGetCriterion() {
069:                ClassSelector selector = new ClassSelector(this .getClass());
070:                assertEquals(this .getClass(), selector.getCriterion());
071:            }
072:
073:            ClassSelector selector = new ClassSelector(ClassSelector.class);
074:            ClassSelector selector2 = new ClassSelector(ClassSelector.class);
075:            ClassSelector selector3 = new ClassSelector(this .getClass());
076:            ClassSelector selector4 = new ClassSelector(this .getClass());
077:
078:            TrueSelector ts = new TrueSelector();
079:
080:            public void testEquals() {
081:                assertTrue(selector.equals(selector));
082:                assertTrue(selector.equals(selector2));
083:                assertFalse(selector.equals(selector3));
084:                assertFalse(selector.equals(selector4));
085:                assertFalse(selector.equals(null));
086:                assertFalse(selector.equals(this ));
087:                assertFalse(selector.equals(ts));
088:
089:                assertFalse(selector3.equals(selector));
090:                assertFalse(selector3.equals(selector2));
091:                assertTrue(selector3.equals(selector3));
092:                assertTrue(selector3.equals(selector4));
093:                assertFalse(selector3.equals(null));
094:                assertFalse(selector3.equals(this ));
095:                assertFalse(selector3.equals(ts));
096:            }
097:
098:            public void testHashCode() {
099:                assertEquals(selector.hashCode(), selector.hashCode());
100:                assertEquals(selector.hashCode(), selector2.hashCode());
101:                assertEquals(selector3.hashCode(), selector3.hashCode());
102:                assertEquals(selector4.hashCode(), selector4.hashCode());
103:
104:                assertFalse(selector.hashCode() == selector3.hashCode());
105:                assertFalse(selector.hashCode() == selector4.hashCode());
106:                assertFalse(selector.hashCode() == -1);
107:                assertFalse(selector.hashCode() == this .hashCode());
108:                assertFalse(selector.hashCode() == ts.hashCode());
109:
110:                assertFalse(selector3.hashCode() == selector.hashCode());
111:                assertFalse(selector3.hashCode() == selector2.hashCode());
112:                assertFalse(selector3.hashCode() == -1);
113:                assertFalse(selector3.hashCode() == this.hashCode());
114:                assertFalse(selector3.hashCode() == ts.hashCode());
115:            }
116:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.