helper.shutdown(null);
}
public void testHostToSites() throws Exception
{
MockVoltDB helper = new MockVoltDB();
Long site0 = CoreUtils.getHSIdFromHostAndSite( 0, 0);
Long site1 = CoreUtils.getHSIdFromHostAndSite( 0, 1);
Long site2 = CoreUtils.getHSIdFromHostAndSite( 0, 2);
Long site3 = CoreUtils.getHSIdFromHostAndSite( 0, 3);
Long site100 = CoreUtils.getHSIdFromHostAndSite( 1, 100);
Long site101 = CoreUtils.getHSIdFromHostAndSite( 1, 101);
Long site102 = CoreUtils.getHSIdFromHostAndSite( 1, 102);
Long site103 = CoreUtils.getHSIdFromHostAndSite( 1, 103);
helper.addSite(site0, MailboxType.Initiator);
helper.addSite(site1, 0);
helper.addSite(site2, 1);
helper.addSite(site3, 1);
helper.addSite(site100, MailboxType.Initiator);
helper.addSite(site101, 0);
helper.addSite(site102, 1);
helper.addSite(site103, 1);
SiteTracker tracker = helper.getSiteTrackerForSnapshot();
List<Long> host0 = tracker.getSitesForHost(0);
assertFalse(host0.contains(site0));
assertTrue(host0.contains(site1));
assertTrue(host0.contains(site2));
assertTrue(host0.contains(site3));
assertFalse(host0.contains(site101));
List<Long> host1 = tracker.getSitesForHost(1);
assertFalse(host1.contains(site0));
assertFalse(host1.contains(site1));
assertTrue(host1.contains(site101));
assertTrue(host1.contains(site102));
assertTrue(host1.contains(site103));
helper.shutdown(null);
}