X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=tests%2Forg%2Fcacert%2Fgigi%2FtestUtils%2FManagedTest.java;h=77822f52380101b47ff7d7c4ca17db1687255d6e;hb=a9e1e3275864b32c8d6a2f9ae0853f36d716b06f;hp=f20ed763f7d4cca84b65296e129ff70147e2bc1b;hpb=98410d964cfab49b45c5e56c4f9577f6527f400b;p=gigi.git diff --git a/tests/org/cacert/gigi/testUtils/ManagedTest.java b/tests/org/cacert/gigi/testUtils/ManagedTest.java index f20ed763..77822f52 100644 --- a/tests/org/cacert/gigi/testUtils/ManagedTest.java +++ b/tests/org/cacert/gigi/testUtils/ManagedTest.java @@ -95,10 +95,7 @@ public class ManagedTest { if ( !DatabaseConnection.isInited()) { DatabaseConnection.init(testProps); } - System.out.println("... purging Database"); - DatabaseManager.run(new String[] { - testProps.getProperty("sql.driver"), testProps.getProperty("sql.url"), testProps.getProperty("sql.user"), testProps.getProperty("sql.password") - }); + purgeDatabase(); String type = testProps.getProperty("type"); Properties mainProps = generateMainProps(); ServerConstants.init(mainProps); @@ -144,8 +141,6 @@ public class ManagedTest { SimpleSigner.runSigner(); } catch (IOException e) { throw new Error(e); - } catch (ClassNotFoundException e1) { - e1.printStackTrace(); } catch (SQLException e1) { e1.printStackTrace(); } catch (InterruptedException e) { @@ -154,6 +149,17 @@ public class ManagedTest { } + public static void purgeDatabase() throws SQLException, IOException { + System.out.println("... purging Database"); + try { + DatabaseManager.run(new String[] { + testProps.getProperty("sql.driver"), testProps.getProperty("sql.url"), testProps.getProperty("sql.user"), testProps.getProperty("sql.password") + }); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + } + private static Properties generateMainProps() { Properties mainProps = new Properties(); mainProps.setProperty("host", "127.0.0.1");