commit d00b8ac09b0bd1225e882137460a4847c88e6621 Author: iwakeh iwakeh@torproject.org Date: Wed Oct 19 12:30:06 2016 +0200
Changed 'descriptor.collector' default value to DescriptorIndexCollector. Implements task-20404. --- CHANGELOG.md | 6 ++++++ .../java/org/torproject/descriptor/DescriptorSourceFactory.java | 2 +- .../java/org/torproject/descriptor/DescriptorSourceFactoryTest.java | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md index b5cee05..0f4f2eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changes in version 1.?.? - 2016-1?-??
+ * Major changes + - Make the DescriptorCollector implementation that uses CollecTor's + index.json file to determine which descriptor files to fetch the + new default. Applications must provide gson-2.2.4.jar or higher + as dependency. + * Minor changes - Avoid running into an IOException and logging a warning for it.
diff --git a/src/main/java/org/torproject/descriptor/DescriptorSourceFactory.java b/src/main/java/org/torproject/descriptor/DescriptorSourceFactory.java index 9c78e5c..a9d1558 100644 --- a/src/main/java/org/torproject/descriptor/DescriptorSourceFactory.java +++ b/src/main/java/org/torproject/descriptor/DescriptorSourceFactory.java @@ -72,7 +72,7 @@ public final class DescriptorSourceFactory { * @since 1.0.0 */ public static final String COLLECTOR_DEFAULT = - "org.torproject.descriptor.impl.DescriptorCollectorImpl"; + "org.torproject.descriptor.index.DescriptorIndexCollector";
/** * Property name for overriding the implementation of the diff --git a/src/test/java/org/torproject/descriptor/DescriptorSourceFactoryTest.java b/src/test/java/org/torproject/descriptor/DescriptorSourceFactoryTest.java index 5f2e42e..167c625 100644 --- a/src/test/java/org/torproject/descriptor/DescriptorSourceFactoryTest.java +++ b/src/test/java/org/torproject/descriptor/DescriptorSourceFactoryTest.java @@ -9,10 +9,10 @@ import org.torproject.descriptor.DescriptorDownloader; import org.torproject.descriptor.DescriptorParser; import org.torproject.descriptor.DescriptorReader; import org.torproject.descriptor.ImplementationNotAccessibleException; -import org.torproject.descriptor.impl.DescriptorCollectorImpl; import org.torproject.descriptor.impl.DescriptorDownloaderImpl; import org.torproject.descriptor.impl.DescriptorParserImpl; import org.torproject.descriptor.impl.DescriptorReaderImpl; +import org.torproject.descriptor.index.DescriptorIndexCollector;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -35,7 +35,7 @@ public class DescriptorSourceFactoryTest { public void testDefaults() { setProperties(defaults); DescriptorCollector dc = DescriptorSourceFactory.createDescriptorCollector(); - assertTrue(dc instanceof DescriptorCollectorImpl); + assertTrue(dc instanceof DescriptorIndexCollector); DescriptorDownloader dd = DescriptorSourceFactory.createDescriptorDownloader(); assertTrue(dd instanceof DescriptorDownloaderImpl); DescriptorParser dp = DescriptorSourceFactory.createDescriptorParser(); @@ -101,7 +101,7 @@ public class DescriptorSourceFactoryTest {
}
-class DummyCollectorImplementation extends DescriptorCollectorImpl { +class DummyCollectorImplementation extends DescriptorIndexCollector { static int count; public DummyCollectorImplementation() { count++;
tor-commits@lists.torproject.org