| 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
|
Method Summary | |
protected void | setUp() | public void | testEMB134() | public void | testEMB135() | public void | testEMB136() | public void | testEMB137() | public void | testEMB138() | public void | testEMB139() | public void | testEMB140() | public void | testEMB141()
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}. |
MediaEntityLocalHomeTest | public MediaEntityLocalHomeTest(String name) throws MediaException(Code) | | |
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
|
|
|