Examples of retrievePolicy()


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

        // Get the policy, this should invoke the underlying retriever.
        actualPolicy = retriever.retrievePolicy(projectMock, projectRelativeName);
        assertSame(policy, actualPolicy);

        // Get the policy, this should get the policy from the cache.
        actualPolicy = retriever.retrievePolicy(projectMock, projectRelativeName);
        assertSame(policy, actualPolicy);

        // Make sure that the object was stored in the cache.
        Object object = policyCache.retrieve(remoteName, providerMock);
        assertSame(policy, object);
View Full Code Here

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

        ActivatedPolicyRetriever retriever =
                new CachingActivatedPolicyRetriever(policyCache, retrieverMock);
        ActivatedPolicy policy;

        // Get the policy, this should invoke the underlying retriever.
        policy = retriever.retrievePolicy(projectMock, projectRelativeName);
        assertNull(policy);

        // Get the policy, this should get the policy from the cache.
        policy = retriever.retrievePolicy(projectMock, projectRelativeName);
        assertNull(policy);
View Full Code Here

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

        // Get the policy, this should invoke the underlying retriever.
        policy = retriever.retrievePolicy(projectMock, projectRelativeName);
        assertNull(policy);

        // Get the policy, this should get the policy from the cache.
        policy = retriever.retrievePolicy(projectMock, projectRelativeName);
        assertNull(policy);
    }

    /**
     * Ensure that the caching retriever works properly.
View Full Code Here

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

                .returns(originalPolicy);

        // The current time for the calculation of the expiration time.
        clockMock.expects.getCurrentTime().returns(Time.inMilliSeconds(1000));

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

        expectations.verify();
View Full Code Here

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

        // expired so is returned without invoking the provider.

        // The current time used to determine whether the policy has expired.
        clockMock.expects.getCurrentTime().returns(Time.inMilliSeconds(1500));

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

        expectations.verify();
View Full Code Here

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

        // retrieved policy. This is different to the above as it will
        // happen after the provider has returned the policy which will be
        // some time afterwards.
        clockMock.expects.getCurrentTime().returns(Time.inMilliSeconds(3000));

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

        expectations.verify();
View Full Code Here

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

        // Get the time after the retriever has failed to return a policy so
        // that it can calculate the expiry time for the retry.
        clockMock.expects.getCurrentTime().returns(Time.inMilliSeconds(8000));

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

        expectations.verify();
View Full Code Here

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

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

                .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

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

                .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
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.