Package com.volantis.testtools.mock.method

Examples of com.volantis.testtools.mock.method.MethodAction


        stylerContextMock.expects.getStyles()
                .returns(stylesMock).any();


        // Create an action that will invoke the iteratee's next method.
        final MethodAction iteratorAction = new MethodAction() {

            public Object perform(MethodActionEvent event)
                    throws Throwable {

                StylerIteratee iteratee = (StylerIteratee) event.getArgument(
                        StylerIteratee.class);
                assertEquals(IterationAction.CONTINUE,
                        iteratee.next(stylerMock));

                return null;
            }
        };

        // Create an action that will check that the matcher context and
        // styles is being passed through correctly.
        final MethodAction styleAction = new MethodAction() {
            public Object perform(MethodActionEvent event)
                    throws Throwable {
                StandardStylerContext context = (StandardStylerContext) event.getArgument(
                        StandardStylerContext.class);
                assertSame("Styler context", context, stylerContextMock);
View Full Code Here


            final int expectedEventType) {
        listenerMock.fuzzy
                .configurationEvent(mockFactory.expectsInstanceOf(
                        ConfigurationEvent.class))
                .description(description + ": configurationEvent")
                .does(new MethodAction() {
                    public Object perform(MethodActionEvent event)
                            throws Throwable {
                        ConfigurationEvent ce =
                                (ConfigurationEvent) event.getArgument(
                                        ConfigurationEvent.class);
View Full Code Here

                                "(objectClass=org.osgi.service.cm.ManagedServiceFactory)" +
                                "(objectClass=org.osgi.service.cm.ConfigurationPlugin))")
                .returns(filterMock);

        contextMock.fuzzy.addServiceListener(mockFactory.expectsInstanceOf(
                ServiceListener.class), null).does(new MethodAction() {
            public Object perform(MethodActionEvent event) throws Throwable {
                trackerListener = (ServiceListener)
                        event.getArgument(ServiceListener.class);
                return null;
            }
View Full Code Here

        final CacheBodyOperationProcess[] cacheBodyOperationProcess =
            new CacheBodyOperationProcess[1];

        dynamicProcessMock.fuzzy.addProcess(mockFactory.expectsInstanceOf(
            CacheBodyOperationProcess.class)).does(new MethodAction() {
                public Object perform(final MethodActionEvent event)
                        throws Throwable {
                    cacheBodyOperationProcess[0] =
                        (CacheBodyOperationProcess) event.getArguments()[0];
                    return null;
View Full Code Here

    public void testExpiryModeNoExpiryModeAttrNoKeyAttr() throws Exception {

        final CacheProperties[] cacheProperties = new CacheProperties[1];

        contextMock.fuzzy.pushObject(mockFactory.expectsInstanceOf(
            CacheProperties.class), Boolean.FALSE).does(new MethodAction() {
                public Object perform(final MethodActionEvent event)
                        throws Throwable {
                    cacheProperties[0] =
                        (CacheProperties) event.getArguments()[0];
                    return null;
View Full Code Here

    public void testExpiryModeNoExpiryModeAttrNoKeyAttr2() throws Exception {

        final CacheProperties[] cacheProperties = new CacheProperties[1];

        contextMock.fuzzy.pushObject(mockFactory.expectsInstanceOf(
            CacheProperties.class), Boolean.FALSE).does(new MethodAction() {
                public Object perform(final MethodActionEvent event)
                        throws Throwable {
                    cacheProperties[0] = (CacheProperties) event.getArguments()[0];
                    return null;
                }
View Full Code Here

    public void testExpiryModeNoKeyAttrFixedAge() throws Exception {

        final CacheProperties[] cacheProperties = new CacheProperties[1];

        contextMock.fuzzy.pushObject(mockFactory.expectsInstanceOf(
            CacheProperties.class), Boolean.FALSE).does(new MethodAction() {
                public Object perform(final MethodActionEvent event)
                        throws Throwable {
                    cacheProperties[0] = (CacheProperties) event.getArguments()[0];
                    return null;
                }
View Full Code Here

    public void testExpiryModeNoKeyAttrAuto() throws Exception {

        final CacheProperties[] cacheProperties = new CacheProperties[1];

        contextMock.fuzzy.pushObject(mockFactory.expectsInstanceOf(
            CacheProperties.class), Boolean.FALSE).does(new MethodAction() {
                public Object perform(final MethodActionEvent event)
                        throws Throwable {
                    cacheProperties[0] = (CacheProperties) event.getArguments()[0];
                    return null;
                }
View Full Code Here

        // create a system clock mock
        final long[] timeShift = new long[1];
        timeShift[0] = 0;
        final SystemClockMock clock = new SystemClockMock("clock", expectations);
        clock.expects.getCurrentTime().does(new MethodAction() {
            public Object perform(MethodActionEvent event) throws Throwable {
                return Time.inMilliSeconds(
                    System.currentTimeMillis() + timeShift[0]);
            }
        }).any();
View Full Code Here

        // create a system clock mock
        final long[] timeShift = new long[1];
        timeShift[0] = 0;
        final SystemClockMock clock = new SystemClockMock("clock", expectations);
        clock.expects.getCurrentTime().does(new MethodAction() {
            public Object perform(MethodActionEvent event) throws Throwable {
                return Time.inMilliSeconds(
                    System.currentTimeMillis() + timeShift[0]);
            }
        }).any();
View Full Code Here

TOP

Related Classes of com.volantis.testtools.mock.method.MethodAction

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.