aiad.logAgeSummary(); aiad.createAccumuloShellScript(fileName);
/** * This method completes the setup process and was redundant in all but of the tests. * * @param bucketsToUse * - the array of buckets to use */ private void completeSetup(Integer[] bucketsToUse) { try { deleteFile(fileName); aiad = new AccumuloIndexAgeDisplay(mockInstance, tableName, columns, userName, password, bucketsToUse); aiad.extractDataFromAccumulo(); aiad.logAgeSummary(); aiad.createAccumuloShellScript(fileName); } catch (AccumuloException ae) { log.error("Accumlo exception from our mock instance."); log.error(ae.getMessage()); } catch (AccumuloSecurityException ase) { log.error("Accumulo security exception from our mock instance"); log.error(ase.getMessage()); } }
/** * A test using the assorted data, 2 - 31 days old, using one bucket of three days. So all day older than three days should have a delete statement. */ @Test public void assortedDataIntoThreeDayBucketLogOutputTest() { // Should identify data more than three days old in the log and deletion script loadAssortedData(); completeSetup(new Integer[] {3}); String expectedLogSummary = getAssortedDataThreeDaySimulatedLogOutput(); String actualLogSummary = aiad.logAgeSummary(); Assert.assertEquals(expectedLogSummary, actualLogSummary); }
/** * A test with data with a timestamp one hour ago. No data should be identified as being deleteable */ @Test public void oneHourOldDataIntoDefaultBucketLogOutputTest() { // All the data is "new" so none should be ready to be aged-off loadOneHourData(); completeSetup(new Integer[0]); String expectedLogSummary = getOneHourSimulatedLogOutput(); String actualLogSummary = aiad.logAgeSummary(); Assert.assertEquals(expectedLogSummary, actualLogSummary); }
/** * A test that has an assorted of rowws with different timestamps */ @Test public void assortedDataIntoDefaultBucketLogOutputTest() { // The data entered into accumulo: 2 - one day old, 2 two days old, two , 2 eight days old, 2 fifteen days old // and 2 thirty one days old. The last eight should be removed by the default buckets loadAssortedData(); completeSetup(new Integer[0]); String expectedLogSummary = getAssortedSimulatedLogOutput(); String actualLogSummary = aiad.logAgeSummary(); Assert.assertEquals(expectedLogSummary, actualLogSummary); }