| 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
|
MetaDataEntityLocalTest | public MetaDataEntityLocalTest(String name) throws MediaException(Code) | | Constructor for MetaDataEntityLocalTest.
Parameters: name - |
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
|
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
|
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
|
|
|