mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-07-31 01:15:50 -04:00
38 lines
682 B
Java
38 lines
682 B
Java
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();
|
|
}
|
|
|
|
}
|