예제 #1
0
  public void testGetLocalName() {
    ResourceBundle rb = ResourceBundle.getBundle("bundles/java/util/logging/res");
    Level l = new MockLevel("level1", 120, "bundles/java/util/logging/res");
    assertEquals(rb.getString("level1"), l.getLocalizedName());

    // regression test for HARMONY-2415
    rb =
        ResourceBundle.getBundle(
            "org.apache.harmony.logging.tests.java.util.logging.LevelTestResource");
    l =
        new MockLevel(
            "Level_error",
            120,
            "org.apache.harmony.logging.tests.java.util.logging.LevelTestResource");
    assertEquals(rb.getString("Level_error"), l.getLocalizedName());

    l = new MockLevel("bad name", 120, "res");
    assertEquals("bad name", l.getLocalizedName());

    l = new MockLevel("level1", 11120, "bad name");
    assertEquals("level1", l.getLocalizedName());

    l = new MockLevel("level1", 1120);
    assertEquals("level1", l.getLocalizedName());
  }
예제 #2
0
  public void recordCondition(Plugin plugin, boolean shouldPrefix, String condition, Level level) {
    String content = ChatColor.AQUA + condition;
    String message = content;
    String prefix = ChatColor.GRAY + plugin.getName() + ChatColor.GRAY + "] ";

    if (shouldPrefix) {
      message = prefix + content;
    }

    if (level.intValue() <= this.broadcastLevel.intValue()) {
      Bukkit.broadcast(message, "pulse.observe");
    }

    System.out.println(
        "[Pulse] " + level.getLocalizedName() + "] " + plugin.getName() + "] " + condition);
  }