package com.ibm.emb.test;

import java.io.File;
import java.io.IOException;

import javax.emb.MediaException;

import com.ibm.emb.junit.EMBTestCaseBase;
import com.ibm.emb.junit.EMBTestRunner;
import com.ibm.sigtest.ProjectDesc;

public class SignatureTest extends EMBTestCaseBase {

    /**
     * Constructor for SignatureTest
     * @param name
     */
    public SignatureTest(String name) throws MediaException {
        super(name);
    }

    public static void main(String args[]) {
        EMBTestRunner.run(SignatureTest.class);
    }

    /**
     * <pre>
     * 
     *  
     *   
     *        TestCase Name: Signature Test
     *        TestCase Number: EMB044
     *        
     *        setup: generate project file with method signatures
     *        
     *        test procedure:
     *        1.call compareProjectFile 
     *        expected result: result is null
     *        
     *   
     *  
     * </pre>
     */
    public void testEMB044() throws IOException, ClassNotFoundException {
        // generate list of class signatures for project
        String classNamesFilePath = embTestConfig.getMediaDir() + File.separatorChar + embTestConfig.getListOfClassNamesFile();
        String sigFilePath = embTestConfig.getMediaDir() + File.separatorChar + embTestConfig.getClassSignatureFile();
        // should not regenerate signature file unless needed
        // SigTestUtils.generateProjectFile(classNamesFilePath, sigFilePath,
        // true);

        File projFile = new File(sigFilePath);
        String result = ProjectDesc.compareProjectFile(projFile);

        assertNull(result, result);
        testTrace("test 1 passed");
        succeed();

    }

}
