Package com.volantis.shared.system

Examples of com.volantis.shared.system.SystemClockMock


        time[0] = time[0].addPeriod(Period.inSeconds(-20));
        assertEquals(Period.inSeconds(110), rcd.getTimeToLive());
    }

    public void testExpires() {
        final SystemClockMock clockMock =
            new SystemClockMock("clockMock", expectations);
        final Time[] time =
            new Time[]{Time.inMilliSeconds(System.currentTimeMillis())};
        clockMock.expects.getCurrentTime().does(new MethodAction(){
                public Object perform(final MethodActionEvent event) {
                    return time[0];
View Full Code Here


        time[0] = time[0].addPeriod(Period.inSeconds(-20));
        assertEquals(expires, rcd.getExpires());
    }

    public void testMaxAgeAndExpires() {
        final SystemClockMock clockMock =
            new SystemClockMock("clockMock", expectations);
        final long time = System.currentTimeMillis();
        clockMock.expects.getCurrentTime().returns(
            Time.inMilliSeconds(time)).any();
        final ResponseCachingDirectives rcd =
            new ResponseCachingDirectives(clockMock);
View Full Code Here

        // =====================================================================
        //   Create Mocks
        // =====================================================================

        clockMock = new SystemClockMock("clockMock", expectations);

        policyMock = new ActivatedPolicyMock("policyMock", expectations);

        // =====================================================================
        //   Set Expectations
View Full Code Here

        super.setUp();

        // =====================================================================
        //   Create Mocks
        // =====================================================================
        clockMock = new SystemClockMock("clockMock", expectations);
        policyFactory = PolicyFactory.getDefaultInstance();

        clockMock.expects.getCurrentTime().returns(Time.inMilliSeconds(0));
        clockMock.expects.getCurrentTime().returns(Time.inMilliSeconds(1));
        clockMock.expects.getCurrentTime().returns(Time.inMilliSeconds(2));
View Full Code Here

TOP

Related Classes of com.volantis.shared.system.SystemClockMock

Copyright © 2018 www.massapicom. 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.