Пример #1
0
  public void testMatchUserIdExpectsFalse() {

    LOG.trace("testMatchUserIdExpectsFalse");
    Banlist b = this.newBanlist(1, null, null);
    Assert.assertFalse(b.matches(this.newBanlist(2, null, null)));
  }
Пример #2
0
  public void testMatchIpExpectsFalse() {

    LOG.trace("testMatchIpExpectsFalse");
    Banlist b = this.newBanlist(0, null, "192.168.1.1");
    Assert.assertFalse(b.matches(this.newBanlist(0, null, "192.168.1.2")));
  }
Пример #3
0
  public void testMatchEmailExpectsFalse() {

    LOG.trace("testMatchEmailExpectsFalse");
    Banlist b = this.newBanlist(0, "email@1", null);
    Assert.assertFalse(b.matches(this.newBanlist(0, "email@2", null)));
  }
Пример #4
0
  public void testMatchIpExpectsTrue() {

    LOG.trace("testMatchIpExpectsTrue");
    Banlist b = this.newBanlist(0, "email@3", "192.168.1.1");
    Assert.assertTrue(b.matches(this.newBanlist(0, "email@2", "192.168.1.1")));
  }
Пример #5
0
  public void testMatchIpUsingDifferentLengthExpectsFalse() {

    LOG.trace("testMatchIpUsingDifferentLengthExpectsFalse");
    Banlist b = this.newBanlist(0, null, "192.168.7");
    Assert.assertFalse(b.matches(this.newBanlist(0, null, "192.168.1.2")));
  }
Пример #6
0
  public void testMatchIpUsingStarExpectsFalse2() {

    LOG.trace("testMatchIpUsingStarExpectsFalse2");
    Banlist b = this.newBanlist(0, null, "*.168.7.*");
    Assert.assertFalse(b.matches(this.newBanlist(0, null, "172.168.1.2")));
  }
Пример #7
0
  public void testMatchIpUsingStarExpectsTrue2() {

    LOG.trace("testMatchIpUsingStarExpectsTrue2");
    Banlist b = this.newBanlist(0, null, "172.*.7.2");
    Assert.assertTrue(b.matches(this.newBanlist(0, null, "172.55.7.2")));
  }
Пример #8
0
  public void testMatchIpUsingOnlyStarsExpectsFalse() {

    LOG.trace("testMatchIpUsingOnlyStarsExpectsFalse");
    Banlist b = this.newBanlist(0, null, "*.*.*.*");
    Assert.assertFalse(b.matches(this.newBanlist(0, null, "172.55.7.2")));
  }