[tor-commits] [onionoo/release] Add test that reproduces NPE.

karsten at torproject.org karsten at torproject.org
Thu Aug 31 15:02:37 UTC 2017


commit 2eead2a12ff350d66e5713d105d50e8d8cd287b3
Author: iwakeh <iwakeh at torproject.org>
Date:   Wed Aug 30 20:37:35 2017 +0000

    Add test that reproduces NPE.
    
    The timeouts are ncessary, when something unforseen makes the
    NodeIndexer.getLatestNodeIndex wait forever.
---
 .../onionoo/server/ResourceServletTest.java        | 370 ++++++++++-----------
 1 file changed, 185 insertions(+), 185 deletions(-)

diff --git a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
index 4ebf0d2..303cf21 100644
--- a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
+++ b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
@@ -155,7 +155,7 @@ public class ResourceServletTest {
         new TreeSet<String>(Arrays.asList(new String[] {
             "000C5F55BD4814B917CC474BD537F1A3B33CCE2A" })),
         new TreeSet<>(Arrays.asList(new String[] {
-            "000C5F55BD4814B917CC474BD537F1A3B33CCE2A" })), "0.2.3.24-rc-dev");
+            "000C5F55BD4814B917CC474BD537F1A3B33CCE2A" })), null);
     this.relays = new TreeMap<>();
     this.relays.put("000C5F55BD4814B917CC474BD537F1A3B33CCE2A",
         relayTorkaZ);
@@ -367,7 +367,7 @@ public class ResourceServletTest {
     private boolean r;
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testValidSummaryRelay() throws IOException {
     this.runTest("/summary");
     assertEquals("2013-04-24 12:00:00",
@@ -387,7 +387,7 @@ public class ResourceServletTest {
     assertFalse(relay.r);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testValidSummaryBridge() {
     this.runTest("/summary");
     assertEquals("2013-04-24 01:07:04",
@@ -405,519 +405,519 @@ public class ResourceServletTest {
     assertFalse(bridge.r);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testNonExistantDocumentType() {
     this.assertErrorStatusCode(
         "/doesnotexist", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSummaryUpperCaseDocument() {
     this.assertErrorStatusCode(
         "/SUMMARY", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testTypeRelay() {
     this.assertSummaryDocument(
         "/summary?type=relay", 3, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testTypeBridge() {
     this.assertSummaryDocument(
         "/summary?type=bridge", 0, null, 3, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testTypeBridgerelay() {
     this.assertErrorStatusCode(
         "/summary?type=bridgerelay", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testTypeRelayBridge() {
     this.assertSummaryDocument(
         "/summary?type=relay&type=bridge", 3, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testTypeBridgeRelay() {
     this.assertSummaryDocument(
         "/summary?type=bridge&type=relay", 0, null, 3, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testTypeRelayRelay() {
     this.assertSummaryDocument(
         "/summary?type=relay&type=relay", 3, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testTypeUpperCaseRelay() {
     this.assertErrorStatusCode(
         "/summary?TYPE=relay", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testTypeRelayUpperCase() {
     this.assertSummaryDocument(
         "/summary?type=RELAY", 3, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testRunningTrue() {
     this.assertSummaryDocument(
         "/summary?running=true", 1, new String[] { "Ferrari458" }, 1,
         new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testRunningFalse() {
     this.assertSummaryDocument(
         "/summary?running=false", 2, null, 2, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testRunningTruefalse() {
     this.assertErrorStatusCode(
         "/summary?running=truefalse", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testRunningTrueFalse() {
     this.assertSummaryDocument(
         "/summary?running=true&running=false", 1,
         new String[] { "Ferrari458" }, 1,  new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testRunningFalseTrue() {
     this.assertSummaryDocument(
         "/summary?running=false&running=true", 2, null, 2, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testRunningTrueTrue() {
     this.assertSummaryDocument(
         "/summary?running=true&running=true", 1,
         new String[] { "Ferrari458" }, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testRunningUpperCaseTrue() {
     this.assertErrorStatusCode(
         "/summary?RUNNING=true", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testRunningTrueUpperCase() {
     this.assertSummaryDocument(
         "/summary?running=TRUE", 1, null, 1, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchTorkaZ() {
     this.assertSummaryDocument(
         "/summary?search=TorkaZ", 1, new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchTorkaX() {
     this.assertSummaryDocument(
         "/summary?search=TorkaX", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchOrkaZ() {
     this.assertSummaryDocument(
         "/summary?search=orkaZ", 1, new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchTorka() {
     this.assertSummaryDocument(
         "/summary?search=Torka", 1, new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchTorkazUpperCase() {
     this.assertSummaryDocument(
         "/summary?search=TORKAZ", 1, new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchDollarFingerprint() {
     this.assertSummaryDocument(
         "/summary?search=$000C5F55BD4814B917CC474BD537F1A3B33CCE2A", 1,
         new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchFingerprint() {
     this.assertSummaryDocument(
         "/summary?search=000C5F55BD4814B917CC474BD537F1A3B33CCE2A", 1,
         new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchDollarFingerprint39() {
     this.assertSummaryDocument(
         "/summary?search=$000C5F55BD4814B917CC474BD537F1A3B33CCE2", 1,
         new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchDollarFingerprintLowerCase39() {
     this.assertSummaryDocument(
         "/summary?search=$000c5f55bd4814b917cc474bd537f1a3b33cce2", 1,
         new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchFingerprintLowerCase39() {
     this.assertSummaryDocument(
         "/summary?search=000c5f55bd4814b917cc474bd537f1a3b33cce2", 1,
         new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchDollarHashedFingerprint() {
     this.assertSummaryDocument(
         "/summary?search=$5aa14c08d62913e0057a9ad5863b458c0ce94cee", 1,
         new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchDollarHashedFingerprint39() {
     this.assertSummaryDocument(
         "/summary?search=$5aa14c08d62913e0057a9ad5863b458c0ce94ce", 1,
         new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchDollarHashedFingerprint41() {
     this.assertErrorStatusCode(
         "/summary?search=$5aa14c08d62913e0057a9ad5863b458c0ce94ceee",
         400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBase64FingerprintAlphaNum() {
     this.assertSummaryDocument(
         "/summary?search=AAxfVb1IFLkXzEdL1Tfxo7M8zio", 1,
         new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBase64FingerprintSlash() {
     this.assertSummaryDocument(
         "/summary?search=ABwTs6Vacbl3ymXshVOdecZTo/w", 1,
         new String[] { "Ferrari458" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBase64FingerprintPlus() {
     this.assertSummaryDocument(
         "/summary?search=ACXBNsHzqe7+KuP5GPA7+iG1Bws", 1,
         new String[] { "TimMayTribute" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBase64FingerprintBridge() {
     this.assertSummaryDocument(
         "/summary?search=AACDGyNt/3PUCa0XtA4qcopTmU8", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBase64FingerprintPartial() {
     this.assertSummaryDocument(
         "/summary?search=AAx", 1, new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBase64HashedFingerprintTorkaZ() {
     this.assertSummaryDocument(
         "/summary?search=WqFMCNYpE+AFeprVhjtFjAzpTO4", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBase64Fingerprint28() {
     this.assertErrorStatusCode(
         "/summary?search=AAAAAAAAAAAA//AAAAAAAAAAAAAA", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchSpaceSeparatedFingerprintFourty() {
     this.assertSummaryDocument(
         "/summary?search=000C 5F55 BD48 14B9 17CC 474B D537 F1A3 B33C "
         + "CE2A", 1, new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchSpaceSeparatedFingerprintLastEight() {
     this.assertSummaryDocument(
         "/summary?search=F1A3 B33C", 1, new String[] { "TorkaZ" }, 0,
         null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchSpaceSeparatedFingerprintLastThree() {
     this.assertSummaryDocument(
         "/summary?search=33C", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIp() {
     this.assertSummaryDocument(
         "/summary?search=62.216.201.221", 1, new String[] { "TorkaZ" }, 0,
         null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIp24Network() {
     this.assertSummaryDocument(
         "/summary?search=62.216.201", 1, new String[] { "TorkaZ" }, 0,
         null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIpExit() {
     this.assertSummaryDocument(
         "/summary?search=62.216.201.222", 1, new String[] { "TorkaZ" }, 0,
         null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIpv6() {
     this.assertSummaryDocument(
         "/summary?search=[2001:4f8:3:2e::51]", 1,
         new String[] { "Ferrari458" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIpv6Slash64NoTrailingBracket() {
     this.assertSummaryDocument(
         "/summary?search=[2001:4f8:3:2e::", 1,
         new String[] { "Ferrari458" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIpv6Slash64TrailingBracket() {
     this.assertSummaryDocument(
         "/summary?search=[2001:4f8:3:2e::]", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIpv6Slash64NoBrackets() {
     this.assertSummaryDocument(
         "/summary?search=2001:4f8:3:2e::", 1,
         new String[] { "Ferrari458" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIpv6Slash8Colon() {
     this.assertSummaryDocument(
         "/summary?search=[2001:", 1,
         new String[] { "Ferrari458" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIpv6Slash8NoColon() {
     this.assertSummaryDocument(
         "/summary?search=[2001", 1,
         new String[] { "Ferrari458" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIpv6Slash8NoColonNoBrackets() {
     this.assertSummaryDocument(
         "/summary?search=2001", 1,
         new String[] { "Ferrari458" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIpv6Uncompressed() {
     this.assertSummaryDocument(
         "/summary?search=[2001:04f8:0003:002e:0000:0000:0000:0051]", 0,
         null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIpv6UpperCase() {
     this.assertSummaryDocument(
         "/summary?search=[2001:4F8:3:2E::51]", 1,
         new String[] { "Ferrari458" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIpv6ThreeColons() {
     this.assertSummaryDocument(
         "/summary?search=[2001:4f8:3:2e:::51]", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIpv6FiveHex() {
     this.assertSummaryDocument(
         "/summary?search=[20014:f80:3:2e::51]", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIpv6NineGroups() {
     this.assertSummaryDocument(
         "/summary?search=[1:2:3:4:5:6:7:8:9]", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchIpv6TcpPort() {
     this.assertErrorStatusCode(
         "/summary?search=[2001:4f8:3:2e::51]:9001", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchGummy() {
     this.assertSummaryDocument(
         "/summary?search=gummy", 0, null, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchGummi() {
     this.assertSummaryDocument(
         "/summary?search=gummi", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchUmmy() {
     this.assertSummaryDocument(
         "/summary?search=ummy", 0, null, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchGumm() {
     this.assertSummaryDocument(
         "/summary?search=gumm", 0, null, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchGummyUpperCase() {
     this.assertSummaryDocument(
         "/summary?search=GUMMY", 0, null, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBridgeDollarHashedFingerprint() {
     this.assertSummaryDocument(
         "/summary?search=$1FEDE50ED8DBA1DD9F9165F78C8131E4A44AB756", 0,
         null, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBridgeHashedFingerprint() {
     this.assertSummaryDocument(
         "/summary?search=1FEDE50ED8DBA1DD9F9165F78C8131E4A44AB756", 0,
         null, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBridgeDollarHashedFingerprint39() {
     this.assertSummaryDocument(
         "/summary?search=$1FEDE50ED8DBA1DD9F9165F78C8131E4A44AB75", 0,
         null, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBridgeDollarHashedFingerprintLowerCase39() {
     this.assertSummaryDocument(
         "/summary?search=$1fede50ed8dba1dd9f9165f78c8131e4a44ab75", 0,
         null, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBridgeHashedFingerprintLowerCase39() {
     this.assertSummaryDocument(
         "/summary?search=1fede50ed8dba1dd9f9165f78c8131e4a44ab75", 0,
         null, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBridgeDollarHashedHashedFingerprint() {
     this.assertSummaryDocument(
         "/summary?search=$CE52F898DB3678BCE33FAC28C92774DE90D618B5", 0,
         null, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBridgeDollarHashedHashedFingerprint39() {
     this.assertSummaryDocument(
         "/summary?search=$CE52F898DB3678BCE33FAC28C92774DE90D618B", 0,
         null, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchBridgeDollarOriginalFingerprint() {
     this.assertSummaryDocument(
         "/summary?search=$0010D49C6DA1E46A316563099F41BFE40B6C7183", 0,
         null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchUnderscore() {
     this.assertErrorStatusCode(
         "/summary?search=_", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchTypeRelay() {
     this.assertSummaryDocument("/summary?search=type:relay", 3, null, 0,
         null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchTypeRelayTorkaZ() {
     this.assertSummaryDocument("/summary?search=type:relay TorkaZ", 1,
         new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchTorkaZTypeRelay() {
     this.assertSummaryDocument("/summary?search=TorkaZ type:relay", 1,
         new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchTorkaZEscapedSpaceTypeRelay() {
     this.assertSummaryDocument("/summary?search=TorkaZ%20type:relay", 1,
         new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchTypeRelayTypeDirectory() {
     this.assertSummaryDocument(
         "/summary?search=type:relay type:directory", 3, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchTypeDirectoryTypeRelay() {
     this.assertErrorStatusCode(
         "/summary?search=type:directory type:relay", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchFooBar() {
     this.assertErrorStatusCode("/summary?search=foo:bar", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchSearchTorkaZ() {
     this.assertErrorStatusCode("/summary?search=search:TorkaZ", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchLimitOne() {
     this.assertErrorStatusCode("/summary?search=limit:1", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchDeadBeef() {
     /* This does not return 400 Bad Request, even though "dead" is not a valid
      * search term qualifier, because this could be the start of an IPv6 address
@@ -925,389 +925,389 @@ public class ResourceServletTest {
     this.assertSummaryDocument("/summary?search=dead:beef", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testSearchEmailAddress() {
     this.assertSummaryDocument(
         "/summary?search=contact:<tor+steven.murdoch at cl.cam.ac.uk>", 1,
         new String[] { "TimMayTribute" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLookupFingerprint() {
     this.assertSummaryDocument(
         "/summary?lookup=000C5F55BD4814B917CC474BD537F1A3B33CCE2A", 1,
         new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLookupDollarFingerprint() {
     this.assertErrorStatusCode(
         "/summary?lookup=$000C5F55BD4814B917CC474BD537F1A3B33CCE2A", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLookupDollarFingerprint39() {
     this.assertErrorStatusCode(
         "/summary?lookup=$000C5F55BD4814B917CC474BD537F1A3B33CCE2", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLookupFingerprintLowerCase39() {
     this.assertErrorStatusCode(
         "/summary?lookup=000c5f55bd4814b917cc474bd537f1a3b33cce2", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLookupHashedFingerprint() {
     this.assertSummaryDocument(
         "/summary?lookup=5aa14c08d62913e0057a9ad5863b458c0ce94cee", 1,
         new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLookupBridgeHashedFingerprint() {
     this.assertSummaryDocument(
         "/summary?lookup=1FEDE50ED8DBA1DD9F9165F78C8131E4A44AB756", 0,
         null, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLookupBridgeHashedHashedFingerprint() {
     this.assertSummaryDocument(
         "/summary?lookup=CE52F898DB3678BCE33FAC28C92774DE90D618B5", 0,
         null, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLookupBridgeOriginalFingerprint() {
     this.assertSummaryDocument(
         "/summary?lookup=0010D49C6DA1E46A316563099F41BFE40B6C7183", 0,
         null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLookupNonExistantFingerprint() {
     this.assertSummaryDocument(
         "/summary?lookup=0000000000000000000000000000000000000000", 0,
         null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFingerprintRelayFingerprint() {
     this.assertSummaryDocument(
         "/summary?fingerprint=000C5F55BD4814B917CC474BD537F1A3B33CCE2A",
         1, new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFingerprintRelayHashedFingerprint() {
     this.assertSummaryDocument(
-        "/summary?fingerprint=5aa14c08d62913e0057a9ad5863b458c0ce94cee",
+        "/summary?fingerprint=4aa14c08d62913e0057a9ad5863b458c0ce94cee",
         0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFingerprintBridgeHashedFingerprint() {
     this.assertSummaryDocument(
         "/summary?fingerprint=1FEDE50ED8DBA1DD9F9165F78C8131E4A44AB756",
         0, null, 1, new String[] { "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFingerprintBridgeHashedHashedFingerprint() {
     this.assertSummaryDocument(
         "/summary?fingerprint=CE52F898DB3678BCE33FAC28C92774DE90D618B5",
         0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFingerprintBridgeOriginalFingerprint() {
     this.assertSummaryDocument(
         "/summary?fingerprint=0010D49C6DA1E46A316563099F41BFE40B6C7183",
         0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testCountryDe() {
     this.assertSummaryDocument(
         "/summary?country=de", 1, new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testCountryFr() {
     this.assertSummaryDocument(
         "/summary?country=fr", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testCountryZz() {
     this.assertSummaryDocument(
         "/summary?country=zz", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testCountryDeUpperCase() {
     this.assertSummaryDocument(
         "/summary?country=DE", 1, new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testCountryDeu() {
     this.assertErrorStatusCode(
         "/summary?country=deu", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testCountryD() {
     this.assertErrorStatusCode(
         "/summary?country=d", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testCountryA1() {
     this.assertSummaryDocument(
         "/summary?country=a1", 1, new String[] { "TimMayTribute" }, 0,
         null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testCountryDeDe() {
     this.assertSummaryDocument(
         "/summary?country=de&country=de", 1, new String[] { "TorkaZ" }, 0,
         null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testAsAS8767() {
     this.assertSummaryDocument(
         "/summary?as=AS8767", 1, new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testAs8767() {
     this.assertSummaryDocument(
         "/summary?as=8767", 1, new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testAsAs() {
     this.assertErrorStatusCode(
         "/summary?as=AS", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testAsas8767() {
     this.assertSummaryDocument(
         "/summary?as=as8767", 1, new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testAsAsSpace8767() {
     this.assertErrorStatusCode(
         "/summary?as=AS 8767", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFlagRunning() {
     this.assertSummaryDocument(
         "/summary?flag=Running", 3, null, 1, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFlagValid() {
     this.assertSummaryDocument(
         "/summary?flag=Valid", 3, null, 3, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFlagFast() {
     this.assertSummaryDocument(
         "/summary?flag=Fast", 2, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFlagNamed() {
     this.assertSummaryDocument(
         "/summary?flag=Named", 1, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFlagUnnamed() {
     this.assertSummaryDocument(
         "/summary?flag=Unnamed", 1, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFlagV2Dir() {
     this.assertSummaryDocument(
         "/summary?flag=V2Dir", 2, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFlagGuard() {
     this.assertSummaryDocument(
         "/summary?flag=Guard", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFlagCool() {
     this.assertSummaryDocument(
         "/summary?flag=Cool", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFirstSeenDaysZeroToTwo() {
     this.assertSummaryDocument(
         "/summary?first_seen_days=0-2", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFirstSeenDaysUpToThree() {
     this.assertSummaryDocument(
         "/summary?first_seen_days=-3", 0, null, 1, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFirstSeenDaysThree() {
     this.assertSummaryDocument(
         "/summary?first_seen_days=3", 0, null, 1, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFirstSeenDaysTwoToFive() {
     this.assertSummaryDocument(
         "/summary?first_seen_days=2-5", 0, null, 1, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFirstSeenDaysSevenToSixteen() {
     this.assertSummaryDocument(
         "/summary?first_seen_days=7-16", 2, null, 1, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFirstSeenDaysNinetysevenOrMore() {
     this.assertSummaryDocument(
         "/summary?first_seen_days=97-", 0, null, 1, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFirstSeenDaysNinetyeightOrMore() {
     this.assertSummaryDocument(
         "/summary?first_seen_days=98-", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFirstSeenDaysDashDash() {
     this.assertErrorStatusCode(
         "/summary?first_seen_days=--", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFirstSeenDaysDashOneDash() {
     this.assertErrorStatusCode(
         "/summary?first_seen_days=-1-", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFirstSeenDaysZeroDotDotOne() {
     this.assertErrorStatusCode(
         "/summary?first_seen_days=0..1", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFirstSeenDaysElevenDigits() {
     this.assertErrorStatusCode(
         "/summary?first_seen_days=12345678901", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFirstSeenDaysLargeTenDigitNumber() {
     this.assertErrorStatusCode(
         "/summary?first_seen_days=9999999999", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFirstSeenDaysMaxInt() {
     this.assertSummaryDocument(
         "/summary?last_seen_days=" + String.valueOf(Integer.MAX_VALUE), 0,
         null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFirstSeenDaysMaxIntPlusOne() {
     this.assertErrorStatusCode(
         "/summary?first_seen_days="
         + String.valueOf(Integer.MAX_VALUE + 1), 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLastSeenDaysZero() {
     this.assertSummaryDocument(
         "/summary?last_seen_days=0", 1, null, 1, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLastSeenDaysUpToZero() {
     this.assertSummaryDocument(
         "/summary?last_seen_days=-0", 1, null, 1, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLastSeenDaysOneToThree() {
     this.assertSummaryDocument(
         "/summary?last_seen_days=1-3", 1, null, 2, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLastSeenDaysSixOrMore() {
     this.assertSummaryDocument(
         "/summary?last_seen_days=6-", 0, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testContactSteven() {
     this.assertSummaryDocument(
         "/summary?contact=Steven", 1, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testContactStevenMurdoch() {
     this.assertSummaryDocument(
         "/summary?contact=Steven Murdoch", 1, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testContactMurdochSteven() {
     this.assertSummaryDocument(
         "/summary?contact=Murdoch Steven", 1, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testContactStevenDotMurdoch() {
     this.assertSummaryDocument(
         "/summary?contact=Steven.Murdoch", 1, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testContactFbTokenFive() {
     this.assertSummaryDocument(
         "/summary?contact=<fb-token:5sR_K_zs2wM=>", 1, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testContactFbToken() {
     this.assertSummaryDocument(
         "/summary?contact=<fb-token:", 2, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testContactDash() {
     this.assertSummaryDocument(
         "/summary?contact=-", 2, null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOrderConsensusWeightAscending() {
     this.assertSummaryDocument(
         "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_ASC, 3,
@@ -1315,7 +1315,7 @@ public class ResourceServletTest {
         null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOrderConsensusWeightDescending() {
     this.assertSummaryDocument(
         "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_DES, 3,
@@ -1323,27 +1323,27 @@ public class ResourceServletTest {
         null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOrderConsensusWeightAscendingTwice() {
     this.assertErrorStatusCode(
         "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_ASC
         + "," + OrderParameterValues.CONSENSUS_WEIGHT_ASC, 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOrderConsensusWeightAscendingThenDescending() {
     this.assertErrorStatusCode(
         "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_ASC + ","
         + OrderParameterValues.CONSENSUS_WEIGHT_DES + "", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOrderConsensusWeightThenNickname() {
     this.assertErrorStatusCode(
         "/summary?order=consensus_weight,nickname", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOrderConsensusWeight() {
     this.assertSummaryDocument(
         "/summary?order=CONSENSUS_WEIGHT", 3,
@@ -1351,7 +1351,7 @@ public class ResourceServletTest {
         null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOrderConsensusWeightAscendingLimit1() {
     this.assertSummaryDocument(
         "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_ASC
@@ -1359,7 +1359,7 @@ public class ResourceServletTest {
         new String[] { "TorkaZ" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOrderConsensusWeightDescendingLimit1() {
     this.assertSummaryDocument(
         "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_DES
@@ -1367,7 +1367,7 @@ public class ResourceServletTest {
         new String[] { "Ferrari458" }, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOrderConsensusWeightFiveTimes() {
     this.assertErrorStatusCode(
         "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_ASC + ","
@@ -1377,7 +1377,7 @@ public class ResourceServletTest {
         + OrderParameterValues.CONSENSUS_WEIGHT_ASC, 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOrderFirstSeenThenConsensusWeight() {
     this.assertSummaryDocument(
         "/summary?order=" + OrderParameterValues.FIRST_SEEN_ASC + ","
@@ -1386,7 +1386,7 @@ public class ResourceServletTest {
         new String[] { "gummy", null, "ec2bridgercc7f31fe" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOrderFirstSeenDescendingThenConsensusWeight() {
     this.assertSummaryDocument("/summary?order="
         + OrderParameterValues.FIRST_SEEN_DES + ","
@@ -1395,7 +1395,7 @@ public class ResourceServletTest {
         new String[] { "ec2bridgercc7f31fe", null, "gummy" });
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOrderConsensusWeightThenFirstSeenDescending() {
     this.assertSummaryDocument(
         "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_ASC + ","
@@ -1404,131 +1404,131 @@ public class ResourceServletTest {
         null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOffsetOne() {
     this.assertSkippedReturnedTruncated(
         "/summary?offset=1", 1, 2, 0, 0, 3, 0);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOffsetAllRelays() {
     this.assertSkippedReturnedTruncated(
         "/summary?offset=3", 3, 0, 0, 0, 3, 0);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOffsetAllRelaysAndOneBridge() {
     this.assertSkippedReturnedTruncated(
         "/summary?offset=4", 3, 0, 0, 1, 2, 0);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOffsetAllRelaysAndAllBridges() {
     this.assertSkippedReturnedTruncated(
         "/summary?offset=6", 3, 0, 0, 3, 0, 0);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOffsetMoreThanAllRelaysAndAllBridges() {
     this.assertSkippedReturnedTruncated(
         "/summary?offset=7", 3, 0, 0, 3, 0, 0);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOffsetZero() {
     this.assertSkippedReturnedTruncated(
         "/summary?offset=0", 0, 3, 0, 0, 3, 0);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOffsetMinusOne() {
     this.assertSkippedReturnedTruncated(
         "/summary?offset=-1", 0, 3, 0, 0, 3, 0);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testOffsetOneWord() {
     this.assertErrorStatusCode(
         "/summary?offset=one", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLimitOne() {
     this.assertSkippedReturnedTruncated(
         "/summary?limit=1", 0, 1, 2, 0, 0, 3);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLimitAllRelays() {
     this.assertSkippedReturnedTruncated(
         "/summary?limit=3", 0, 3, 0, 0, 0, 3);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLimitAllRelaysAndOneBridge() {
     this.assertSkippedReturnedTruncated(
         "/summary?limit=4", 0, 3, 0, 0, 1, 2);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLimitAllRelaysAndAllBridges() {
     this.assertSkippedReturnedTruncated(
         "/summary?limit=6", 0, 3, 0, 0, 3, 0);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLimitMoreThanAllRelaysAndAllBridges() {
     this.assertSkippedReturnedTruncated(
         "/summary?limit=7", 0, 3, 0, 0, 3, 0);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLimitZero() {
     this.assertSkippedReturnedTruncated(
         "/summary?limit=0", 0, 0, 3, 0, 0, 3);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLimitMinusOne() {
     this.assertSkippedReturnedTruncated(
         "/summary?limit=-1", 0, 0, 3, 0, 0, 3);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testLimitOneWord() {
     this.assertErrorStatusCode(
         "/summary?limit=one", 400);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFamilyTorkaZ() {
     this.assertSummaryDocument(
         "/summary?family=000C5F55BD4814B917CC474BD537F1A3B33CCE2A", 2,
         null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFamilyFerrari458() {
     this.assertSummaryDocument(
         "/summary?family=001C13B3A55A71B977CA65EC85539D79C653A3FC", 2,
         null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFamilyTimMayTribute() {
     this.assertSummaryDocument(
         "/summary?family=0025C136C1F3A9EEFE2AE3F918F03BFA21B5070B", 1,
         null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFamilyBridgegummy() {
     this.assertSummaryDocument(
         "/summary?family=0000831B236DFF73D409AD17B40E2A728A53994F", 0,
         null, 0, null);
   }
 
-  @Test()
+  @Test(timeout = 100)
   public void testFamily39Characters() {
     this.assertErrorStatusCode(
         "/summary?family=00000000000000000000000000000000000000", 400);
@@ -1542,7 +1542,7 @@ public class ResourceServletTest {
 
   @Test
   public void testVersion02324() {
-    this.assertSummaryDocument("/summary?version=0.2.3.24-rc-dev", 1,
+    this.assertSummaryDocument("/summary?version=0.2.3.24-rc-dev", 0,
         new String[] { "Ferrari458" }, 0, null);
   }
 
@@ -1559,29 +1559,29 @@ public class ResourceServletTest {
 
   @Test
   public void testVersion0() {
-    this.assertSummaryDocument("/summary?version=0", 3, null, 0, null);
+    this.assertSummaryDocument("/summary?version=0", 2, null, 0, null);
   }
 
   @Test
   public void testVersion02() {
-    this.assertSummaryDocument("/summary?version=0.2", 3, null, 0, null);
+    this.assertSummaryDocument("/summary?version=0.2", 2, null, 0, null);
   }
 
   @Test
   public void testVersion023() {
-    this.assertSummaryDocument("/summary?version=0.2.3", 3, null, 0, null);
+    this.assertSummaryDocument("/summary?version=0.2.3", 2, null, 0, null);
   }
 
   @Test
   public void testVersion0232() {
     /* This is correct when comparing strings. */
-    this.assertSummaryDocument("/summary?version=0.2.3.2", 3, null, 0, null);
+    this.assertSummaryDocument("/summary?version=0.2.3.2", 2, null, 0, null);
   }
 
   @Test
   public void testVersion023Dot() {
     /* This is also correct when comparing strings. */
-    this.assertSummaryDocument("/summary?version=0.2.3.", 3, null, 0, null);
+    this.assertSummaryDocument("/summary?version=0.2.3.", 2, null, 0, null);
   }
 
   @Test





More information about the tor-commits mailing list