[tor-bugs] #19755 [Metrics/CollecTor]: improve code quality of bridgedescs module
Tor Bug Tracker & Wiki
blackhole at torproject.org
Wed Jul 27 10:56:07 UTC 2016
#19755: improve code quality of bridgedescs module
-------------------------------+---------------------------------
Reporter: iwakeh | Owner: iwakeh
Type: enhancement | Status: needs_review
Priority: Medium | Milestone: CollecTor 1.1.0
Component: Metrics/CollecTor | Version:
Severity: Normal | Resolution:
Keywords: | Actual Points:
Parent ID: | Points:
Reviewer: | Sponsor:
-------------------------------+---------------------------------
Comment (by iwakeh):
Some remarks about the `Configuration`:
* using the enum name instead of the string name of a property makes sure
there are no nonexistant properties in tests and guards against typos,
i.e. `Key.BridgedescsActivated.name()' instead of the string
"BridgedescsActivated"
* `Configuration` exends `Properties`, for example in `SchedulerTest`:
{{{
private static final String runConfigProperties =
"TorperfActivated=true\nTorperfPeriodMinutes=1\nTorperfOffsetMinutes=0\n"
+ "RelaydescsActivated=true\nRelaydescsPeriodMinutes=1"
+ "\nRelaydescsOffsetMinutes=0\n"
+ "ExitlistsActivated=true\nExitlistsPeriodMinutes=1\n"
+ "ExitlistsOffsetMinutes=0\n"
+ "UpdateindexActivated=true\nUpdateindexPeriodMinutes=1\n"
+ "UpdateindexOffsetMinutes=0\n"
+ "BridgedescsActivated=true\nBridgedescsPeriodMinutes=1\n"
+ "BridgedescsOffsetMinutes=0\n";
@Test()
public void testSimpleSchedule() throws Exception {
...
Configuration conf = new Configuration();
conf.load(new ByteArrayInputStream(runConfigProperties.getBytes()));
...
}}}
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/19755#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list