Search in sources :

Example 1 with EnterpriseFeederService

use of org.kuali.kfs.module.ld.batch.service.EnterpriseFeederService in project cu-kfs by CU-CommunityApps.

the class CuFileEnterpriseFeederServiceImplTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    enterpriseFeederService = SpringContext.getBean(EnterpriseFeederService.class);
    kualiConfigurationService = SpringContext.getBean(ConfigurationService.class);
    ReportWriterTextServiceImpl laborEnterpriseFeedReportWriterService = SpringContext.getBean(ReportWriterTextServiceImpl.class, "laborEnterpriseFeedReportWriterService");
    laborEnterpriseFeedReportWriterService.setAggregationModeOn(true);
    laborEnterpriseFeedReportWriterService.initialize();
    ReportWriterTextServiceImpl laborEnterpriseFeedErrorStatisticsWriterService = SpringContext.getBean(ReportWriterTextServiceImpl.class, "laborEnterpriseFeedErrorStatisticsWriterService");
    laborEnterpriseFeedErrorStatisticsWriterService.setAggregationModeOn(true);
    laborEnterpriseFeedErrorStatisticsWriterService.initialize();
    // make sure we have a batch directory
    String batchDirectory = enterpriseFeederService.getDirectoryName();
    File batchDirectoryFile = new File(batchDirectory);
    batchDirectoryFile.mkdir();
    // make sure we have a batch directory for labor origin entry
    String laborOriginEntryDirectory = enterpriseFeederService.getDirectoryName().replace("enterpriseFeed", "originEntry");
    File laborOriginEntrFile = new File(laborOriginEntryDirectory);
    laborOriginEntrFile.mkdir();
    // copy the data file into place
    File dataFileSrc = new File(DATA_FILE_PATH);
    dataFileDest = new File(batchDirectory + "/SMGROS.data");
    FileUtils.copyFile(dataFileSrc, dataFileDest);
    // copy the recon file into place
    File rerconileSrc = new File(RECON_FILE_PATH);
    reconFileDest = new File(batchDirectory + "/SMGROS.recon");
    FileUtils.copyFile(rerconileSrc, reconFileDest);
    // create .done file
    String doneFileName = batchDirectory + "/SMGROS.done";
    doneFile = new File(doneFileName);
    if (!doneFile.exists()) {
        LOG.info("Creating done file: " + doneFile.getAbsolutePath());
        doneFile.createNewFile();
    }
}
Also used : ReportWriterTextServiceImpl(org.kuali.kfs.sys.service.impl.ReportWriterTextServiceImpl) EnterpriseFeederService(org.kuali.kfs.module.ld.batch.service.EnterpriseFeederService) ConfigurationService(org.kuali.rice.core.api.config.property.ConfigurationService) File(java.io.File)

Aggregations

File (java.io.File)1 EnterpriseFeederService (org.kuali.kfs.module.ld.batch.service.EnterpriseFeederService)1 ReportWriterTextServiceImpl (org.kuali.kfs.sys.service.impl.ReportWriterTextServiceImpl)1 ConfigurationService (org.kuali.rice.core.api.config.property.ConfigurationService)1