Java Doc for MediaEntityLocalHomeTest.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 Reference  Class Diagram Java Document (Java Doc) 


com.ibm.emb.junit.EMBTestCaseBase
   com.ibm.emb.test.MediaEntityLocalHomeTest

MediaEntityLocalHomeTest
public class MediaEntityLocalHomeTest extends EMBTestCaseBase (Code)
 Line Item: MEB API
 Subcategory 1: javax.emb
 Subcategory 2: MediaEntityLocalHome
 



Constructor Summary
public  MediaEntityLocalHomeTest(String name)
    

Method Summary
protected  voidsetUp()
    
public  voidtestEMB134()
    
public  voidtestEMB135()
    
public  voidtestEMB136()
    
public  voidtestEMB137()
    
public  voidtestEMB138()
    
public  voidtestEMB139()
    
public  voidtestEMB140()
    
public  voidtestEMB141()
    
 Testcase Name: publishMedia(MediaEntityLocal[], String, ProtocolConstraints)
 Testcase Number: EMB141
 setup: create Media entity from embedded media file
 create constraints with "SERVER_TYPE" set to array of Strings
 test procedure:
 1.a.call publishMedia(null, "TRANSFER_TYPE_BURST", constraints)
 expected result: if web server present, NullPointerException
 else NoServerFoundException
 b.call publishMedia(null, "TRANSFER_TYPE_STREAM", constraints)
 expected result: if stream server present, NullPointerException
 else NoServerFoundException
 2.call publishMedia(new MediaEntityLocal[]{mediaEntity}, invalidTransferType, constraints)
 expected result: IllegalArgumentException
 3.a.call publishMedia(new MediaEntityLocal[]{mediaEntity}, "TRANSFER_TYPE_BURST", constraints)
 expected result: if web server present, media object that is not null
 else NoServerFoundException
 b.call publishMedia(new MediaEntityLocal[]{mediaEntity}.


Constructor Detail
MediaEntityLocalHomeTest
public MediaEntityLocalHomeTest(String name) throws MediaException(Code)




Method Detail
setUp
protected void setUp() throws RemoteException, CreateException(Code)
do initialisation of each individual Test method here this method is called before each individual Test Method



testEMB134
public void testEMB134() throws MediaException, NamingException, FinderException, RemoteException, CreateException(Code)
 Testcase Name: create()
 Testcase Number: EMB134
 setup: create testInstance of MediaEntityLocalHome
 test procedure:
 1.call testInstance.create()
 expected result: new Media entity created and verify primary key is not null
 verify initial values of properties
 



testEMB135
public void testEMB135() throws MediaException, MalformedURLException, IOException, CreateException, NamingException, RemoteException, FinderException(Code)
 Testcase Name: exportMedia(MediaEntityLocal[], URL)
 Testcase Number: EMB135
 setup: create testInstance of MediaEntityLocalHome
 create Media entity me1 from embedded media file
 create Media entity me2 from nonembedded media file
 rebind corresponding formats to registry
 test procedure:
 1.call exportMedia(null, valid location)
 expected result: NullPointerException
 2.call exportMedia(new MediaEntityLocal[]{me1, null}, valid location)
 expected result: 2 element array with second element being null
 3.call exportMedia(new MediaEntityLocal[0], valid location)
 expected result: empty array
 4.call exportMedia(new MediaEntityLocal[]{me1, me2}, valid location)
 expected result: 2 element array of URL's, verify media entities in new location are accessible
 5.repeat test 4
 expected result: files copied and files from test 4 are not overwritten
 6.create Media entity from nonexistent file, add to entity array
 call exportMedia with array and valid location
 expected result: ContentAccessException
 7.create Media entity from random byte array and add to array
 call exportMedia with array and valid location
 expected result: MediaFormatException
 8.call exportMedia(new MediaEntityLocal[]{me1, me1}, valid location)
 expected result: 2 element array of URL's, verify URL's are the same
 9.call exportMedia(new MediaEntityLocal[]{me1}, null)
 expected result: no exception, media copied to default location
 10.call importMedia on two nonembedded media with a common child
 call exportMedia with media entities created and valid location
 expected result: 2 parents copied with only one copy of common child
 use URLs to access media entities and check children
 



testEMB136
public void testEMB136() throws NamingException, MalformedURLException, IOException, FinderException, RemoveException, CreateException, MediaException(Code)
 Testcase Name: findByPartialDescription(String)
 Testcase Number: EMB136
 setup: create Media entities me1, me2, and me3
 call me1.setDescription("foo1")
 call me2.setDescription("foo2")
 leave me3's description as null
 test procedure:
 1.call findByPartialDescription(null)
 expected result: empty array?
 2.call findByPartialDescription("foo")
 expected result: 2 element array
 3.call findByPartialDescription("FOO")
 expected result: empty array
 4.call findByPartialDescription("oO1")
 expected result: empty array
 5.call findByPartialDescription("oO2")
 expected result: empty array
 6.call findByPartialDescription("fooo")
 expected result: empty array
 7.call findByPartialDescription("")
 expected result: 2 element array
 



testEMB137
public void testEMB137() throws NamingException, MalformedURLException, IOException, FinderException, RemoveException, CreateException, MediaException(Code)
 Testcase Name: findByPartialLocation(String)
 Testcase Number: EMB137
 setup: create Media entities me1, me2, and me3
 call me1.setName and me1.setLocation
 call me2.setName and me2.setLocation
 call me3.setName and me3.setContent
 test procedure:
 1.call findByPartialLocation(null)
 expected result: empty array
 2.call findByPartialLocation("file")
 expected result: 1 element array
 3.call findByPartialLocation(location1)
 expected result: 1 element array
 4.call findByPartialLocation(location2)
 expected result: 1 element array
 5.call findByPartialLocation(test client IP address)
 expected result: 2 element array
 6.call findByPartialLocation("//////")
 expected result: empty array
 7.call findByPartialLocation("")
 expected result: empty array
 



testEMB138
public void testEMB138() throws CreateException, MediaException, RemoteException, NamingException, FinderException(Code)
 Testcase Name: findByPrimaryKey(String)
 Testcase Number: EMB138
 setup: create testInstance of MediaEntityLocalHome
 create Media entity me1
 test procedure:
 1.call findByPrimaryKey(null)
 expected result: NullPointerException
 2.call findByPrimaryKey(random String)
 expected result: javax.ejb.FinderException
 3.call findByPrimaryKey(pk of me1)
 expected result: me1
 



testEMB139
public void testEMB139() throws MediaException, CreateException, IOException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: importMedia(URL[], String[])
 Testcase Number: EMB139
 setup: create Media entity me1 from embedded media file
 create Media entity me2 from nonembedded media file
 location1 = me1.getLocation()
 location2 = me2.getLocation()
 test procedure:
 1.call importMedia(null, valid names)
 expected result: NullPointerException
 2.call importMedia(new URL[]{location1, null}, valid names)
 expected result: 2 element array with second being null
 3.call importMedia(new URL[]{location1, location2}, valid names)
 expected result: new entities created
 verify children of me2 also created
 4.call importMedia(new URL[]{location1, location1}, valid names)
 expected result: 2 element array with both being same entity
 5.call importMedia(new URL[0], new String[0])
 expected result: empty array
 6.call importMedia(new URL[]{location1}, null)
 expected result: no exception, verify getName is not null
 7.create Media entity me3 from corrupted bmp file
 call importMedia(new URL[]{me3.getLocation}, valid name)
 expected result: MediaFormatException
 8.create URL pointing to nonexistent file
 call importMedia(new URL[]{urlToNonexistentFile}, valid name)
 expected result: ContentAccessException
 9.call importMedia(new URL[]{location1}, invalid name)
 expected result: IllegalArgumentException
 10.call importMedia(new URL[] {location1}, new String[] {name1, name2})
 expected result: IllegalArgumentException
 11.call importMedia with URL pointing to file larger than maxMediaSize
 expected result: ContentTooLargeException
 



testEMB140
public void testEMB140() throws MediaException, NamingException, IOException, CreateException, FinderException(Code)
 Testcase Name: publishContent(Media, String, ProtocolConstraints)
 Testcase Number: EMB140
 setup: create Media object from embedded media file
 create Media entity from embedded media file
 create constraints with "SERVER_TYPE" set to array of Strings
 test procedure:
 1.a.call publishContent(null, "TRANSFER_TYPE_BURST", constraints)
 expected result: if web server present, NullPointerException
 else NoServerFoundException
 b.call publishContent(null, "TRANSFER_TYPE_STREAM", constraints)
 expected result: if stream server present, NullPointerException
 else NoServerFoundException
 2.call publishContent(mediaObject, invalidTransferType, constraints)
 expected result: IllegalArgumentException
 3.a.call publishContent(mediaObject, "TRANSFER_TYPE_BURST", constraints)
 expected result: if web server present, URL pointing to media object on server
 else NoServerFoundException
 b.call publishContent(mediaObject, "TRANSFER_TYPE_STREAM", constraints)
 expected result: if stream server present, URL pointing to media object on server
 else NoServerFoundException
 4.a.call publishContent(mediaObject, "TRANSFER_TYPE_BURST", null)
 expected result: if web server present, URL pointing to media object on server
 else NoServerFoundException
 b.call publishContent(mediaObject, "TRANSFER_TYPE_STREAM", null)
 expected result: if stream server present, URL pointing to media object on server
 else NoServerFoundException
 5.create Media entity from nonexistent file
 a.call publishContent(nonexistentMediaEntity, "TRANSFER_TYPE_BURST", constraints)
 expected result: if web server present, ContentAccessException
 else NoServerFoundException
 b.call publishContent(nonexistentMediaEntity, "TRANSFER_TYPE_STREAM", constraints
 expected result: if stream server present, ContentAccessException
 else NoServerFoundException
 6.call publishContent(mediaEntity, invalidTransferType, constraints)
 expected result: IllegalArgumentException
 7.a.call publishContent(mediaEntity, "TRANSFER_TYPE_BURST", constraints)
 expected result: if web server present, URL pointing to media object on server
 else NoServerFoundException
 b.call publishContent(mediaEntity, "TRANSFER_TYPE_STREAM", constraints)
 expected result: if stream server present, URL pointing to media object on server
 else NoServerFoundException
 8.a.call publishContent(mediaEntity, "TRANSFER_TYPE_BURST", null)
 expected result: if web server present, URL pointing to media object on server
 else NoServerFoundException
 b.call publishContent(mediaEntity, "TRANSFER_TYPE_STREAM", null)
 expected result: if stream server present, URL pointing to media object on server
 else NoServerFoundException
 9.a.call publishContent(nonembeddedMediaBean, "TRANSFER_TYPE_BURST", constraints)
 expected result: if web server present, ContentAccessException
 else NoServerFoundException
 b.call publishContent(nonembeddedMediaBean, "TRANSFER_TYPE_STREAM", constraints)
 expected result: if web server present, ContentAccessException
 else NoServerFoundException
 10.a.call publishContent(nonembeddedMediaEntityBean, "TRANSFER_TYPE_BURST", constraints)
 expected result: if web server present, ContentAccessException
 else NoServerFoundException
 b.call publishContent(nonembeddedMediaEntityBean, "TRANSFER_TYPE_STREAM", constraints)
 expected result: if web server present, ContentAccessException
 else NoServerFoundException
 



testEMB141
public void testEMB141() throws MediaException, NamingException, IOException, CreateException, FinderException(Code)
 Testcase Name: publishMedia(MediaEntityLocal[], String, ProtocolConstraints)
 Testcase Number: EMB141
 setup: create Media entity from embedded media file
 create constraints with "SERVER_TYPE" set to array of Strings
 test procedure:
 1.a.call publishMedia(null, "TRANSFER_TYPE_BURST", constraints)
 expected result: if web server present, NullPointerException
 else NoServerFoundException
 b.call publishMedia(null, "TRANSFER_TYPE_STREAM", constraints)
 expected result: if stream server present, NullPointerException
 else NoServerFoundException
 2.call publishMedia(new MediaEntityLocal[]{mediaEntity}, invalidTransferType, constraints)
 expected result: IllegalArgumentException
 3.a.call publishMedia(new MediaEntityLocal[]{mediaEntity}, "TRANSFER_TYPE_BURST", constraints)
 expected result: if web server present, media object that is not null
 else NoServerFoundException
 b.call publishMedia(new MediaEntityLocal[]{mediaEntity}. "TRANSFER_TYPE_BURST", constraints)
 expected result: if stream server present, media object that is not null
 else NoServerFoundException
 4.a.call publishMedia(new MediaEntityLocal[]{mediaEntity}, "TRANSFER_TYPE_BURST", null)
 expected result: if web server present, media object that is not null
 else NoServerFoundException
 b.call publishMedia(new MediaEntityLocal[]{mediaEntity}. "TRANSFER_TYPE_BURST", null)
 expected result: if stream server present, media object that is not null
 else NoServerFoundException
 5.create Media entity from random content file
 a.call publishMedia(new MediaEntityLocal[]{mediaEntity}, "TRANSFER_TYPE_BURST", constraints)
 expected result: if web server present, MediaFormatException
 else NoServerFoundException
 b.call publishMedia(new MediaEntityLocal[]{mediaEntity}. "TRANSFER_TYPE_BURST", constraints)
 expected result: if stream server present, MediaFormatException
 else NoServerFoundException
 6.create Media entity from nonexistent file
 a.call publishMedia(new MediaEntityLocal[]{mediaEntity}, "TRANSFER_TYPE_BURST", constraints)
 expected result: if web server present, ContentAccessException
 else NoServerFoundException
 b.call publishMedia(new MediaEntityLocal[]{mediaEntity}. "TRANSFER_TYPE_BURST", constraints)
 expected result: if stream server present, ContentAccessException
 else NoServerFoundException
 7.a.call publishMedia(new MediaEntityLocal[0], "TRANSFER_TYPE_BURST", constraints)
 expected result: if web server present, no exception (check media obj not null)
 else NoServerFoundException
 b.call publishMedia(new MediaEntityLocal[0], "TRANSFER_TYPE_STREAM", constraints)
 expected result: if web server present, no exception (check media obj not null)
 else NoServerFoundException
 8.a.call publishMedia(new MediaEntityLocal[]{mediaEntity, mediaEntity}, "TRANSFER_TYPE_BURST", constraints)
 expected result: if web server present, media object not null
 else NoServerFoundException
 b.call publishMedia(new MediaEntityLocal[]{mediaEntity, mediaEntity}, "TRANSFER_TYPE_STREAM", constraints)
 expected result: if web server present, media object not null
 else NoServerFoundException
 



Fields inherited from com.ibm.emb.junit.EMBTestCaseBase
protected EMBTestConfiguration embTestConfig(Code)(Java Doc)

Methods inherited from com.ibm.emb.junit.EMBTestCaseBase
public static byte[] getByteArrayFromFile(File arg) throws IOException(Code)(Java Doc)
public void logProductError(String msg)(Code)(Java Doc)
public static void removeFilesInDir(File srcDir) throws IOException(Code)(Java Doc)
protected void setUp() throws Exception(Code)(Java Doc)
public void succeed(String msg)(Code)(Java Doc)
public void succeed()(Code)(Java Doc)
protected void tearDown() throws Exception(Code)(Java Doc)
public void testError(String msg)(Code)(Java Doc)
public void testLog(String msg)(Code)(Java Doc)
public void testTrace(String msg)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.