Beispiel #1
0
 @Test
 public void clearingLowPrioDoesntAffectHighPrioMappings() {
   mc.setHighPrio(true);
   mc.put("k", "v");
   mc.clearLowPrio();
   assertEquals(mc.get("k"), "v");
 }
Beispiel #2
0
 @Test
 public void clearingLowPrioDeletesLowPrioMappings() {
   mc.setHighPrio(false);
   mc.put("k", "v");
   mc.clearLowPrio();
   assertEquals(mc.get("k"), null);
 }
Beispiel #3
0
 @Test
 public void removeLowPrioMapping() {
   mc.setHighPrio(false);
   mc.put("k", "v");
   mc.removeLowPrio("k");
   assertEquals(mc.get("k"), null);
 }
Beispiel #4
0
 @Test
 public void gettingNotExistingMapping() {
   mc.setHighPrio(false);
   mc.put("k", "vlow");
   mc.setHighPrio(true);
   mc.put("k", "vhigh");
   assertEquals(mc.get("k"), "vhigh");
 }
Beispiel #5
0
  @Test
  public void enable() {
    mc.setHighPrio(true);
    mc.put("khigh", "vhigh");
    mc.setHighPrio(false);
    mc.put("klow", "vlow");
    mc.disable("khigh");
    mc.disable("klow");

    mc.enable("khigh");
    mc.enable("klow");

    assertEquals(mc.get("khigh"), "vhigh");
    assertEquals(mc.get("klow"), "vlow");
  }
Beispiel #6
0
 @Test
 public void gettingOverwrittenMapping() {
   assertEquals(mc.get("k"), null);
 }
Beispiel #7
0
 @Test
 public void gettingLowPrioMapping() {
   mc.setHighPrio(false);
   mc.put("k", "v");
   assertEquals(mc.get("k"), "v");
 }