Examples of InvokeOnceMatcher


Examples of org.jmock.core.matcher.InvokeOnceMatcher

*/
public class CreateSessionInterceptorTest extends StrutsInternalTestCase {

    public void testCreateSession() throws Exception {
        Mock httpServletRequestMock = new Mock(HttpServletRequest.class);
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.FALSE));
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.TRUE));
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.FALSE));
        HttpServletRequest request = (HttpServletRequest) httpServletRequestMock.proxy();

        ServletActionContext.setRequest(request);

        CreateSessionInterceptor interceptor = new CreateSessionInterceptor();
View Full Code Here

Examples of org.jmock.core.matcher.InvokeOnceMatcher

* @author <a href="mailto:dguy@thoughtworks.com">Damian Guy</a>
*
*/
public abstract class JMockSugar {
    protected InvocationMatcher once() {
        return new InvokeOnceMatcher();
    }
View Full Code Here

Examples of org.jmock.core.matcher.InvokeOnceMatcher

        // Test same remove but via entity
        windowAccess.removeWindow(window);             
             
        assertNotNull(windowAccess.getPortletWindow(f1));               
       
        windowListMock.expects(new InvokeOnceMatcher()).method("iterator").withNoArguments().will(new ReturnStub(windows.iterator()));
       
        windowAccess.removeWindows(entity)
       
        windowAccess.getPortletWindow(f1);
        // Double that second call bypasses creating a new window
View Full Code Here

Examples of org.jmock.core.matcher.InvokeOnceMatcher

*/
public class CreateSessionInterceptorTest extends StrutsTestCase {

  public void testCreateSession() throws Exception {
    Mock httpServletRequestMock = new Mock(HttpServletRequest.class);
    httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.TRUE));
    HttpServletRequest request = (HttpServletRequest) httpServletRequestMock.proxy();

    ServletActionContext.setRequest(request);

    CreateSessionInterceptor interceptor = new CreateSessionInterceptor();
View Full Code Here

Examples of org.jmock.core.matcher.InvokeOnceMatcher

        // Test same remove but via entity
        windowAccess.removeWindow(window);             

        assertNotNull(windowAccess.getPortletWindow(f1));               
       
        windowListMock.expects(new InvokeOnceMatcher()).method("iterator").withNoArguments().will(new ReturnStub(windows.iterator()));

/*       
        windowAccess.removeWindows(entity); 
       
        windowAccess.getPortletWindow(f1);
View Full Code Here

Examples of org.jmock.core.matcher.InvokeOnceMatcher

        Mock scmProviderMock = new Mock( ScmProvider.class );
        Constraint[] arguments =
            new Constraint[]{new IsAnything(), new IsScmFileSetEquals( fileSet ), new IsEqual( "release-label" ),
                new IsScmTagParamtersEquals( new ScmTagParameters( "[my prefix] copy for tag release-label" ) )};
        scmProviderMock
            .expects( new InvokeOnceMatcher() )
            .method( "tag" )
            .with( arguments )
            .will( new ReturnStub( new TagScmResult( "...", Collections.singletonList( new ScmFile( getPath (rootProject
                       .getFile() ), ScmFileStatus.TAGGED ) ) ) ) );
View Full Code Here

Examples of org.jmock.core.matcher.InvokeOnceMatcher

        Constraint[] arguments = new Constraint[]{new IsEqual( repository ), new IsScmFileSetEquals( fileSet ),
            new IsEqual( "release-label" ),
            new IsScmTagParamtersEquals( new ScmTagParameters( "[my prefix] copy for tag release-label" ) )};
       
        scmProviderMock
            .expects( new InvokeOnceMatcher() )
            .method( "tag" )
            .with( arguments )
            .will( new ReturnStub( new TagScmResult( "...", Collections.singletonList( new ScmFile( getPath (rootProject
                       .getFile() ), ScmFileStatus.TAGGED ) ) ) ) );
View Full Code Here

Examples of org.jmock.core.matcher.InvokeOnceMatcher

        ScmRepository repository = new ScmRepository( "svn", scmProviderRepository );
        Constraint[] arguments = new Constraint[]{new IsEqual( repository ), new IsScmFileSetEquals( fileSet ),
            new IsEqual( "release-label" ),
            new IsScmTagParamtersEquals( new ScmTagParameters( "[my prefix] copy for tag release-label" ) )};
        scmProviderMock
            .expects( new InvokeOnceMatcher() )
            .method( "tag" )
            .with( arguments )
            .will( new ReturnStub( new TagScmResult( "...", Collections.singletonList( new ScmFile( getPath (rootProject
                       .getFile() ), ScmFileStatus.TAGGED ) ) ) ) );
View Full Code Here

Examples of org.jmock.core.matcher.InvokeOnceMatcher

        Mock scmProviderMock = new Mock( ScmProvider.class );
        Constraint[] arguments =
            new Constraint[]{new IsAnything(), new IsScmFileSetEquals( fileSet ), new IsEqual( "release-label" ),
                new IsScmTagParamtersEquals( new ScmTagParameters( "[my prefix] copy for tag release-label" ) )};
        scmProviderMock
            .expects( new InvokeOnceMatcher() )
            .method( "tag" )
            .with( arguments )
            .will( new ReturnStub( new TagScmResult( "...", Collections.singletonList( new ScmFile( getPath( rootProject
                       .getFile() ), ScmFileStatus.TAGGED ) ) ) ) );
View Full Code Here

Examples of org.jmock.core.matcher.InvokeOnceMatcher

    {
        List<MavenProject> reactorProjects = createReactorProjects();
        ReleaseDescriptor releaseDescriptor = createReleaseDescriptor();

        Mock scmManagerMock = new Mock( ScmManager.class );
        scmManagerMock.expects( new InvokeOnceMatcher() ).method( "makeScmRepository" ).with(
            new IsEqual( "scm-url" ) ).will( new ThrowStub( new NoSuchScmProviderException( "..." ) ) );

        ScmManager scmManager = (ScmManager) scmManagerMock.proxy();
        DefaultScmRepositoryConfigurator configurator =
            (DefaultScmRepositoryConfigurator) lookup( ScmRepositoryConfigurator.ROLE );
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.