X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=tests%2Forg%2Fcacert%2Fgigi%2Futil%2FTestNotary.java;h=477345f36e46bd3404732b76d635728752d8a864;hp=22f75b2362789c0f84c92d5608343c483ab50806;hb=16316c8617f9da0b1e20ad0f54ce33e381f4da39;hpb=0ee41cce6e542df5569376439fea61f08c738ac9 diff --git a/tests/org/cacert/gigi/util/TestNotary.java b/tests/org/cacert/gigi/util/TestNotary.java index 22f75b23..477345f3 100644 --- a/tests/org/cacert/gigi/util/TestNotary.java +++ b/tests/org/cacert/gigi/util/TestNotary.java @@ -2,29 +2,24 @@ package org.cacert.gigi.util; import static org.junit.Assert.*; -import java.io.IOException; import java.sql.SQLException; import java.util.Date; import org.cacert.gigi.GigiApiException; import org.cacert.gigi.database.GigiPreparedStatement; import org.cacert.gigi.dbObjects.Assurance.AssuranceType; +import org.cacert.gigi.dbObjects.ObjectCache; import org.cacert.gigi.dbObjects.User; import org.cacert.gigi.output.DateSelector; -import org.cacert.gigi.testUtils.ManagedTest; +import org.cacert.gigi.testUtils.BusinessTest; import org.junit.Test; -public class TestNotary extends ManagedTest { +public class TestNotary extends BusinessTest { // These tests create a lot of users and therefore require resetting of the // registering-rate-limit. @Test public void testNormalAssurance() throws SQLException, GigiApiException { - try { - clearCaches(); - } catch (IOException e) { - throw new Error(e); - } User[] users = new User[30]; for (int i = 0; i < users.length; i++) { int id = createVerifiedUser("fn" + i, "ln" + i, createUniqueName() + "@email.org", TEST_PASSWORD); @@ -66,11 +61,6 @@ public class TestNotary extends ManagedTest { @Test public void testPoJam() throws SQLException, GigiApiException { - try { - clearCaches(); - } catch (IOException e) { - throw new Error(e); - } User[] users = new User[30]; for (int i = 0; i < users.length; i++) { int id = createVerifiedUser("fn" + i, "ln" + i, createUniqueName() + "@email.org", TEST_PASSWORD); @@ -81,6 +71,7 @@ public class TestNotary extends ManagedTest { ps.setInt(1, id); ps.execute(); } + ObjectCache.clearAllCaches(); // reload values from db User assurer = User.getById(id); for (int i = 0; i < users.length; i++) { assuranceFail(assurer, users[i], -1, "test-notary", "2014-01-01");