Package org.jmock.core.matcher

Examples of org.jmock.core.matcher.InvokeOnceMatcher


        releaseDescriptor.setWorkingDirectory( getTestFile( "target/working-directory" ).getAbsolutePath() );

        DefaultReleaseManager releaseManager = (DefaultReleaseManager) lookup( ReleaseManager.ROLE, "test" );

        Mock configStoreMock = new Mock( ReleaseDescriptorStore.class );
        configStoreMock.expects( new InvokeOnceMatcher() ).method( "read" ).with(
            new IsSame( releaseDescriptor ) ).will(
            new ThrowStub( new ReleaseDescriptorStoreException( "message", new IOException( "ioExceptionMsg" ) ) ) );

        releaseManager.setConfigStore( (ReleaseDescriptorStore) configStoreMock.proxy() );
View Full Code Here


        releaseDescriptor.setWorkingDirectory( getTestFile( "target/working-directory" ).getAbsolutePath() );

        DefaultReleaseManager releaseManager = (DefaultReleaseManager) lookup( ReleaseManager.ROLE, "test" );

        Mock configStoreMock = new Mock( ReleaseDescriptorStore.class );
        configStoreMock.expects( new InvokeOnceMatcher() ).method( "write" ).with(
            new IsSame( releaseDescriptor ) ).will(
            new ThrowStub( new ReleaseDescriptorStoreException( "message", new IOException( "ioExceptionMsg" ) ) ) );

        releaseManager.setConfigStore( (ReleaseDescriptorStore) configStoreMock.proxy() );
View Full Code Here

        releaseDescriptor.setWorkingDirectory( getTestFile( "target/working-directory" ).getAbsolutePath() );

        DefaultReleaseManager releaseManager = (DefaultReleaseManager) lookup( ReleaseManager.ROLE, "test" );

        Mock configStoreMock = new Mock( ReleaseDescriptorStore.class );
        configStoreMock.expects( new InvokeOnceMatcher() ).method( "delete" );

        releaseManager.setConfigStore( (ReleaseDescriptorStore) configStoreMock.proxy() );

        releaseManager.clean( releaseDescriptor, null, null );
View Full Code Here

        releaseDescriptor.setCheckoutDirectory( checkoutDirectory.getAbsolutePath() );

        Mock mock = new Mock( MavenExecutor.class );
        Constraint[] constraints = new Constraint[]{new IsSame( checkoutDirectory ), new IsEqual( "goal1 goal2" ),
            new IsEqual( Boolean.TRUE ), new IsEqual( "-DperformRelease=true" ), new IsNull(), new IsAnything()};
        mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( constraints );
        RunPerformGoalsPhase phase = (RunPerformGoalsPhase) lookup( ReleasePhase.ROLE, "run-perform-goals" );
        phase.setMavenExecutor( (MavenExecutor) mock.proxy() );

        Mock scmProviderMock = new Mock( ScmProvider.class );
        constraints = new Constraint[]{new IsAnything(), new IsScmFileSetEquals( new ScmFileSet( checkoutDirectory ) ),
            new IsInstanceOf( ScmTag.class )};
        scmProviderMock.expects( new InvokeOnceMatcher() ).method( "checkOut" ).with( constraints ).will(
            new ReturnStub( new CheckOutScmResult( "...", Collections.<ScmFile>emptyList() ) ) );

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( (ScmProvider) scmProviderMock.proxy() );
View Full Code Here

        releaseDescriptor.setCheckoutDirectory( checkoutDirectory.getAbsolutePath() );

        Mock mock = new Mock( MavenExecutor.class );
        Constraint[] constraints = new Constraint[]{new IsSame( checkoutDirectory ), new IsEqual( "goal1 goal2" ),
            new IsEqual( Boolean.TRUE ), new IsNull(), new IsNull(), new IsAnything()};
        mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( constraints );
        RunPerformGoalsPhase phase = (RunPerformGoalsPhase) lookup( ReleasePhase.ROLE, "run-perform-goals" );
        phase.setMavenExecutor( (MavenExecutor) mock.proxy() );

        Mock scmProviderMock = new Mock( ScmProvider.class );
        constraints = new Constraint[]{new IsAnything(), new IsScmFileSetEquals( new ScmFileSet( checkoutDirectory ) ),
            new IsInstanceOf( ScmTag.class )};
        scmProviderMock.expects( new InvokeOnceMatcher() ).method( "checkOut" ).with( constraints ).will(
            new ReturnStub( new CheckOutScmResult( "...", Collections.<ScmFile>emptyList() ) ) );

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( (ScmProvider) scmProviderMock.proxy() );
View Full Code Here

        Mock mock = new Mock( MavenExecutor.class );
        Constraint[] constraints = new Constraint[]{new IsSame( checkoutDirectory ), new IsEqual( "goal1 goal2" ),
            new IsEqual( Boolean.TRUE ), new IsEqual( "-Dmaven.test.skip=true -DperformRelease=true" ), new IsNull(),
            new IsAnything()};
        mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( constraints );
        RunPerformGoalsPhase phase = (RunPerformGoalsPhase) lookup( ReleasePhase.ROLE, "run-perform-goals" );
        phase.setMavenExecutor( (MavenExecutor) mock.proxy() );

        Mock scmProviderMock = new Mock( ScmProvider.class );
        constraints = new Constraint[]{new IsAnything(), new IsScmFileSetEquals( new ScmFileSet( checkoutDirectory ) ),
            new IsInstanceOf( ScmTag.class )};
        scmProviderMock.expects( new InvokeOnceMatcher() ).method( "checkOut" ).with( constraints ).will(
            new ReturnStub( new CheckOutScmResult( "...", Collections.<ScmFile>emptyList() ) ) );

        ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
        stub.setScmProvider( (ScmProvider) scmProviderMock.proxy() );
View Full Code Here

        ScmFileSet fileSet = new ScmFileSet( rootProject.getFile().getParentFile(), rootProject.getFile() );
        Mock scmProviderMock = new Mock( ScmProvider.class );
        Constraint[] arguments = new Constraint[]{new IsAnything(), new IsScmFileSetEquals( fileSet ), new IsNull(),
            new IsEqual( message )};
        scmProviderMock
            .expects( new InvokeOnceMatcher() )
            .method( "checkIn" )
            .with( arguments )
            .will( new ReturnStub( new CheckInScmResult( "...", Collections.singletonList( new ScmFile( rootProject
                       .getFile().getPath(), ScmFileStatus.CHECKED_IN ) ) ) ) );
View Full Code Here

        ScmFileSet fileSet = new ScmFileSet( rootProject.getFile().getParentFile(), releasePoms );

        Constraint[] arguments = new Constraint[] { new IsAnything(), new IsScmFileSetEquals( fileSet ) };

        scmProviderMock
            .expects( new InvokeOnceMatcher() )
            .method( "add" )
            .with( arguments )
            .will( new ReturnStub( new AddScmResult( "...", Collections
                       .singletonList( new ScmFile( Maven.RELEASE_POMv4, ScmFileStatus.ADDED ) ) ) ) );
View Full Code Here

        Mock commandLineMock = createMockCommandLine( workingDirectory, process );
        expectDefaultArguments( commandLineMock );

        Mock mock = new Mock( CommandLineFactory.class );

        mock.expects( new InvokeOnceMatcher() ).method( "createCommandLine" ).with( new IsEqual( "mvn" ) ).will(
            new ReturnStub( commandLineMock.proxy() ) );

        executor.setCommandLineFactory( (CommandLineFactory) mock.proxy() );

        executor.executeGoals( workingDirectory, "clean integration-test", false, null, new ReleaseResult() );
View Full Code Here

        Mock commandLineMock = createMockCommandLine( workingDirectory, process );
        expectDefaultArguments( commandLineMock );

        String arguments = "-f my-pom.xml";
        commandLineMock.expects( new InvokeOnceMatcher() ).method( "createArgument" ).will(
            new ReturnStub( createArgumentLineMock( arguments ) ) );

        Mock mock = new Mock( CommandLineFactory.class );

        mock.expects( new InvokeOnceMatcher() ).method( "createCommandLine" ).with( new IsEqual( "mvn" ) ).will(
            new ReturnStub( commandLineMock.proxy() ) );

        executor.setCommandLineFactory( (CommandLineFactory) mock.proxy() );

        executor.executeGoals( workingDirectory, "clean integration-test", false, null, "my-pom.xml",
View Full Code Here

TOP

Related Classes of org.jmock.core.matcher.InvokeOnceMatcher

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.