summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a9e1e32)
+profiling output for "purging Database"
public class TestDNS extends ManagedTest {
@Test
public class TestDNS extends ManagedTest {
@Test
- public void testDNSSanity() throws IOException, NamingException {
+ public void dnsSanity() throws IOException, NamingException {
String token = RandomToken.generateToken(16);
String value = RandomToken.generateToken(16);
String token = RandomToken.generateToken(16);
String value = RandomToken.generateToken(16);
- public void testEmailAndDNSSuccess() throws IOException, InterruptedException, SQLException, NamingException {
+ public void emailAndDNSSuccess() throws IOException, InterruptedException, SQLException, NamingException {
testEmailAndDNS(0, 0, true, true);
}
@After
testEmailAndDNS(0, 0, true, true);
}
@After
- public void test() throws SQLException, IOException {
+ public void purgeDbAfterTest() throws SQLException, IOException {
- public void testEmailAndDNSFail() throws IOException, InterruptedException, SQLException, NamingException {
+ public void dnsFail() throws IOException, InterruptedException, SQLException, NamingException {
testEmailAndDNS(1, 0, false, true);
testEmailAndDNS(1, 0, false, true);
+ }
+
+ @Test
+ public void dnsContentFail() throws IOException, InterruptedException, SQLException, NamingException {
testEmailAndDNS(2, 0, false, true);
}
testEmailAndDNS(2, 0, false, true);
}
+ @Test
+ public void emailFail() throws IOException, InterruptedException, SQLException, NamingException {
+ testEmailAndDNS(0, 1, true, false);
+ }
+
+ @Test
+ public void emailAndDNSFail() throws IOException, InterruptedException, SQLException, NamingException {
+ testEmailAndDNS(2, 1, false, false);
+ }
+
public void testEmailAndDNS(int dnsVariant, int emailVariant, boolean successDNS, boolean successMail) throws IOException, InterruptedException, SQLException, NamingException {
String email = createUniqueName() + "@example.org";
createVerifiedUser("a", "b", email, TEST_PASSWORD);
public void testEmailAndDNS(int dnsVariant, int emailVariant, boolean successDNS, boolean successMail) throws IOException, InterruptedException, SQLException, NamingException {
String email = createUniqueName() + "@example.org";
createVerifiedUser("a", "b", email, TEST_PASSWORD);
URL u2 = new URL(u.toString() + m1.group(1));
TestMail mail = getMailReciever().recieve();
URL u2 = new URL(u.toString() + m1.group(1));
TestMail mail = getMailReciever().recieve();
- String link = mail.extractLink();
- new URL(link).openConnection().getHeaderField("");
+ if (emailVariant == 0) {
+ String link = mail.extractLink();
+ new URL(link).openConnection().getHeaderField("");
+ }
PreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT COUNT(*) FROM domainPinglog");
while (true) {
PreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT COUNT(*) FROM domainPinglog");
while (true) {
}
public static void purgeDatabase() throws SQLException, IOException {
}
public static void purgeDatabase() throws SQLException, IOException {
- System.out.println("... purging Database");
+ System.out.print("... purging Database");
+ long ms = System.currentTimeMillis();
try {
DatabaseManager.run(new String[] {
testProps.getProperty("sql.driver"), testProps.getProperty("sql.url"), testProps.getProperty("sql.user"), testProps.getProperty("sql.password")
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();
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
+ System.out.println(" in " + (System.currentTimeMillis() - ms) + " ms");
}
private static Properties generateMainProps() {
}
private static Properties generateMainProps() {