[collector/master] Removed obsolete property 'LockFilePath'.

commit 31771de7c51c4d3acf6a7265858f685a40c6ac38 Author: iwakeh <iwakeh@torproject.org> Date: Tue Aug 9 20:23:43 2016 +0200 Removed obsolete property 'LockFilePath'. --- src/main/java/org/torproject/collector/conf/Key.java | 1 - src/main/resources/collector.properties | 2 -- src/test/java/org/torproject/collector/MainTest.java | 9 +++------ .../java/org/torproject/collector/conf/ConfigurationTest.java | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/torproject/collector/conf/Key.java b/src/main/java/org/torproject/collector/conf/Key.java index a3a9aa2..fce89a2 100644 --- a/src/main/java/org/torproject/collector/conf/Key.java +++ b/src/main/java/org/torproject/collector/conf/Key.java @@ -13,7 +13,6 @@ public enum Key { ExitlistOutputDirectory(Path.class), ExitlistUrl(URL.class), InstanceBaseUrl(String.class), - LockFilePath(Path.class), ArchivePath(Path.class), RecentPath(Path.class), IndexPath(Path.class), diff --git a/src/main/resources/collector.properties b/src/main/resources/collector.properties index ba07c01..f9b71bb 100644 --- a/src/main/resources/collector.properties +++ b/src/main/resources/collector.properties @@ -48,8 +48,6 @@ UpdateindexOffsetMinutes = 0 # The URL of this instance. This will be the base URL # written to index.json InstanceBaseUrl = "https://collector.torproject.org" -# Obsolete value, this will be removed soon. -LockFilePath = lock # The target location for index.json and its compressed # versions index.json.gz, index.json.bz2, and index.json.xz IndexPath = . diff --git a/src/test/java/org/torproject/collector/MainTest.java b/src/test/java/org/torproject/collector/MainTest.java index 28d7133..05c16c5 100644 --- a/src/test/java/org/torproject/collector/MainTest.java +++ b/src/test/java/org/torproject/collector/MainTest.java @@ -79,11 +79,10 @@ public class MainTest { @Test() public void testSmoke() throws Exception { File conf = tmpf.newFile("test.conf"); - File lockPath = tmpf.newFolder("test.lock"); assertEquals(0L, conf.length()); Main.main(new String[]{conf.toString()}); assertTrue(4_000L <= conf.length()); - changeFilePathsAndSetActivation(conf, lockPath, + changeFilePathsAndSetActivation(conf, Key.TorperfActivated.name()); Main.main(new String[]{conf.toString()}); waitSec(2); @@ -98,7 +97,7 @@ public class MainTest { } } - private void changeFilePathsAndSetActivation(File f, File l, String a) + private void changeFilePathsAndSetActivation(File f, String a) throws Exception { List<String> lines = Files.readAllLines(f.toPath()); BufferedWriter bw = Files.newBufferedWriter(f.toPath()); @@ -107,9 +106,7 @@ public class MainTest { String inStr = "in/"; String outStr = "out/"; for(String line : lines) { - if (line.contains(Key.LockFilePath.name())) { - line = Key.LockFilePath.name() + " = " + l.toString(); - } else if (line.contains(inStr)) { + if (line.contains(inStr)) { line = line.replace(inStr, in.toString() + inStr); } else if (line.contains(outStr)) { line = line.replace(outStr, out.toString() + outStr); diff --git a/src/test/java/org/torproject/collector/conf/ConfigurationTest.java b/src/test/java/org/torproject/collector/conf/ConfigurationTest.java index b707f2f..2f727aa 100644 --- a/src/test/java/org/torproject/collector/conf/ConfigurationTest.java +++ b/src/test/java/org/torproject/collector/conf/ConfigurationTest.java @@ -37,7 +37,7 @@ public class ConfigurationTest { public void testKeyCount() throws Exception { assertEquals("The number of properties keys in enum Key changed." + "\n This test class should be adapted.", - 49, Key.values().length); + 48, Key.values().length); } @Test()
participants (1)
-
karsten@torproject.org