Examples of generateApprovalId()


Examples of org.ejbca.core.model.approval.ApprovalRequest.generateApprovalId()

            genTokenCertificates(true);
            assertTrue(false);
        } catch (WaitingForApprovalException_Exception e) {
        }

        approvalSession.reject(admin1, ar.generateApprovalId(), approval1, gc);

        try {
            genTokenCertificates(true);
            assertTrue(false);
        } catch (ApprovalRequestExecutionException_Exception e) {
View Full Code Here

Examples of org.ejbca.core.model.approval.ApprovalRequest.generateApprovalId()

    public void test05CleanGenTokenCertificatesWithApprovals() throws Exception {
        setupApprovals();
        ApprovalRequest ar = new GenerateTokenApprovalRequest("WSTESTTOKENUSER1", "CN=WSTESTTOKENUSER1", HardToken.LABEL_PROJECTCARD, reqadmin, null, 1, 0, 0);

        Collection<ApprovalDataVO> result = approvalSession.findApprovalDataVO(intAdmin, ar.generateApprovalId());
        Iterator<ApprovalDataVO> iter = result.iterator();
        while (iter.hasNext()) {
            ApprovalDataVO next = iter.next();
            approvalSession.removeApprovalRequest(admin1, next.getId());
        }
View Full Code Here

Examples of org.ejbca.core.model.approval.ApprovalRequest.generateApprovalId()

            approvalSession.removeApprovalRequest(admin1, next.getId());
        }

        ar = new ViewHardTokenDataApprovalRequest("WSTESTTOKENUSER1", "CN=WSTESTTOKENUSER1", "12345678", true, reqadmin, null, 1, 0, 0);

        result = approvalSession.findApprovalDataVO(intAdmin, ar.generateApprovalId());
        iter = result.iterator();
        while (iter.hasNext()) {
            ApprovalDataVO next = iter.next();
            approvalSession.removeApprovalRequest(admin1, next.getId());
        }
View Full Code Here

Examples of org.ejbca.core.model.approval.approvalrequests.AddEndEntityApprovalRequest.generateApprovalId()

    log.trace(">storeUserData() username : " + userdata.getUsername());

        // First we will look to see if there is an existing approval request pending for this user within the last hour
    EditEndEntityApprovalRequest ear = new EditEndEntityApprovalRequest(userdata, clearpwd, userdata, admin,null,1,userdata.getCAId(),userdata.getEndEntityProfileId());
        AddEndEntityApprovalRequest aar = new AddEndEntityApprovalRequest(userdata,clearpwd,admin,null,1,userdata.getCAId(),userdata.getEndEntityProfileId());
        int approvalid = aar.generateApprovalId();
    // Check if user already exists
        if (userAdminSession.existsUser(admin, userdata.getUsername())) {
          // a user already exists, so this is an edit entity request we are preparing
          log.debug("User already exist, we will look for an edit end entity request");
          approvalid = ear.generateApprovalId();
View Full Code Here

Examples of org.ejbca.core.model.approval.approvalrequests.DummyApprovalRequest.generateApprovalId()

  public void testGenerateApprovalId() throws Exception {
    Certificate testcert = CertTools.getCertfromByteArray(testcertenc);
    DummyApprovalRequest ar = new DummyApprovalRequest(new Admin(testcert, null, null),null,1,2, false);
   
      int id1 = ar.generateApprovalId();
      int id2 = ar.generateApprovalId();
      assertEquals(id1, id2);
  }

  public void setUp() throws Exception {   
View Full Code Here

Examples of org.ejbca.core.model.approval.approvalrequests.DummyApprovalRequest.generateApprovalId()

  public void testGenerateApprovalId() throws Exception {
    Certificate testcert = CertTools.getCertfromByteArray(testcertenc);
    DummyApprovalRequest ar = new DummyApprovalRequest(new Admin(testcert, null, null),null,1,2, false);
   
      int id1 = ar.generateApprovalId();
      int id2 = ar.generateApprovalId();
      assertEquals(id1, id2);
  }

  public void setUp() throws Exception {   
    super.setUp();
View Full Code Here

Examples of org.ejbca.core.model.approval.approvalrequests.DummyApprovalRequest.generateApprovalId()

    public void testAddApprovalRequest() throws Exception {

        DummyApprovalRequest nonExecutableRequest = new DummyApprovalRequest(reqadmin, null, caid, SecConst.EMPTY_ENDENTITYPROFILE, false);

        // Test that the approvalrequest doesn't exists.
        Collection<ApprovalDataVO> result = approvalSessionRemote.findApprovalDataVO(admin1, nonExecutableRequest.generateApprovalId());
        assertTrue(result.size() == 0);
        approvalSessionRemote.addApprovalRequest(admin1, nonExecutableRequest, gc);

        // Test that the approvalRequest exists now
        result = approvalSessionRemote.findApprovalDataVO(admin1, nonExecutableRequest.generateApprovalId());
View Full Code Here

Examples of org.ejbca.core.model.approval.approvalrequests.DummyApprovalRequest.generateApprovalId()

        Collection<ApprovalDataVO> result = approvalSessionRemote.findApprovalDataVO(admin1, nonExecutableRequest.generateApprovalId());
        assertTrue(result.size() == 0);
        approvalSessionRemote.addApprovalRequest(admin1, nonExecutableRequest, gc);

        // Test that the approvalRequest exists now
        result = approvalSessionRemote.findApprovalDataVO(admin1, nonExecutableRequest.generateApprovalId());
        assertTrue(result.size() == 1);

        ApprovalDataVO next = result.iterator().next();
        assertTrue("Status = " + next.getStatus(), next.getStatus() == ApprovalDataVO.STATUS_WAITINGFORAPPROVAL);
        assertTrue(next.getCAId() == caid);
View Full Code Here

Examples of org.ejbca.core.model.approval.approvalrequests.DummyApprovalRequest.generateApprovalId()

        assertTrue("Status = " + next.getStatus(), next.getStatus() == ApprovalDataVO.STATUS_WAITINGFORAPPROVAL);
        assertTrue(next.getCAId() == caid);
        assertTrue(next.getEndEntityProfileiId() == SecConst.EMPTY_ENDENTITYPROFILE);
        assertTrue(next.getReqadmincertissuerdn().equals(CertTools.getIssuerDN(reqadmincert)));
        assertTrue(next.getReqadmincertsn().equals(CertTools.getSerialNumberAsString(reqadmincert)));
        assertTrue(next.getApprovalId() == nonExecutableRequest.generateApprovalId());
        assertTrue(next.getApprovalType() == nonExecutableRequest.getApprovalType());
        assertTrue(next.getApprovals().size() == 0);
        assertTrue(!next.getApprovalRequest().isExecutable());
        assertTrue(next.getRemainingApprovals() == 2);
View Full Code Here

Examples of org.ejbca.core.model.approval.approvalrequests.DummyApprovalRequest.generateApprovalId()

        assertTrue(!next.getApprovalRequest().isExecutable());
        assertTrue(next.getRemainingApprovals() == 2);

        // Test that the request expires as it should
        Thread.sleep(5000);
        result = approvalSessionRemote.findApprovalDataVO(admin1, nonExecutableRequest.generateApprovalId());
        assertTrue(result.size() == 1);

        next = (ApprovalDataVO) result.iterator().next();
        assertTrue("Status = " + next.getStatus(), next.getStatus() == ApprovalDataVO.STATUS_EXPIRED);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.