| com.ibm.emb.test.MediaTest com.ibm.emb.test.MediaBeanTest
MediaBeanTest | public class MediaBeanTest extends MediaTest (Code) | |
Line Item: MFB API
Subcategory 1: javax.emb
Subcategory 2: MediaBean
This is the test class for javax.emb.MediaBean. Many of the tests
are implemented in the super class MediaTest and only a few initialization
methods are provided here.
|
Method Summary | |
public Media | createMedia(File inputFile, String mimeType) | public Media | createMedia(InputStream in, String mimeType, String name) | public static void | main(String args) | public void | testEMB011()
Testcase Name: MediaBean(File mediaFile, String mimeType)
Testcase Number: EMB011
setup: media has to be provided in local file system
test procedure:
I.
a) java.io.file pointing to media file is provided in the constructor call.
->1.instance is created
->2.mimetype is queried and verified
->3.media file content size is checked by comparing byte array size and file size.
->4.Media.getName is not null and name contains exactly 1 dot.
b) provide null as mime-type -> same as getFormat().getDefaultMimeType()
c) provide "test" as mime-type -> "test"
II. | public void | testEMB012()
Testcase Name: MediaBean(InputStream contentStream, String mimeType, String name)
Testcase Number: EMB012
setup: input stream has to be provided by using a file input stream
test procedure:
I.
a)mimetype is null
->1.mimetype = getFormat().getDefaultMimeType()
->2.stream content size is checked by comparing byte array size of Media.getContent() and stream size
b)mimetype is "test" (parameter "name" has to be != null) -> mimetype = "test"
II. |
MediaBeanTest | public MediaBeanTest(String name) throws MediaException(Code) | | |
createMedia | public Media createMedia(File inputFile, String mimeType) throws MediaException(Code) | | creates an instance of MediaBean with the given parameters used in super
class of MediaTest
|
createMedia | public Media createMedia(InputStream in, String mimeType, String name) throws MediaException(Code) | | creates an instance of MediaBean with the given parameters used in super
class of MediaTest
|
testEMB011 | public void testEMB011() throws IOException, MediaException(Code) | |
Testcase Name: MediaBean(File mediaFile, String mimeType)
Testcase Number: EMB011
setup: media has to be provided in local file system
test procedure:
I.
a) java.io.file pointing to media file is provided in the constructor call.
->1.instance is created
->2.mimetype is queried and verified
->3.media file content size is checked by comparing byte array size and file size.
->4.Media.getName is not null and name contains exactly 1 dot.
b) provide null as mime-type -> same as getFormat().getDefaultMimeType()
c) provide "test" as mime-type -> "test"
II. call MediaBean(null, null) -> NullPointerException
III. call MediaBean with nonexistent file and null mimetype -> ContentAccessException
|
testEMB012 | public void testEMB012() throws IOException, MediaException(Code) | |
Testcase Name: MediaBean(InputStream contentStream, String mimeType, String name)
Testcase Number: EMB012
setup: input stream has to be provided by using a file input stream
test procedure:
I.
a)mimetype is null
->1.mimetype = getFormat().getDefaultMimeType()
->2.stream content size is checked by comparing byte array size of Media.getContent() and stream size
b)mimetype is "test" (parameter "name" has to be != null) -> mimetype = "test"
II. contentStream is null -> NullPointerException
III. name is null -> NullPointerException
IV. create MediaBean using input stream from corrupt GZIP file (can open but not read)
-> ContentAccessException
|
Methods inherited from com.ibm.emb.test.MediaTest | abstract public Media createMedia(File inputFile, String mimeType) throws MediaException(Code)(Java Doc) abstract public Media createMedia(InputStream in, String mimeType, String name) throws MediaException(Code)(Java Doc) public static Test stdSuite(String TestCaseImplementor)(Code)(Java Doc) public void testEMB001()(Code)(Java Doc) public void testEMB002() throws IOException, MediaException(Code)(Java Doc) public void testEMB003() throws IOException, MediaException(Code)(Java Doc) public void testEMB004() throws IOException, MediaException(Code)(Java Doc) public void testEMB005() throws IOException, MediaException(Code)(Java Doc) public void testEMB006() throws IOException, MediaException(Code)(Java Doc) public void testEMB007() throws MediaException, IOException(Code)(Java Doc) public void testEMB008() throws IOException, MediaException, Exception(Code)(Java Doc) public void testEMB009() throws IOException, MediaException, Exception(Code)(Java Doc) public void testEMB010() throws IOException, MediaException, Exception(Code)(Java Doc)
|
|
|