use of org.kuali.kfs.module.ld.batch.service.FileEnterpriseFeederHelperService in project cu-kfs by CU-CommunityApps.
the class CuFileEnterpriseFeederHelperServiceImplTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
fileEnterpriseFeederHelperService = SpringContext.getBean(FileEnterpriseFeederHelperService.class);
// make sure we have a batch directory
String batchDirectory = SpringContext.getBean(EnterpriseFeederService.class).getDirectoryName();
File batchDirectoryFile = new File(batchDirectory);
batchDirectoryFile.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();
}
statusAndErrors = new EnterpriseFeederStatusAndErrorMessagesWrapper();
statusAndErrors.setErrorMessages(new ArrayList<Message>());
statusAndErrors.setFileNames(dataFileDest, reconFileDest, doneFile);
File enterpriseFeedFile = null;
String enterpriseFeedFileName = LaborConstants.BatchFileSystem.LABOR_ENTERPRISE_FEED + LaborConstants.BatchFileSystem.EXTENSION;
enterpriseFeedFile = new File(batchDirectory + File.separator + enterpriseFeedFileName);
enterpriseFeedPs = null;
try {
enterpriseFeedPs = new PrintStream(enterpriseFeedFile);
} catch (FileNotFoundException e) {
LOG.error("enterpriseFeedFile doesn't exist " + enterpriseFeedFileName);
throw new RuntimeException("enterpriseFeedFile doesn't exist " + enterpriseFeedFileName);
}
ledgerSummaryReport = new LedgerSummaryReport();
feederReportData = new EnterpriseFeederReportData();
errorStatisticsReport = new ReportWriterTextServiceImpl();
}
Aggregations