Java Doc for MetaDataEntityLocalTest.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.MetaDataEntityLocalTest

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



Constructor Summary
public  MetaDataEntityLocalTest(String name)
     Constructor for MetaDataEntityLocalTest.

Method Summary
protected  voidsetUp()
    
protected  voidtearDown()
    
public  voidtestEMB148()
    
public  voidtestEMB149()
    
public  voidtestEMB150()
    
public  voidtestEMB151()
    
public  voidtestEMB152()
    
public  voidtestEMB153()
    
public  voidtestEMB154()
    
public  voidtestEMB155()
    
public  voidtestEMB156()
    
public  voidtestEMB157()
    
public  voidtestEMB158()
    
public  voidtestEMB159()
    
public  voidtestEMB160()
    
public  voidtestEMB161()
    
public  voidtestEMB162()
    
public  voidtestEMB163()
    
public  voidtestEMB164()
    
protected static  booleanxmlCompare(Element expected, Element actual)
    


Constructor Detail
MetaDataEntityLocalTest
public MetaDataEntityLocalTest(String name) throws MediaException(Code)
Constructor for MetaDataEntityLocalTest.
Parameters:
  name -




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



tearDown
protected void tearDown() throws IOException(Code)



testEMB148
public void testEMB148() throws IOException, MediaException, CreateException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: addChild(MetaDataEntityLocal)
 Testcase Number: EMB148
 setup: create meta data entities md1, md2, and md3
 test procedure:
 1.call md1.addChild(null)
 expected result: NullPointerException
 2.call md1.addChild(md3)
 expected result: no exception
 call md1.getChildren() and verify 1 element array containing md3
 call md3.getParents() and verify 1 element array containing md1
 3.call md2.addChild(md3)
 expected result: no exception
 call md2.getChildren() and verify 1 element array containing md3
 call md1.getChildren() and check that md3 is still in array
 call md3.getParents() and check that md1 and md2 are listed
 



testEMB149
public void testEMB149() throws IOException, MediaException, CreateException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: addMediaEntity(MediaEntityLocal)
 Testcase Number: EMB149
 setup: create Media entities me1 and me2
 create meta data entities md1 and md2
 test procedure:
 1.call md1.addMediaEntity(null)
 expected result: NullPointerException
 2.call md1.addMediaEntity(me1)
 expected result: no exception
 call md1.getMediaEntities() and verify me1 is in array
 3.call md1.addMediaEntity(me2)
 expected result: no exception
 call md1.getMediaEntities() and verify two elements in array
 4.call md2.addMediaEntity(me1)
 expected result: no exception
 call md2.getMediaEntities() and verify one element in array
 call md1.getMediaEntities() and verify two elements in array
 



testEMB150
public void testEMB150() throws IOException, CreateException, MediaException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: getChildren()
 Testcase Number: EMB150
 setup: create meta data entities md1, md2, and md3
 test procedure:
 1.call md1.addChild(md2), call md1.addChild(md3)
 call md1.getChildren()
 expected result: 2 element array containing md2 and md3
 2.call md2.getChildren()
 expected result: empty array
 



testEMB151
public void testEMB151() throws InterruptedException, IOException, MediaException, CreateException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: getLastModified()
 Testcase Number: EMB151
 setup: create meta data entity md1
 test procedure:
 1.call getLastModified()
 expected result: no exception and not null
 2.call getLastModified and remember timestamp
 wait 2 seconds and call setName(randomString)
 call getLastModified
 expected result: timestamp updated
 



testEMB152
public void testEMB152() throws IOException, CreateException, MediaException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: getMediaEntities()
 Testcase Number: EMB152
 setup: create Media entities me1 and me2
 create meta data entity md1 and md2
 test procedure:
 1.call md1.addMediaEntity(me1)
 call md1.addMediaEntity(me2)
 call md1.getMediaEntities()
 expected result: 2 element array containing me1 and me2
 2.call md2.getMediaEntities()
 expected result: empty array
 



testEMB153
public void testEMB153() throws IOException, CreateException, MediaException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: getMediaEntities(MediaFormat, boolean)
 Testcase Number: EMB153
 setup: create Media entities me1 and me2 from jpg files and me3 from bmp file
 create meta data entities md1 and md2
 test procedure:
 1.call md1.getMediaEntities(null, false)
 expected result: NullPointerException
 2.rebind "jpg" and "bmp" to format registry
 call md1.addChild(md2)
 call md1.addMediaEntity(me1)
 call md2.addMediaEntity(me2)
 call md2.addMediaEntity(me3)
 call md1.getMediaEntities(new JpegFormat(), false)
 expected result: 1 element array containing me1
 3.call md1.getMediaEntities(new JpegFormat(), true)
 expected result: 2 element array
 4.call md1.getMediaEntities(new BmpFormat(), false)
 expected result: empty array
 5.call md1.getMediaEntities(new BmpFormat(), true)
 expected result: 1 element array
 



testEMB154
public void testEMB154() throws IOException, MediaException, CreateException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: getMediaEntities(String, boolean)
 Testcase Number: EMB154
 setup: create Media entities me1 and me2 from jpg files and me3 from bmp file
 create meta data entities md1 and md2
 test procedure:
 1.call md1.getMediaEntities(null, false)
 expected result: NullPointerException
 2.rebind "jpg" and "bmp" to format registry
 call md1.addChild(md2)
 call md1.addMediaEntity(me1)
 call md2.addMediaEntity(me2)
 call md2.addMediaEntity(me3)
 call md1.getMediaEntities("image/jpeg", false)
 expected result: 1 element array containing me1
 3.call md1.getMediaEntities("image/jpeg", true)
 expected result: 2 element array
 4.call md1.getMediaEntities("image/bmp", false)
 expected result: empty array
 5.call md1.getMediaEntities("image/bmp", true)
 expected result: 1 element array
 



testEMB155
public void testEMB155() throws IOException, MediaException, CreateException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: getName()
 Testcase Number: EMB155
 setup: create meta data entity testInstance
 test procedure:
 1.call testInstance.setName(randomString)
 call testInstance.getName()
 expected result: randomString
 



testEMB156
public void testEMB156() throws IOException, CreateException, MediaException, RemoteException, NamingException, FinderException, RemoveException(Code)
Testcase Name: getNextVersion() Testcase Number: EMB156 setup: create meta data entities md1 and md2 test procedure: 1.call md2.setPreviousVersion(md1) expected result: md1.getPreviousVersion is null md1.getNextVersion is md2 2.call md2.getNextVersion() expected result: null md2.getPreviousVersion is md1



testEMB157
public void testEMB157() throws IOException, MediaException, CreateException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: getParents()
 Testcase Number: EMB157
 setup: create meta data entities md1, md2, and md3
 test procedure:
 1.call md1.getParents()
 expected result: empty array
 2.call md1.addChild(md3)
 call md2.addChild(md3)
 call md3.getParents()
 expected result: 2 element array containing md1 and md2
 



testEMB158
public void testEMB158() throws IOException, CreateException, MediaException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: getPreviousVersion()
 Testcase Number: EMB158
 setup: create meta data entities md1 and md2
 test procedure:
 1.call md2.setPreviousVersion(md1)
 call md2.getPreviousVersion()
 expected result: md1
 2.call md1.getPreviousVersion()
 expected result: null
 



testEMB159
public void testEMB159() throws IOException, FileNotFoundException, SAXException, ParserConfigurationException, CreateException, MediaException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: getXML()
 Testcase Number: EMB159
 setup: create meta data entity md1
 test procedure:
 1.call md1.getXML
 expected result: no exception and not null
 verify resulting String matches XML content
 2.create meta data entity w/o setting XML content
 expected result: ContentAccessException
 



testEMB160
public void testEMB160() throws IOException, MediaException, CreateException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: removeChild(MetaDataEntityLocal)
 Testcase Number: EMB160
 setup: create meta data entities md1, md2, and md3
 test procedure:
 1.call md1.removeChild(null)
 expected result: NullPointerException
 2.call md1.addChild(md3), call getChildren and verify one element
 call md2.addChild(md3), call getChildren and verify one element
 call md1.removeChild(md3)
 expected result: no exception
 call md1.getChildren and verify empty array
 call md2.getChildren and verify one element
 3.call md1.removeChild(md3)
 expected result: no exception
 



testEMB161
public void testEMB161() throws IOException, MediaException, CreateException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: removeMediaEntity(MediaEntityLocal)
 Testcase Number: EMB161
 setup: create meta data entity md1 and Media entity me1
 test procedure:
 1.call md1.removeMediaEntity(null)
 expected result: NullPointerException
 2.call md1.addMediaEntity(me1)
 call md1.getMediaEntities and verify one element
 call md1.removeMediaEntity(me1)
 expected result: no exception, call md1.getMediaEntity to verify empty array
 3.call md1.	removeMediaEntity(me1)
 expected result: no exception
 



testEMB162
public void testEMB162() throws IOException, MediaException, CreateException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: setName(String)
 Testcase Number: EMB162
 setup: create meta data entity md1
 test procedure:
 1.call md1.setName(null)
 expected result: NullPointerException
 2.call md1.setName("")
 call md1.getName()
 expected result: empty string
 3.call md1.setName("test")
 call md1.getName()
 expected result: "test"
 



testEMB163
public void testEMB163() throws IOException, MediaException, CreateException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: setPreviousVersion(MetaDataEntityLocal)
 Testcase Number: EMB163
 setup: create meta data entities md1, md2, and md3
 test procedure:
 1.call md1.setPreviousVersion(null)
 call md1.getPreviousVersion() and md1.getNextVersion()
 expected result: both are null
 2.call md2.setPreviousVersion(md1)
 expected result: md1.getPreviousVersion() is null
 md1.getNextVersion() is md2
 md2.getPreviousVersion() is md1
 md2.getNextVersion() is null
 3.call md2.setPreviousVersion(md1)
 expected result: no exception
 4.call md3.setPreviousVersion(md1)
 expected result: VersionChainIntegrityException
 5.call md2.setPreviousVersion(md3)
 expected result: VersionChainIntegrityException
 6.call md1.setPreviousVersion(md3)
 expected result: VersionChainIntegrityException
 7.call md3.setPreviousVersion(null)
 expected result: no exception
 8.call md3.setPreviousVersion(md2)
 expected result: md1.getPreviousVersion() is null
 md1.getNextVersion() is md2
 md2.getPreviousVersion() is md1
 md2.getNextVersion() is md3
 md3.getPreviousVersion() is md2
 md3.getNextVersion() is null
 9.call md2.setPreviousVersion(null)
 expected result: VersionChainIntegrityException
 10.call md3.setPreviousVersion(null)
 expected result: md1.getPreviousVersion() is null
 md1.getNextVersion() is md2
 md2.getPreviousVersion() is md1
 md2.getNextVersion() is null
 md3.getPreviousVersion() is null
 md3.getNextVersion() is null
 11.call md3.setPreviousVersion(md3)
 expected result: VersionChainIntegrityException
 



testEMB164
public void testEMB164() throws FileNotFoundException, IOException, ParserConfigurationException, IOException, SAXException, CreateException, MediaException, RemoteException, NamingException, FinderException, RemoveException(Code)
 Testcase Name: setXML(String, boolean)
 Testcase Number: EMB164
 setup: create meta data entities md1
 create file containing valid XML schema
 test procedure:
 1.call md1.setXML(null, false)
 expected result: NullPointerException
 2.a.call md1.setXML(validXML, true) (reference to DTD)
 expected result: no exception, verify md1.getXML() matches XML content
 b.call md1.setXML(validXML, true) (reference to schema)
 expected result: no exception , verify md1.getXML() matches XML content
 3.a.create random String and call setXML(randomString, true)
 expected result: MetaDataSyntaxException
 b.call setXML(randomString, false)
 expected result: MetaDataSyntaxException
 4.a.create well formed XML content that does not match DTD
 call md1.setXML(xmlContent, true)
 expected result: MetaDataValidationException
 b.create well formed XML content that does follow schema
 call md1.setXML(xmlContent, true)
 expected result: MetaDataValidationException
 5.create XML file with only begin and end tags
 call md1.setXML
 expected result: no exception
 6.call md1.setXML("")
 expected result: no exception
 7.a.call setXML with XML that does not reference any DTD or schema and validate set to true
 expected result: MetaDataValidationException
 b.repeat test 7a with validate set to false
 expected result: no exception
 



xmlCompare
protected static boolean xmlCompare(Element expected, Element actual)(Code)
recursive function which compares two XML elements



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.