Ejemplo n.º 1
0
  @Test(priority = 1)
  public void initNull() throws InvalidConfigurationException, IOException {
    setConfig.init(file);

    String fileContents = Util.readFile(file);

    Assert.assertEquals(fileContents.replace("\r", ""), "StringSet:\n" + "- Test\n");
  }
Ejemplo n.º 2
0
  @Test(priority = 1)
  public void onInit() throws Exception {
    config.init(file);

    String fileContents = Util.readFile(file);

    Assert.assertEquals(fileContents, "Enabled: true\n" + "Announcements: {}\n");
  }
Ejemplo n.º 3
0
  @org.testng.annotations.Test(priority = 2)
  public void changeBoolean() throws InvalidConfigurationException, IOException {
    setConfig.StringSet.add("Test1");
    setConfig.save();

    String fileContents = Util.readFile(file);

    Assert.assertEquals(fileContents.replace("\r", ""), "StringSet:\n" + "- Test\n" + "- Test1\n");
  }
Ejemplo n.º 4
0
  @Test(priority = 3)
  public void checkYMLContents() throws Exception {
    String fileContents = Util.readFile(file);

    Assert.assertEquals(
        fileContents,
        "Enabled: true\n"
            + "Announcements:\n"
            + "  test:\n"
            + "    Messages:\n"
            + "    - '&4Welcome to the server!'\n"
            + "    - '&aDon''t forget to check out our website'\n"
            + "    Interval: 300\n"
            + "  global:\n"
            + "    Messages:\n"
            + "    - '&4Welcome to the server!'\n"
            + "    - '&aDon''t forget to check out our website'\n"
            + "    Interval: 300\n"
            + "  test1:\n"
            + "    Messages:\n"
            + "    - '&4Welcome to the server!'\n"
            + "    - '&aDon''t forget to check out our website'\n"
            + "    Interval: 300\n");
  }