/**
* This method performs all actions mentioned in class description.
*/
public void run() throws Exception {
MarshalInputStream stream;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.flush();
ByteArrayInputStream bais =
new ByteArrayInputStream(baos.toByteArray());
ArrayList al = new ArrayList();
PipedInputStream pis = new PipedInputStream();
logger.log(Level.FINE,"=================================");
logger.log(Level.FINE,"test case 1: "
+ "MarshalInputStream(null,*,*,*,null)");
logger.log(Level.FINE,"");
try {
stream = new MarshalInputStream(null,null,false,null,null);
assertion(false);
} catch (NullPointerException ignore) {
}
logger.log(Level.FINE,"=================================");
logger.log(Level.FINE,"test case 2: "
+ "MarshalInputStream(InputStream,*,*,*,null)");
logger.log(Level.FINE,"");
try {
stream = new MarshalInputStream(bais,null,false,null,null);
assertion(false);
} catch (NullPointerException ignore) {
}
logger.log(Level.FINE,"=================================");
logger.log(Level.FINE,"test case 3: "
+ "MarshalInputStream(null,*,*,*,Collection)");
logger.log(Level.FINE,"");
try {
stream = new MarshalInputStream(null,null,false,null,al);
assertion(false);
} catch (NullPointerException ignore) {
}
logger.log(Level.FINE,"=================================");
logger.log(Level.FINE,"test case 4: "
+ "getObjectStreamContext method returns constructor arg");
logger.log(Level.FINE,"");
bais.reset();
stream = new MarshalInputStream(bais,null,false,null,al);
assertion(stream.getObjectStreamContext() == al);
logger.log(Level.FINE,"=================================");
logger.log(Level.FINE,"test case 5: "
+ "constructor throws IOException");
logger.log(Level.FINE,"");
try {
stream = new MarshalInputStream(pis,null,false,null,al);
assertion(false);
} catch (IOException ignore) {
}
logger.log(Level.FINE,"=================================");