package org.cacert.gigi.ping;
import static org.junit.Assert.*;
+import static org.junit.Assume.*;
import java.io.IOException;
import java.net.Socket;
import org.cacert.gigi.GigiApiException;
import org.cacert.gigi.dbObjects.Certificate;
-import org.cacert.gigi.dbObjects.CertificateProfile;
import org.cacert.gigi.dbObjects.Certificate.CSRType;
+import org.cacert.gigi.dbObjects.CertificateProfile;
+import org.cacert.gigi.dbObjects.User;
import org.cacert.gigi.pages.account.domain.DomainOverview;
import org.cacert.gigi.testUtils.IOUtils;
import org.cacert.gigi.testUtils.PingTest;
private Certificate c;
- @Test
+ @Test(timeout = 70000)
public void sslAndMailSuccess() throws IOException, InterruptedException, SQLException, GeneralSecurityException, GigiApiException {
testEmailAndSSL(0, 0, true);
}
- @Test
+ @Test(timeout = 70000)
public void sslWongTypeAndMailSuccess() throws IOException, InterruptedException, SQLException, GeneralSecurityException, GigiApiException {
testEmailAndSSL(1, 0, true);
}
- @Test
+ @Test(timeout = 70000)
public void sslOneMissingAndMailSuccess() throws IOException, InterruptedException, SQLException, GeneralSecurityException, GigiApiException {
testEmailAndSSL(2, 0, true);
}
- @Test
+ @Test(timeout = 70000)
public void sslBothMissingAndMailSuccess() throws IOException, InterruptedException, SQLException, GeneralSecurityException, GigiApiException {
testEmailAndSSL(3, 0, true);
}
- @Test
+ @Test(timeout = 70000)
public void sslWrongTypeAndMailFail() throws IOException, InterruptedException, SQLException, GeneralSecurityException, GigiApiException {
testEmailAndSSL(1, 1, false);
}
private void testEmailAndSSL(int sslVariant, int emailVariant, boolean successMail) throws IOException, InterruptedException, SQLException, GeneralSecurityException, GigiApiException {
String test = getTestProps().getProperty("domain.local");
-
+ assumeNotNull(test);
URL u = new URL("https://" + getServerName() + DomainOverview.PATH);
initailizeDomainForm(u);
private void createCertificate(String test, CertificateProfile profile) throws GeneralSecurityException, IOException, SQLException, InterruptedException, GigiApiException {
kp = generateKeypair();
String csr = generatePEMCSR(kp, "CN=" + test);
- c = new Certificate(userid, "/CN=" + test, "sha256", csr, CSRType.CSR, profile);
+ c = new Certificate(User.getById(id), Certificate.buildDN("CN", test), "sha256", csr, CSRType.CSR, profile);
c.issue(null, "2y").waitFor(60000);
}