Examples of stubs()


Examples of org.jmock.Mock.stubs()

        mockXWiki.stubs().method("getGroupService").will(returnValue(mockGroupService.proxy()));
        mockXWiki.stubs().method("getCacheFactory").will(returnValue(this.cacheFactory));
        mockXWiki.stubs().method("getXWikiPreference").will(returnValue(null));
        mockXWiki.stubs().method("getXWikiPreferenceAsInt").will(throwException(new NumberFormatException("null")));
        mockXWiki.stubs().method("isVirtualMode").will(returnValue(this.isVirtualMode));
        mockXWiki.stubs().method("getDefaultDocumentSyntax").will(returnValue(Syntax.XWIKI_1_0.toIdString()));
        mockXWiki.stubs().method("Param").will(new CustomStub("Implements XWiki.Param")
        {
            public Object invoke(Invocation invocation) throws Throwable
            {
                return properties.getProperty((String) invocation.parameterValues.get(0));
View Full Code Here

Examples of org.jmock.Mock.stubs()

        mockXWiki.stubs().method("getCacheFactory").will(returnValue(this.cacheFactory));
        mockXWiki.stubs().method("getXWikiPreference").will(returnValue(null));
        mockXWiki.stubs().method("getXWikiPreferenceAsInt").will(throwException(new NumberFormatException("null")));
        mockXWiki.stubs().method("isVirtualMode").will(returnValue(this.isVirtualMode));
        mockXWiki.stubs().method("getDefaultDocumentSyntax").will(returnValue(Syntax.XWIKI_1_0.toIdString()));
        mockXWiki.stubs().method("Param").will(new CustomStub("Implements XWiki.Param")
        {
            public Object invoke(Invocation invocation) throws Throwable
            {
                return properties.getProperty((String) invocation.parameterValues.get(0));
            }
View Full Code Here

Examples of org.jmock.Mock.stubs()

            public Object invoke(Invocation invocation) throws Throwable
            {
                return properties.getProperty((String) invocation.parameterValues.get(0));
            }
        });
        mockXWiki.stubs().method("ParamAsLong").will(new CustomStub("Implements XWiki.ParamAsLong")
        {
            public Object invoke(Invocation invocation) throws Throwable
            {
                return Long.parseLong(properties.getProperty((String) invocation.parameterValues.get(0)));
            }
View Full Code Here

Examples of org.jmock.Mock.stubs()

            public Object invoke(Invocation invocation) throws Throwable
            {
                return Long.parseLong(properties.getProperty((String) invocation.parameterValues.get(0)));
            }
        });
        mockXWiki.stubs().method("getDocument").will(new CustomStub("Implements XWiki.getDocument")
        {
            public Object invoke(Invocation invocation) throws Throwable
            {
                Object document = invocation.parameterValues.get(0);
               
View Full Code Here

Examples of org.jmock.Mock.stubs()

                } else {
                    return getDocument((DocumentReference) document);
                }
            }
        });
        mockXWiki.stubs().method("saveDocument").will(new CustomStub("Implements XWiki.saveDocument")
        {
            public Object invoke(Invocation invocation) throws Throwable
            {
                saveDocument((XWikiDocument) invocation.parameterValues.get(0));
View Full Code Here

Examples of org.jmock.Mock.stubs()

                saveDocument((XWikiDocument) invocation.parameterValues.get(0));

                return null;
            }
        });
        mockXWiki.stubs().method("exists").will(new CustomStub("Implements XWiki.exists")
        {
            public Object invoke(Invocation invocation) throws Throwable
            {
                return documentExists((String) invocation.parameterValues.get(0));
            }
View Full Code Here

Examples of org.jmock.Mock.stubs()

            public Object invoke(Invocation invocation) throws Throwable
            {
                return documentExists((String) invocation.parameterValues.get(0));
            }
        });
        mockXWiki.stubs().method("getXClass").will(new CustomStub("Implements XWiki.getClass")
        {
            public Object invoke(Invocation invocation) throws Throwable
            {
                return getDocument(localEntityReferenceSerializer.serialize((EntityReference) invocation.parameterValues.get(0))).getXClass();
            }
View Full Code Here

Examples of org.jmock.Mock.stubs()

            public Object invoke(Invocation invocation) throws Throwable
            {
                return getDocument(localEntityReferenceSerializer.serialize((EntityReference) invocation.parameterValues.get(0))).getXClass();
            }
        });
        mockXWiki.stubs().method("search").will(returnValue(Collections.EMPTY_LIST));

        this.userClass.setName(USER_XCLASS);
        this.userClass.addTextField("first_name", "First Name", 30);
        this.userClass.addTextField("last_name", "Last Name", 30);
        this.userClass.addTextField("email", "e-Mail", 30);
View Full Code Here

Examples of org.jmock.Mock.stubs()

        this.userClass.addTextField("last_name", "Last Name", 30);
        this.userClass.addTextField("email", "e-Mail", 30);
        this.userClass.addPasswordField("password", "Password", 10);
        this.userClass.addTextField("customproperty", "Custom property", 10);

        mockXWiki.stubs().method("getUserClass").will(returnValue(this.userClass));

        this.groupClass.setName(GROUP_XCLASS);
        this.groupClass.addTextField("member", "Member", 30);

        mockXWiki.stubs().method("getGroupClass").will(returnValue(this.groupClass));
View Full Code Here

Examples of org.jmock.Mock.stubs()

        mockXWiki.stubs().method("getUserClass").will(returnValue(this.userClass));

        this.groupClass.setName(GROUP_XCLASS);
        this.groupClass.addTextField("member", "Member", 30);

        mockXWiki.stubs().method("getGroupClass").will(returnValue(this.groupClass));

        mockXWiki.stubs().method("createUser").will(new CustomStub("Implements XWiki.createUser")
        {
            public Object invoke(Invocation invocation) throws Throwable
            {
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.