예제 #1
0
파일: Set.java 프로젝트: GunfighterJ/Yamler
  @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");
  }
예제 #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");
  }
예제 #3
0
파일: Set.java 프로젝트: GunfighterJ/Yamler
  @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");
  }
예제 #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");
  }