package gov.va.med.esr.common.batchprocess;

import gov.va.med.esr.common.util.AbstractCommonTestCase;
import gov.va.med.fw.scheduling.ScheduledProcess;

/**
 * 
 * @author Rajiv Patnaik
 * Created on Apr 13, 2006
 * @version 1.0
 * 
 * Copyright © 2006 VHA. All rights reserved
 */
public class TestLoadRegistryProcess extends AbstractCommonTestCase
{
	public TestLoadRegistryProcess()
	{
		setDefaultRollback(false);
	}
    public  void testProcessPOWRegistryFile() throws Exception
    {
        invokeProcess("common.batchprocess.processPOWRegistryFile");
    }
//    public  void testProcessPurpleHeartRegistryFile() throws Exception
//    {
//        invokeProcess("common.batchprocess.processPurpleHeartRegistryFile");
//    }
//    public  void testProcessSHADRegistryFile() throws Exception
//    {
//        invokeProcess("common.batchprocess.processSHADRegistryFile");
//    } 

    public void testCCR10099()
    {
    	LoadRegistryProcessStatistics stats = new LoadRegistryProcessStatistics();
    	stats.incrementNewRegistryEntriesInserted();
    	stats.incrementNumberOfErrorRecords(2);
    	stats.incrementNumberOfSuccessfulRecords(3);
    	stats.incrementNumberOfTotalRecords(4);
    	stats.incrementRecordsAmbigouslyMatched();
    	stats.incrementRecordsFailedConsistencyCheck();
    	
    	String str = stats.toString();
    	
    	int len = str.length();
    	
    	
    }
    private void invokeProcess(String processName) throws Exception
    {
        ScheduledProcess process = (ScheduledProcess)applicationContext.getBean(processName);
        process.invoke(AbstractScheduledProcessTest.createTestContext(processName, null));        
        
    } 
}
