Examples of MethodAction


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

        dependencies = new Dependency[1];
        pipelineContextMock.expects.getDependencyContext().returns(
            dependencyContextMock).any();
        final MockFactory mockFactory = MockFactory.getDefaultInstance();
        dependencyContextMock.fuzzy.addDependency(
            mockFactory.expectsAny()).does(new MethodAction() {
                public Object perform(MethodActionEvent event) throws Throwable {
                    assertNull(dependencies[0]);
                    dependencies[0] = (Dependency) event.getArguments()[0];
                    return null;
                }
View Full Code Here

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

        deltaMock.expects.iterator().returns(deltaStylerList.iterator());
        listMock.expects.listIterator().returns(listStylerList.listIterator());
        // dodgy merge adds them back in again.
        listMock.fuzzy.append(mockFactory.expectsInstanceOf(Styler.class))
                .does(new MethodAction() {
                    public Object perform(MethodActionEvent event)
                            throws Throwable {
                        listStylerList.add(event.getArgument(Styler.class));
                        return null;
                    }
View Full Code Here

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

        deviceMock.expects.getName().returns("mock").any();

        deviceMock.expects.getProtocolConfiguration().returns(null);
        deviceMock.fuzzy.setProtocolConfiguration(
                mockFactory.expectsInstanceOf(ProtocolConfiguration.class))
                .does(new MethodAction() {

                    public Object perform(MethodActionEvent event)
                            throws Throwable {
                        configuration = (ProtocolConfiguration)
                                event.getArgument(Object.class);
View Full Code Here

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

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

            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

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

                                "(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

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

        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

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

    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

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

    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

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

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