protected  ProtocolOcspHttpTest(String name, String reqP, String res) throws Exception { super(name); httpReqPath = reqP; resourceOcsp = res;  HttpUnitOptions.setExceptionsThrownOnErrorStatus(false);   CertTools.installBCProvider();  admin = new Admin(Admin.TYPE_BATCHCOMMANDLINE_USER);  ctx = getInitialContext(); Object obj = ctx.lookup("CAAdminSession"); ICAAdminSessionHome cahome = (ICAAdminSessionHome) javax.rmi.PortableRemoteObject.narrow(obj, ICAAdminSessionHome.class); ICAAdminSessionRemote casession = cahome.create(); setCAID(casession); CAInfo cainfo = casession.getCAInfo(admin, caid); Collection certs = cainfo.getCertificateChain(); if (certs.size() > 0) { Iterator certiter = certs.iterator(); cacert = (X509Certificate) certiter.next(); } else { log.error("NO CACERT for caid " + caid); } obj = ctx.lookup("RSASignSession"); home = (ISignSessionHome) javax.rmi.PortableRemoteObject.narrow(obj, ISignSessionHome.class); remote = home.create(); Object obj2 = ctx.lookup("CertificateStoreSession"); storehome = (ICertificateStoreSessionHome) javax.rmi.PortableRemoteObject.narrow(obj2, ICertificateStoreSessionHome.class); obj = ctx.lookup("UserAdminSession"); IUserAdminSessionHome userhome = (IUserAdminSessionHome) javax.rmi.PortableRemoteObject.narrow(obj, IUserAdminSessionHome.class); usersession = userhome.create();  unknowncacert = CertTools.getCertfromByteArray(unknowncacertBytes);
public ProtocolOcspHttpTest(String name) throws Exception { this(name,"http:
    protected  ProtocolOcspHttpTest(String name, String reqP, String res) throws Exception {        super(name);        httpReqPath = reqP;        resourceOcsp = res;        // We want to get error responses without exceptions        HttpUnitOptions.setExceptionsThrownOnErrorStatus(false);        // Install BouncyCastle provider        CertTools.installBCProvider();        admin = new Admin(Admin.TYPE_BATCHCOMMANDLINE_USER);        ctx = getInitialContext();        Object obj = ctx.lookup("CAAdminSession");        ICAAdminSessionHome cahome = (ICAAdminSessionHome) javax.rmi.PortableRemoteObject.narrow(obj, ICAAdminSessionHome.class);        ICAAdminSessionRemote casession = cahome.create();        setCAID(casession);        CAInfo cainfo = casession.getCAInfo(admin, caid);        Collection certs = cainfo.getCertificateChain();        if (certs.size() > 0) {            Iterator certiter = certs.iterator();            cacert = (X509Certificate) certiter.next();        } else {            log.error("NO CACERT for caid " + caid);        }        obj = ctx.lookup("RSASignSession");        home = (ISignSessionHome) javax.rmi.PortableRemoteObject.narrow(obj, ISignSessionHome.class);        remote = home.create();        Object obj2 = ctx.lookup("CertificateStoreSession");        storehome = (ICertificateStoreSessionHome) javax.rmi.PortableRemoteObject.narrow(obj2, ICertificateStoreSessionHome.class);        obj = ctx.lookup("UserAdminSession");        IUserAdminSessionHome userhome = (IUserAdminSessionHome) javax.rmi.PortableRemoteObject.narrow(obj, IUserAdminSessionHome.class);        usersession = userhome.create();        unknowncacert = CertTools.getCertfromByteArray(unknowncacertBytes);    }