package jp.agentec.adf.security.cryptography;

import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;

import jp.agentec.adf.security.cryptography.MD5;

import org.junit.Test;

public class MD5Test {

	@Test
	public void testGetMd5Hash() {
		String str = "ABook";
		try {
			String md5 = MD5.getMd5Hash(str).toUpperCase();
			System.out.println(md5);
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
		
		assertTrue(true);
	}
	
    @Test
    public void testGetMd5HashFile() {
        File f = new File("test/jp/agentec/adf/test/security/cryptography/MD5Test.java");
        try {
            String md5 = MD5.getMD5Hash(f).toUpperCase();
            System.out.println(md5);
        } catch (IOException e) {
            e.printStackTrace();
        }
        
        assertTrue(true);
    }


}
