mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-09-11 21:45:26 -04:00
Added all tests to the main test suite and added the new test: TestConfig
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user