public class DigestInputStreamTest
extends TestCase
DigestInputStream
Constructor and Description |
---|
DigestInputStreamTest() |
Modifier and Type | Method and Description |
---|---|
void |
testDigestInputStream01()
Test #1 for
DigestInputStream constructorAssertion: creates new DigestInputStream instance
using valid parameters (both non null ) |
void |
testDigestInputStream02()
Test #2 for
DigestInputStream constructorAssertion: creates new DigestInputStream instance
using valid parameters (both null ) |
void |
testGetMessageDigest()
Test for
getMessageDigest() methodAssertion: returns associated message digest |
void |
testOn()
Test for
on() methodAssertion: turns digest functionality on or off |
void |
testRead01()
Test #1 for
read() methodAssertion: returns the byte read Assertion: updates associated digest |
void |
testRead02()
Test #2 for
read() methodAssertion: returns -1 if EOS had been reached but not read before method call Assertion: must not update digest if EOS had been reached but not read before method call |
void |
testRead03()
Test #3 for
read() methodTest #1 for on(boolean) methodAssertion: read() must not update digest if it is offAssertion: on(boolean) turns digest functionality on
(if true passed as a parameter) or off (if false
passed) |
void |
testRead04()
Test #4 for
read() methodAssertion: broken DigestInputStream instance:
InputStream not set. |
void |
testRead05()
Test #5 for
read() methodAssertion: broken DigestInputStream instance:
associated MessageDigest not set. |
void |
testRead06()
Test #6 for
read() methodTest #2 for on(boolean) methodAssertion: broken DigestInputStream instance:
associated MessageDigest not set. |
void |
testReadbyteArrayintint01()
Test #1 for
read(byte[],int,int) methodAssertion: returns the number of bytes read Assertion: put bytes read into specified array at specified offset Assertion: updates associated digest |
void |
testReadbyteArrayintint02()
Test #2 for
read(byte[],int,int) methodAssertion: returns the number of bytes read Assertion: put bytes read into specified array at specified offset Assertion: updates associated digest |
void |
testReadbyteArrayintint03()
Test #3 for
read(byte[],int,int) methodAssertion: returns the number of bytes read Assertion: put bytes read into specified array at specified offset Assertion: updates associated digest |
void |
testReadbyteArrayintint04()
Test #4 for
read(byte[],int,int) methodAssertion: returns the number of bytes read Assertion: updates associated digest |
void |
testReadbyteArrayintint05()
Test #5 for
read(byte[],int,int) methodAssertion: returns the number of bytes read Assertion: put bytes read into specified array at specified offset Assertion: does not update associated digest if digest functionality is off |
void |
testSetMessageDigest()
Test for
setMessageDigest() methodAssertion: set associated message digest |
void |
testToString()
Test for
toString() methodAssertion: returns String representation of this object |
public final void testDigestInputStream01()
DigestInputStream
constructorDigestInputStream
instance
using valid parameters (both non null
)NoSuchAlgorithmException
public final void testDigestInputStream02()
DigestInputStream
constructorDigestInputStream
instance
using valid parameters (both null
)public final void testRead01() throws IOException
read()
methodIOException
public final void testRead02() throws IOException
read()
methodIOException
public final void testRead03() throws IOException
read()
methodon(boolean)
methodread()
must not update digest if it is offon(boolean)
turns digest functionality on
(if true
passed as a parameter) or off (if false
passed)IOException
public final void testRead04() throws IOException
read()
methodDigestInputStream
instance:
InputStream
not set. read()
must
not workIOException
public final void testRead05()
read()
methodDigestInputStream
instance:
associated MessageDigest
not set.
read()
must not work when digest
functionality is onpublic final void testRead06() throws IOException
read()
methodon(boolean)
methodDigestInputStream
instance:
associated MessageDigest
not set.
read()
must work when digest
functionality is offIOException
public final void testReadbyteArrayintint01() throws IOException
read(byte[],int,int)
methodIOException
public final void testReadbyteArrayintint02() throws IOException
read(byte[],int,int)
methodIOException
public final void testReadbyteArrayintint03() throws IOException
read(byte[],int,int)
methodIOException
public final void testReadbyteArrayintint04() throws IOException
read(byte[],int,int)
methodIOException
public final void testReadbyteArrayintint05() throws IOException
read(byte[],int,int)
methodIOException
public final void testGetMessageDigest()
getMessageDigest()
methodpublic final void testSetMessageDigest()
setMessageDigest()
methodpublic final void testOn() throws IOException
on()
methodIOException
public final void testToString()
toString()
methodString
representation of this object