Ejemplo n.º 1
0
 @Test
 public void shouldNotMatchPoolOperationWhenPoolStatusDoesNotMatch() {
   givenFilterWith(null, null, "RESTART", false, false, false, null, null, null, null);
   givenPoolOperationWith(
       System.currentTimeMillis(), System.currentTimeMillis(), "DOWN", "WAITING");
   assertFalse(filter.matches("resilient_pool-0", poolOperation));
 }
Ejemplo n.º 2
0
 @Test
 public void shouldMatchPoolOperationWhenPoolStateMatches() {
   givenFilterWith(null, "WAITING,RUNNING", null, false, false, false, null, null, null, null);
   givenPoolOperationWith(
       System.currentTimeMillis(), System.currentTimeMillis(), "DOWN", "WAITING");
   assertTrue(filter.matches("resilient_pool-0", poolOperation));
 }
Ejemplo n.º 3
0
 @Test
 public void shouldMatchPoolOperationWhenAfterUpdateMatches() {
   givenFilterWith(
       null, null, null, false, false, false, System.currentTimeMillis(), null, null, null);
   givenPoolOperationWith(
       System.currentTimeMillis(),
       System.currentTimeMillis() - TimeUnit.HOURS.toMillis(1),
       "DOWN",
       "WAITING");
   assertTrue(filter.matches("resilient_pool-0", poolOperation));
 }
Ejemplo n.º 4
0
 @Test
 public void shouldNotMatchPoolOperationWhenBeforeUpdateDoesNotMatch() {
   givenFilterWith(
       null,
       null,
       "RESTART",
       false,
       false,
       false,
       System.currentTimeMillis() - TimeUnit.HOURS.toMillis(2),
       null,
       null,
       null);
   givenPoolOperationWith(
       System.currentTimeMillis(),
       System.currentTimeMillis() - TimeUnit.HOURS.toMillis(1),
       "DOWN",
       "WAITING");
   assertFalse(filter.matches("resilient_pool-0", poolOperation));
 }
Ejemplo n.º 5
0
 @Test
 public void shouldMatchFileOperationWhenSourceMatchesSourcePool() throws CacheException {
   givenFilterWith("resilient_pool-0", null, null, false, true, false, null, null, null, null);
   givenFileOperationWith(null, "resilient_pool-0", null);
   assertTrue(filter.matches(fileOperation, poolInfoMap));
 }
Ejemplo n.º 6
0
 @Test
 public void shouldNotMatchFileOperationWhenTargetDoesNotMatchTargetPool() throws CacheException {
   givenFilterWith("resilient_pool-0", null, null, false, false, true, null, null, null, null);
   givenFileOperationWith(null, null, null);
   assertFalse(filter.matches(fileOperation, poolInfoMap));
 }