Esempio 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");
  }
Esempio 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");
  }
Esempio 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");
  }
Esempio 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");
  }