Code example for DigestInputStream

Methods: getMessageDigest, setMessageDigest

0
	 * @tests java.security.DigestInputStream#setMessageDigest(java.security.MessageDigest) 
	 */ 
	public void test_setMessageDigestLjava_security_MessageDigest() { 
		// Test for method void 
		// java.security.DigestInputStream.setMessageDigest(java.security.MessageDigest) 
		DigestInputStream dis = new DigestInputStream(inStream, null);
		 
		// make sure the digest is null when it's not been set 
		assertNull(
				"Uninitialised MessageDigest should have been returned as null", 
				dis.getMessageDigest());
		dis.setMessageDigest(digest);
		assertEquals("Wrong MessageDigest was returned.", digest, dis
				.getMessageDigest());
	} 
 
	/** 
	 * Sets up the fixture, for example, open a network connection. This method 
	 * is called before a test is executed. 
	 * @throws UnsupportedEncodingException  
	 */