@@ -0,0 +1,2132 @@
+package org.recap.camel.datadump;%0A%0Aimport org.apache.camel.ProducerTemplate;%0Aimport org.junit.Test;%0Aimport org.recap.BaseTestCase;%0Aimport org.recap.ReCAPConstants;%0Aimport org.recap.model.jaxb.marc.BibRecords;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.beans.factory.annotation.Value;%0A%0Aimport java.io.File;%0Aimport java.text.SimpleDateFormat;%0Aimport java.util.Date;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport static org.junit.Assert.assertTrue;%0A%0A/**%0A * Created by premkb on 31/10/16.%0A */%0Apublic class ActiveMQRouteBuilderUT extends BaseTestCase%7B%0A%0A    @Autowired%0A    ProducerTemplate producer;%0A%0A    @Value(%22$%7Betl.dump.directory%7D%22)%0A    private String dumpDirectoryPath;%0A%0A    @Test%0A    public void createFile() throws Exception %7B%0A        Map%3CString, String%3E routeMap = new HashMap%3C%3E();%0A        String requestingInstituionCode = %22NYPL%22;%0A        routeMap.put(ReCAPConstants.FILENAME, ReCAPConstants.DATA_DUMP_FILE_NAME + requestingInstituionCode);%0A        routeMap.put(ReCAPConstants.REQUESTING_INST_CODE, requestingInstituionCode);%0A        String dummyXml = %22%3C?xml version=%5C%221.0%5C%22 encoding=%5C%22UTF-8%5C%22?%3E%3Ccollection xmlns:marcxml=%5C%22http://www.loc.gov/MARC21/slim%5C%22%3E%3C/collection%3E%22;%0A        String dateTimeString = getDateTimeString();%0A        routeMap.put(ReCAPConstants.DATETIME_FOLDER, dateTimeString);%0A        routeMap.put(%22fileFormat%22,ReCAPConstants.XML_FILE_FORMAT);%0A        producer.sendBodyAndHeader(ReCAPConstants.DATADUMP_FILE_SYSTEM_Q, dummyXml, %22routeMap%22, routeMap);%0A        String filename = dumpDirectoryPath + File.separator + requestingInstituionCode+ File.separator +dateTimeString+ File.separator +ReCAPConstants.DATA_DUMP_FILE_NAME+requestingInstituionCode+%22-%22+dateTimeString+ ReCAPConstants.XML_FILE_FORMAT;%0A        File file = new File(filename);%0A        boolean fileExists = file.exists();%0A        assertTrue(fileExists);%0A        file.delete();%0A    %7D%0A    private String getDateTimeString()%7B%0A        Date date = new Date();%0A        SimpleDateFormat sdf = new SimpleDateFormat(ReCAPConstants.DATE_FORMAT_DDMMMYYYYHHMM);%0A        return sdf.format(date);%0A%0A    %7D%0A%7D%0A

Test for activemq