Source Code Cross Referenced for MediaConverterSpecTest.java in  » J2EE » JOnAS-4.8.6 » com » ibm » emb » test » 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 » J2EE » JOnAS 4.8.6 » com.ibm.emb.test 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.ibm.emb.test;
002:
003:        import javax.emb.MediaConverterSpec;
004:        import javax.emb.MediaException;
005:
006:        import junit.framework.Test;
007:        import junit.framework.TestSuite;
008:
009:        import com.ibm.emb.junit.EMBStaticHelper;
010:        import com.ibm.emb.junit.EMBTestCaseBase;
011:
012:        /**
013:         * <pre>
014:         * 
015:         *  Line Item: MFB API 
016:         *  Subcategory 1: javax.emb
017:         *  Subcategory 2: MediaConverterSpec
018:         *  
019:         *  This abstract class provides test methods for all Methods described in the interface 
020:         *  MediaConverterSpec. 
021:         *  For testing implementations of this interface one needs to create a Tester
022:         *  class which extends this abstract class.
023:         *  
024:         * </pre>
025:         */
026:        public abstract class MediaConverterSpecTest extends EMBTestCaseBase {
027:
028:            public MediaConverterSpecTest(String name) throws MediaException {
029:                super (name);
030:            }
031:
032:            /**
033:             * stdSuite method of this test class instantiates all tests necesssary to
034:             * for the standard compliance tests
035:             * @param String complete class Name of the implementor of the abstract test
036:             */
037:            public static Test stdSuite(String TestCaseImplementor) {
038:                TestSuite suite = new TestSuite(TestCaseImplementor);
039:                try {
040:                    Class implementorClass = Class.forName(TestCaseImplementor);
041:                    java.lang.reflect.Constructor implementorConstructor = implementorClass
042:                            .getDeclaredConstructor(new Class[] { String.class });
043:                    suite.addTest((Test) implementorConstructor
044:                            .newInstance(new String[] { "testEMB041" }));
045:                    suite.addTest((Test) implementorConstructor
046:                            .newInstance(new String[] { "testEMB042" }));
047:                    suite.addTest((Test) implementorConstructor
048:                            .newInstance(new String[] { "testEMB043" }));
049:                } catch (java.lang.reflect.InvocationTargetException ex) {
050:                    String msg = "error dynamically creating "
051:                            + TestCaseImplementor + " " + ex.toString();
052:                    EMBStaticHelper.testTrace(msg);
053:                    throw new RuntimeException(msg);
054:                } catch (ClassNotFoundException ex) {
055:                    String msg = "Class not found " + TestCaseImplementor + " "
056:                            + ex.toString();
057:                    EMBStaticHelper.testTrace(msg);
058:                    throw new RuntimeException(msg);
059:                } catch (NoSuchMethodException ex) {
060:                    String msg = "No such method in " + TestCaseImplementor
061:                            + " " + ex.toString();
062:                    EMBStaticHelper.testTrace(msg);
063:                    throw new RuntimeException(msg);
064:                } catch (InstantiationException ex) {
065:                    String msg = TestCaseImplementor + " " + ex.toString();
066:                    EMBStaticHelper.testTrace(msg);
067:                    throw new RuntimeException(msg);
068:                } catch (IllegalAccessException ex) {
069:                    String msg = TestCaseImplementor + " " + ex.toString();
070:                    EMBStaticHelper.testTrace(msg);
071:                    throw new RuntimeException(msg);
072:                }
073:                return suite;
074:            }
075:
076:            /**
077:             * abstract method to create an instance of MediaConverterSpec this method
078:             * needs to be implemented in the test subclass and will create an Instance
079:             * of the concrete implementation of the class under test
080:             */
081:            public abstract MediaConverterSpec createMediaConverterSpec();
082:
083:            /**
084:             * <pre>
085:             * 
086:             *  Testcase Name: getConverter()
087:             *  Testcase Number: EMB041
088:             *  
089:             *  setup:
090:             *  
091:             *  test procedure:  
092:             *  1.call getConverter()
093:             *    expected result: not null and instance of MediaConverter
094:             *  
095:             * </pre>
096:             */
097:            public void testEMB041() {
098:                //
099:                // test 1
100:                //
101:                MediaConverterSpec testInstance = createMediaConverterSpec();
102:                assertNotNull("test1 : ", testInstance);
103:                testTrace("test 1 passed");
104:
105:                succeed();
106:            }
107:
108:            /**
109:             * <pre>
110:             * 
111:             *  Testcase Name: getTargetFileExtension() {
112:             *  Testcase Number: EMB042
113:             *  
114:             *  setup:
115:             *  
116:             *  test procedure:
117:             *  1.call getTargetFileExtension
118:             *    expected result: return string without separator characters
119:             *  
120:             * </pre>
121:             */
122:            public void testEMB042() {
123:                //
124:                // test 1
125:                // 
126:                MediaConverterSpec testInstance = createMediaConverterSpec();
127:                String fileExt = testInstance.getTargetFileExtension();
128:                if (fileExt != null) {
129:                    assertEquals("test 1: ", -1, fileExt.indexOf('\\'));
130:                    assertEquals("test 1: ", -1, fileExt.indexOf('/'));
131:                    assertEquals("test 1: ", -1, fileExt.indexOf(':'));
132:                    assertEquals("test 1: ", -1, fileExt.indexOf(';'));
133:                    assertEquals("test 1: ", -1, fileExt.indexOf('.'));
134:                }
135:
136:                testTrace("test 1 passed");
137:                succeed();
138:            }
139:
140:            /**
141:             * <pre>
142:             * 
143:             *  Testcase Name: getTargetMimeType()
144:             *  Testcase Number: EMB043
145:             *  
146:             *  setup:
147:             *  
148:             *  test procedure:
149:             *  1.create MediaConverterSpec testInstance and call getTargetMimeType
150:             *    expected result: string or null
151:             *  
152:             * </pre>
153:             */
154:            public void testEMB043() {
155:                //
156:                // test 1
157:                //
158:                MediaConverterSpec testInstance = createMediaConverterSpec();
159:                assertTrue("test 1: ", testInstance.getTargetMimeType() != "");
160:                testTrace("test 1 passed");
161:                succeed();
162:            }
163:
164:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.