Package org.jmock.api

Examples of org.jmock.api.Action


            one(standardOutputCaptureMock).start();
            inSequence(sequence);

            one(scriptMock).run();
            inSequence(sequence);
            will(doAll(new Action() {
                public void describeTo(Description description) {
                    description.appendValue("check context classloader");
                }

                public Object invoke(Invocation invocation) throws Throwable {
View Full Code Here


            allowing(configuration);
            will(returnValue(transitive));
            one(resolvedConfiguration).getFiles(Specs.SATISFIES_ALL);
            will(returnValue(toSet(configFile)));
            one(dependency).resolve(with(notNullValue(DependencyResolveContext.class)));
            will(new Action() {
                public void describeTo(Description description) {
                    description.appendText("add files to context");
                }

                public Object invoke(Invocation invocation) throws Throwable {
View Full Code Here

        <T> void withParam(Matcher<T> matcher) {
            this.with(matcher);
        }

        void will(final Closure cl) {
            will(new Action() {
                public void describeTo(Description description) {
                    description.appendText("execute closure");
                }

                public Object invoke(Invocation invocation) throws Throwable {
View Full Code Here

        walker.start(root.getMock());
    }

    private Action stopVisiting() {
        return new Action() {
            public void describeTo(Description description) {
                description.appendText("stop visiting");
            }

            public Object invoke(Invocation invocation) throws Throwable {
View Full Code Here

            allowing(details).getLastModified();
            will(returnValue(1000L));

            allowing(details).copyTo(with(notNullValue(OutputStream.class)));
            will(new Action() {
                public void describeTo(Description description) {
                    description.appendText("write content");
                }

                public Object invoke(Invocation invocation) throws Throwable {
View Full Code Here

            allowing(details).getLastModified();
            will(returnValue(1000L));

            allowing(details).copyTo(with(notNullValue(OutputStream.class)));
            will(new Action() {
                public void describeTo(Description description) {
                    description.appendText("write content");
                }

                public Object invoke(Invocation invocation) throws Throwable {
View Full Code Here

            allowing(details).getSize();
            will(returnValue((long)content.getBytes().length));

            allowing(details).copyTo(with(notNullValue(OutputStream.class)));
            will(new Action() {
                public void describeTo(Description description) {
                    description.appendText("write content");
                }

                public Object invoke(Invocation invocation) throws Throwable {
View Full Code Here

            allowing(details).getSize();
            will(returnValue(1000L));

            allowing(details).copyTo(with(notNullValue(OutputStream.class)));
            will(new Action() {
                public void describeTo(Description description) {
                    description.appendText("write content");
                }

                public Object invoke(Invocation invocation) throws Throwable {
View Full Code Here

            allowing(project).relativeProjectPath(':' + name);
            will(returnValue(name));
            allowing(task).getGroup();
            will(returnValue(taskGroup));
            allowing(task).compareTo(with(Matchers.notNullValue(Task.class)));
            will(new Action() {
                public Object invoke(Invocation invocation) throws Throwable {
                    Task other = (Task) invocation.getParameter(0);
                    return name.compareTo(other.getName());
                }
View Full Code Here

            will(returnValue(null));

            ignoring(testDescriptor);

            one(testExecuterMock).execute(with(sameInstance(test)), with(notNullValue(TestListenerAdapter.class)));
            will(new Action() {
                public void describeTo(Description description) {
                    description.appendText("fail tests");
                }

                public Object invoke(Invocation invocation) throws Throwable {
View Full Code Here

TOP

Related Classes of org.jmock.api.Action

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.