Search in sources :

Example 11 with CertPolicy

use of org.nhind.config.CertPolicy in project nhin-d by DirectProject.

the class ClientProxyCertificatePolicyTest method cleanUp.

@Before
public void cleanUp() throws Exception {
    Domain[] domains = proxy.listDomains(null, 1000);
    int idx = 0;
    Long[] ids;
    if (domains != null)
        for (Domain domain : domains) proxy.removeDomainById(domain.getId());
    CertPolicy[] retrievedPolicies = proxy.getPolicies();
    if (retrievedPolicies != null && retrievedPolicies.length > 0) {
        idx = 0;
        ids = new Long[retrievedPolicies.length];
        for (CertPolicy policy : retrievedPolicies) ids[idx++] = policy.getId();
        proxy.deletePolicies(ids);
    }
    CertPolicyGroup[] retrievedGroups = proxy.getPolicyGroups();
    if (retrievedGroups != null && retrievedGroups.length > 0) {
        idx = 0;
        ids = new Long[retrievedGroups.length];
        for (CertPolicyGroup group : retrievedGroups) ids[idx++] = group.getId();
        proxy.deletePolicyGroups(ids);
    }
}
Also used : CertPolicy(org.nhind.config.CertPolicy) CertPolicyGroup(org.nhind.config.CertPolicyGroup) Domain(org.nhind.config.Domain) Before(org.junit.Before)

Aggregations

CertPolicy (org.nhind.config.CertPolicy)11 CertPolicyGroup (org.nhind.config.CertPolicyGroup)6 Test (org.junit.Test)5 URL (java.net.URL)4 Domain (org.nhind.config.Domain)4 CertPolicyGroupDomainReltn (org.nhind.config.CertPolicyGroupDomainReltn)3 X509Certificate (java.security.cert.X509Certificate)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 Before (org.junit.Before)1 SmtpAgentException (org.nhindirect.gateway.smtp.SmtpAgentException)1 PolicyExpression (org.nhindirect.policy.PolicyExpression)1 PolicyLexicon (org.nhindirect.policy.PolicyLexicon)1 PolicyLexiconParser (org.nhindirect.policy.PolicyLexiconParser)1 PolicyParseException (org.nhindirect.policy.PolicyParseException)1