Package org.ejbca.core.model.approval.approvalrequests

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


        assertTrue(status == 1);

        Approval approval2 = new Approval("ap2test");
        approvalExecutionSessionRemote.approve(admin2, nonExecutableRequest.generateApprovalId(), approval2, gc);

        status = approvalSessionRemote.isApproved(reqadmin, nonExecutableRequest.generateApprovalId());
        assertTrue(status == ApprovalDataVO.STATUS_APPROVED);

        // Test that the approval exipres as it should
        Thread.sleep(5000);
View Full Code Here


        // Test that the approval exipres as it should
        Thread.sleep(5000);

        try {
            status = approvalSessionRemote.isApproved(reqadmin, nonExecutableRequest.generateApprovalId());
            fail("A ApprovalRequestExpiredException should be thrown here");
        } catch (ApprovalRequestExpiredException e) {
        }

        status = approvalSessionRemote.isApproved(reqadmin, nonExecutableRequest.generateApprovalId());
View Full Code Here

            status = approvalSessionRemote.isApproved(reqadmin, nonExecutableRequest.generateApprovalId());
            fail("A ApprovalRequestExpiredException should be thrown here");
        } catch (ApprovalRequestExpiredException e) {
        }

        status = approvalSessionRemote.isApproved(reqadmin, nonExecutableRequest.generateApprovalId());
        assertTrue(status == ApprovalDataVO.STATUS_EXPIREDANDNOTIFIED);

        Collection<ApprovalDataVO> result = approvalSessionRemote.findApprovalDataVO(admin1, nonExecutableRequest.generateApprovalId());
        ApprovalDataVO next = result.iterator().next();
View Full Code Here

        }

        status = approvalSessionRemote.isApproved(reqadmin, nonExecutableRequest.generateApprovalId());
        assertTrue(status == ApprovalDataVO.STATUS_EXPIREDANDNOTIFIED);

        Collection<ApprovalDataVO> result = approvalSessionRemote.findApprovalDataVO(admin1, nonExecutableRequest.generateApprovalId());
        ApprovalDataVO next = result.iterator().next();

        approvalSessionRemote.removeApprovalRequest(admin1, next.getId());

    }
View Full Code Here

    public void testIsApprovedWithSteps() throws Exception {
        DummyApprovalRequest nonExecutableRequest = new DummyApprovalRequest(reqadmin, null, caid, SecConst.EMPTY_ENDENTITYPROFILE, 3, false);
        approvalSessionRemote.addApprovalRequest(reqadmin, nonExecutableRequest, gc);

        int status = approvalSessionRemote.isApproved(reqadmin, nonExecutableRequest.generateApprovalId(), 0);
        assertTrue(status == 2);

        int approvalId = nonExecutableRequest.generateApprovalId();
        Approval approval1 = new Approval("ap1test");
        approvalExecutionSessionRemote.approve(admin1, approvalId, approval1, gc);
View Full Code Here

        approvalSessionRemote.addApprovalRequest(reqadmin, nonExecutableRequest, gc);

        int status = approvalSessionRemote.isApproved(reqadmin, nonExecutableRequest.generateApprovalId(), 0);
        assertTrue(status == 2);

        int approvalId = nonExecutableRequest.generateApprovalId();
        Approval approval1 = new Approval("ap1test");
        approvalExecutionSessionRemote.approve(admin1, approvalId, approval1, gc);

        status = approvalSessionRemote.isApproved(reqadmin, nonExecutableRequest.generateApprovalId(), 0);
        assertTrue(status == 1);
View Full Code Here

        int approvalId = nonExecutableRequest.generateApprovalId();
        Approval approval1 = new Approval("ap1test");
        approvalExecutionSessionRemote.approve(admin1, approvalId, approval1, gc);

        status = approvalSessionRemote.isApproved(reqadmin, nonExecutableRequest.generateApprovalId(), 0);
        assertTrue(status == 1);

        Approval approval2 = new Approval("ap2test");
        approvalExecutionSessionRemote.approve(admin2, approvalId, approval2, gc);
View Full Code Here

        approvalSessionRemote.markAsStepDone(reqadmin, approvalId, 2);

        status = approvalSessionRemote.isApproved(reqadmin, approvalId, 2);
        assertTrue(status == ApprovalDataVO.STATUS_EXPIRED);

        Collection<ApprovalDataVO> result = approvalSessionRemote.findApprovalDataVO(admin1, nonExecutableRequest.generateApprovalId());
        ApprovalDataVO next = result.iterator().next();

        approvalSessionRemote.removeApprovalRequest(admin1, next.getId());

    }
View Full Code Here

        // Then after one of them have expired
        Thread.sleep(5000);

        approvalSessionRemote.addApprovalRequest(admin1, nonExecutableRequest, gc);

        ApprovalDataVO result = approvalSessionRemote.findNonExpiredApprovalRequest(admin1, nonExecutableRequest.generateApprovalId());
        assertNotNull(result);
        assertTrue(result.getStatus() == ApprovalDataVO.STATUS_WAITINGFORAPPROVAL);

        Collection<ApprovalDataVO> all = approvalSessionRemote.findApprovalDataVO(admin1, nonExecutableRequest.generateApprovalId());
        Iterator<ApprovalDataVO> iter = all.iterator();
View Full Code Here

        ApprovalDataVO result = approvalSessionRemote.findNonExpiredApprovalRequest(admin1, nonExecutableRequest.generateApprovalId());
        assertNotNull(result);
        assertTrue(result.getStatus() == ApprovalDataVO.STATUS_WAITINGFORAPPROVAL);

        Collection<ApprovalDataVO> all = approvalSessionRemote.findApprovalDataVO(admin1, nonExecutableRequest.generateApprovalId());
        Iterator<ApprovalDataVO> iter = all.iterator();
        while (iter.hasNext()) {
            ApprovalDataVO next = iter.next();
            approvalSessionRemote.removeApprovalRequest(admin1, next.getId());
        }
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.