ExtOutputFilenameGenerator extends OutputFilenameGenerator { @Override public final File getIntervalXmlFile(IAnalyzedInterval analyzedInterval, FramingFlowType framingFlowType) throws AdeException { return getIntervalXmlFile(analyzedInterval, EXT_INTERVAL_XML_FILE_NAME_FORMAT, framingFlowType); }  static void setIntervalLength(long intervalLength); static String getDayFormat(); static DateTimeZone getInputTimeZone(); static DateTimeZone getOutputTimeZone(); static int getIntervalSerialNumber(long intervalEndTime, FramingFlowType framingFlowType); @Override final File getIntervalXmlFile(IAnalyzedInterval analyzedInterval, FramingFlowType framingFlowType); final File getIntervalXmlV2FFile(IAnalyzedInterval analyzedInterval, FramingFlowType framingFlowType); final File getIntervalXmlV2FFileInZIP(IAnalyzedInterval analyzedInterval, FramingFlowType framingFlowType); final File getIntervalXmlV2File(IAnalyzedInterval analyzedInterval, FramingFlowType framingFlowType); final File getIntervalXmlV1File(IAnalyzedInterval analyzedInterval, FramingFlowType framingFlowType); @Override final File getIntervalXmlStorageDir(IAnalyzedInterval analyzedInterval); @Override final File getIntervalXmlFile(String sourceId, Date intervalStart, 
            File customAnalysisOutputPath, FramingFlowType framingFlowType); final String getIntervalXmlFileRelativeToIndex2(Date intervalStart, 
            FramingFlowType framingFlowType); @Override final String getIntervalXmlFileRelativeToIndex(IAnalyzedInterval ai, FramingFlowType framingFlowType); final String getIntervalXmlFileRelativeToIndex(int serialNumber); final File getIntervalXmlStorageDir(String sourceId, Date dateInInterval, File customAnalysisOutputPath); @Override final File getPeriodDir(ISource source, Date periodStartDate); long getIntervalLength(); static final String EXT_INTERVAL_XML_EXTENSION; static final String EXT_INTERVAL_ZIP_EXTENSION; static final String EXT_INTERVAL_XML_FILE_NAME_BASE_FORMAT; static final String EXT_INTERVAL_XML_V2_FILE_NAME_FORMAT; static final String EXT_INTERVAL_XML_V2F_FILE_NAME_FORMAT; static final String EXT_INTERVAL_XML_V2F_FILE_NAME_FORMAT_IN_ZIP; static final String EXT_INTERVAL_XML_V1_FILE_NAME_FORMAT; }
@Test public void testGetIntervalXmlFile() throws AdeInternalException, AdeException { Date date = new Date(0L); File file = new File("file"); File expectedPath = new File("file/intervalPath/19700101/intervals"); assertEquals("Testing if the correct path is made. Should return x/y/19700101/intervals" ,expectedPath,eofg.getIntervalXmlStorageDir("intervalPath",date,file)); }
@Test public void testgetIntervalXmlFile() throws AdeException { File file = new File("file"); Date date = new Date(1L); ade = mock(Ade.class, RETURNS_DEEP_STUBS); when(ade.getConfigProperties().database().getDatabaseDriver()).thenReturn("derby"); when(ade.getConfigProperties().getOverrideVersionCheck()).thenReturn(true); when(ade.getDbVersion()).thenReturn(new Version(1, 0)); when(ade.getConfigProperties().getPeriodMode()).thenReturn(PeriodMode.DAILY); when(ade.getDirectoryManager().getAnalysisHome()).thenReturn(file); Ade.create(ade); FramingFlowType framingFlowType = mock(FramingFlowType.class); when(framingFlowType.getDuration()).thenReturn(2L); when(framingFlowType.getPropertyByKey(ContinuousTimeFramer.PERM_SPLIT_FACTOR)).thenReturn("1"); File expectedFile = new File("file/nba?/19700101/intervals/intervals/interval_1.xml"); assertEquals("Testing xml file path, should be x/y/19700101/intervals/intervalls/interval_1.xml " ,expectedFile,eofg.getIntervalXmlFile("nba?", date, file, framingFlowType)); }