public AccumuloIndexAgeDisplay(Instance instance, String tableName, String columns, String userName, PasswordToken password, Integer[] buckets) throws AccumuloException, AccumuloSecurityException { this.tableName = tableName; setColumns(columns); this.userName = userName; setBuckets(buckets); conn = instance.getConnector(userName, password); }
/** * A test verifying the buckets are sorted in reverse order. */ @Test public void sortBucketsInReverseOrderTest() { Assert.assertNotNull(mockInstance); try { aiad = new AccumuloIndexAgeDisplay(mockInstance, tableName, columns, userName, password, new Integer[0]); aiad.setBuckets(null); Integer[] expected = {180, 90, 60, 30, 14, 7, 2}; Integer[] actual = aiad.getBuckets(); Assert.assertArrayEquals(expected, actual); Integer[] useExpectedWithTooSmallNumber = {1, 2, 3, 4, 5}; expected = new Integer[] {5, 4, 3, 2}; aiad.setBuckets(useExpectedWithTooSmallNumber); actual = aiad.getBuckets(); Assert.assertArrayEquals(expected, actual); } 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()); } }