Added all tests to the main test suite and added the new test: TestConfig

This commit is contained in:
Obique PSWG
2015-07-19 12:35:35 -05:00
parent ecd25eee70
commit b123c50f2e
3 changed files with 62 additions and 6 deletions
+37
View File
@@ -0,0 +1,37 @@
package resources.services;
import java.io.File;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import resources.server_info.Config;
@RunWith(JUnit4.class)
public class TestConfig {
private static final File file = new File("test_config.cfg");
static {
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
file.deleteOnExit();
}
@Test
public void testGetSet() {
Config c = new Config(file);
c.setProperty("TEST-VALUE", true);
c.save();
c.load();
Assert.assertTrue(c.getBoolean("TEST-VALUE", false));
file.delete();
}
}