Package com.volantis.impl.mcs.runtime.policies

Examples of com.volantis.impl.mcs.runtime.policies.CachingActivatedPolicyRetriever.retrievePolicy()


        // Fifth request occurs before the retry period is due so should not
        // invoke the retriever.
        clockMock.expects.getCurrentTime().returns(Time.inMilliSeconds(8999));

        actualPolicy = retriever.retrievePolicy(projectMock,
                projectRelativeName);
        assertSame(refreshedPolicy, actualPolicy);

        expectations.verify();
View Full Code Here


                .retrievePolicy(projectMock, projectRelativeName)
                .returns(originalPolicy);

        clockMock.expects.getCurrentTime().returns(Time.inMilliSeconds(12000));

        actualPolicy = retriever.retrievePolicy(projectMock,
                projectRelativeName);
        assertSame(originalPolicy, actualPolicy);
    }

    private VariablePolicyBuilder createOriginalPolicyBuilder(
View Full Code Here

                .retrievePolicy(projectMock, projectRelativeName)
                .returns(null);

        clockMock.expects.getCurrentTime().returns(Time.inMilliSeconds(1000));

        actualPolicy = retriever.retrievePolicy(projectMock,
                projectRelativeName);
        assertNull(actualPolicy);

        expectations.verify();
View Full Code Here

        // ---------------------------------------------------------------------

        // Second request occurs before the policy has expired.
        clockMock.expects.getCurrentTime().returns(Time.inMilliSeconds(1500));

        actualPolicy = retriever.retrievePolicy(projectMock,
                projectRelativeName);
        assertNull(actualPolicy);

        expectations.verify();
View Full Code Here

                .returns(policy);

        // Get the current time for calculating the expiration time.
        clockMock.expects.getCurrentTime().returns(Time.inMilliSeconds(5000));

        actualPolicy = retriever.retrievePolicy(projectMock,
                projectRelativeName);
        assertSame(policy, actualPolicy);
    }
}
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.