@@ -0,0 +1,2932 @@
+/*%0A */%0Apackage org.datadryad.journalstatistics.extractor;%0A%0Aimport java.io.File;%0Aimport java.io.FileInputStream;%0Aimport java.util.Calendar;%0Aimport java.util.Date;%0Aimport java.util.GregorianCalendar;%0Aimport org.datadryad.api.DryadDataFile;%0Aimport org.datadryad.test.ContextUnitTest;%0Aimport org.junit.Test;%0Aimport static org.junit.Assert.*;%0Aimport org.junit.Before;%0A%0A/**%0A *%0A * @author Dan Leehr %3Cdan.leehr@nescent.org%3E%0A */%0Apublic class DataFileTotalSizeByDateTest extends ContextUnitTest %7B%0A    private File file;%0A    private Date date_2013_01_01, date_2013_06_01, date_2014_01_01, date_2013_03_01;%0A%0A    @Before%0A    public void setUp() %7B%0A        super.setUp();%0A        Calendar calendar = new GregorianCalendar();%0A        calendar.set(Calendar.YEAR, 2013);%0A        calendar.set(Calendar.MONTH, Calendar.JANUARY);%0A        calendar.set(Calendar.DAY_OF_MONTH, 1);%0A        date_2013_01_01 = calendar.getTime();%0A        calendar.set(Calendar.MONTH, Calendar.MARCH);%0A        date_2013_03_01 = calendar.getTime();%0A        calendar.set(Calendar.MONTH, Calendar.JUNE);%0A        date_2013_06_01 = calendar.getTime();%0A        calendar.set(Calendar.MONTH, Calendar.JANUARY);%0A        calendar.set(Calendar.DAY_OF_MONTH, 1);%0A        date_2014_01_01 = calendar.getTime();%0A%0A        try %7B%0A            file = new File(DataFileTotalSizeByDateTest.class.getClassLoader().getResource(%22DryadLogo.png%22).toURI());%0A        %7D catch (Exception ex) %7B%0A            fail(%22Exception setting up files for total size test %22 + ex);%0A        %7D%0A    %7D%0A    /**%0A     * Test of extract method, of class DataFileTotalSize.%0A     */%0A    @Test%0A    public void testCountDataFileTotalSizeByDate() throws Exception %7B%0A        System.out.println(%22countDataFileTotalSizeByDate%22);%0A        String journalName = %22Test Journal%22;%0A        DataFileTotalSize instance1 = new DataFileTotalSize(context);%0A        instance1.setBeginDate(date_2013_01_01);%0A        instance1.setEndDate(date_2013_06_01);%0A        DataFileTotalSize instance2 = new DataFileTotalSize(context);%0A        instance2.setBeginDate(date_2013_06_01);%0A        instance2.setEndDate(date_2014_01_01);%0A%0A        Long initialSize1 = instance1.extract(journalName);%0A        Long initialSize2 = instance2.extract(journalName);%0A        Long expectedSizeIncrease = file.length();%0A%0A        assertTrue(%22file has no size%22, expectedSizeIncrease %3E 0);%0A%0A        DryadDataFile dataFile = DryadDataFile.create(context);%0A        dataFile.setDateAccessioned(date_2013_03_01);%0A        dataFile.setPublicationName(journalName);%0A        dataFile.addBitstream(new FileInputStream(file));%0A%0A        Long totalSize1 = instance1.extract(journalName);%0A        Long sizeIncrease1 = totalSize1 - initialSize1;%0A        assertEquals(%22size increase mismatch%22,expectedSizeIncrease, sizeIncrease1);%0A%0A        Long totalSize2 = instance2.extract(journalName);%0A        assertEquals(%22Size should not increase for outside date range%22, initialSize2, totalSize2);%0A%0A    %7D%0A%7D%0A

Add failing test for DataFileTotalSizeByDate