Source Code Cross Referenced for TestMethodSetManager.java in  » Code-Analyzer » JBlanket » csdl » jblanket » methodset » 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 » Code Analyzer » JBlanket » csdl.jblanket.methodset 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package csdl.jblanket.methodset;
002:
003:        import java.util.ArrayList;
004:        import java.util.List;
005:
006:        import java.io.File;
007:
008:        import junit.framework.TestCase;
009:        import junit.framework.TestSuite;
010:        import junit.textui.TestRunner;
011:
012:        /**
013:         * Tests the Singleton MethodSetManager.
014:         *
015:         * @author Joy M. Agustin
016:         * @version $Id: TestMethodSetManager.java,v 1.1 2004/11/07 00:32:40 timshadel Exp $
017:         */
018:        public class TestMethodSetManager extends TestCase {
019:
020:            /** Name of XML file to retrieve*/
021:            private final String xmlFile1 = "xmlFile1.xml";
022:
023:            /** MethodSet object 1 */
024:            private MethodSet methodSet1;
025:            /** MethodSet object 2 */
026:            private MethodSet methodSet2;
027:
028:            /** MethodInfo object with 2 parameters */
029:            private MethodInfo methodInfo1;
030:            /** MethodInfo object with no parameters */
031:            private MethodInfo methodInfo2;
032:
033:            /** Fully qualified class name for first class*/
034:            private final String class1 = "java.lang.String";
035:            /** Fully qualified class name for second class*/
036:            private final String class2 = "java.lang.Boolean";
037:            /** Fully qualified class name for third class */
038:            private final String class3 = "foo.bar.Baz";
039:            /** Fully qualified class name for fourth class */
040:            private final String class4 = "foo.bar.Foo";
041:
042:            /** Name of first method */
043:            private final String method1 = "getQux";
044:            /** Name of second method */
045:            private final String method2 = "setQux";
046:
047:            /** Directory seperator */
048:            private final String slash = File.separator;
049:
050:            /**
051:             * Required for JUnit.
052:             *
053:             * @param name test case name.
054:             */
055:            public TestMethodSetManager(String name) {
056:                super (name);
057:            }
058:
059:            /**
060:             * Sets up variables for testing.
061:             */
062:            public void setUp() {
063:                // Create MethodInfo instances.
064:                List params = new ArrayList();
065:                params.add(class1);
066:                params.add(class2);
067:                methodInfo1 = new MethodInfo(class3, method1, params);
068:
069:                methodInfo2 = new MethodInfo(class4, method2, new ArrayList());
070:
071:                // Create MethodSets instances
072:                methodSet1 = new MethodSet();
073:                methodSet2 = new MethodSet();
074:            }
075:
076:            /**
077:             * Tests the <code>getMethodSet</code> method from the MethodSetManager class.
078:             *
079:             * @throws Exception if problems occur.
080:             */
081:            public void testMethodSetManager() throws Exception {
082:
083:                // get a MethodSet instance for xmlFile1
084:                MethodSetManager manager = MethodSetManager.getInstance();
085:                methodSet1 = manager.getMethodSet(xmlFile1);
086:
087:                // alter MethodSet instance
088:                methodSet1.add(methodInfo1);
089:                methodSet1.add(methodInfo2);
090:
091:                // make sure retrieve the same MethodSet instance from MethodSetManager
092:                methodSet2 = manager.getMethodSet(xmlFile1);
093:                assertTrue("checking that only one instance per file name",
094:                        methodSet1.equals(methodSet2));
095:            }
096:
097:            /**
098:             * Provide stand-alone execution of this test case during initial development.
099:             *
100:             * @param args the command line arguments
101:             */
102:            public static void main(String[] args) {
103:                System.out.println("JUnit testing MethodSetManager.");
104:                //Runs all no-arg methods starting with "test".
105:                TestRunner.run(new TestSuite(TestMethodSet.class));
106:            }
107:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.