]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/testUtils/ManagedTest.java
Fix: some smaller findBugs issues (static access, syncing, random..)
[gigi.git] / tests / org / cacert / gigi / testUtils / ManagedTest.java
index 8f6e6c5d44f360301e6efd0f5e323583bcc4081f..4ac5d910f3d9ba78f3a2f1f65a33c0ff35b784de 100644 (file)
@@ -141,6 +141,7 @@ public class ManagedTest extends ConfiguredTest {
                 throw new Error("Server startup failed");
             }
             ter = new TestEmailReciever(new InetSocketAddress("localhost", 8473));
+            ter.start();
             SimpleSigner.runSigner();
         } catch (IOException e) {
             throw new Error(e);
@@ -168,7 +169,7 @@ public class ManagedTest extends ConfiguredTest {
 
     public static void clearCaches() throws IOException {
         ObjectCache.clearAllCaches();
-        String type = testProps.getProperty("type");
+        // String type = testProps.getProperty("type");
         URL u = new URL("https://" + getServerName() + "/manage");
         u.openConnection().getHeaderField("Location");
     }
@@ -218,15 +219,19 @@ public class ManagedTest extends ConfiguredTest {
 
     @After
     public void clearAcceptLanguage() {
-        acceptLanguage = null;
+        ManagedTest.setAcceptLanguage(null);
     }
 
     public TestMail waitForMail() {
-        try {
-            return ter.recieve();
-        } catch (InterruptedException e) {
-            throw new Error(e);
+        TestMail mail = null;
+        while (null == mail) {
+            try {
+                mail = ter.recieve();
+            } catch (InterruptedException e) {
+                throw new Error(e);
+            }
         }
+        return mail;
     }
 
     public static TestEmailReciever getMailReciever() {