Examples of IsAnything


Examples of org.jmock.core.constraint.IsAnything

        config.setPreparationGoals( "clean integration-test" );
        config.setWorkingDirectory( testFile.getAbsolutePath() );

        Mock mock = new Mock( MavenExecutor.class );
        Constraint[] constraints = new Constraint[]{new IsEqual( testFile ), new IsEqual( "clean integration-test" ),
            new IsAnything(), new IsEqual( Boolean.TRUE ), new IsAnything(), new IsAnything()};
        mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( constraints );

        phase.setMavenExecutor(ReleaseEnvironment.DEFAULT_MAVEN_EXECUTOR_ID, (MavenExecutor) mock.proxy() );

        phase.simulate( config, new DefaultReleaseEnvironment(), null );
View Full Code Here

Examples of org.jmock.core.constraint.IsAnything

        config.setPreparationGoals( "clean integration-test" );
        config.setWorkingDirectory( testFile.getAbsolutePath() );

        Mock mock = new Mock( MavenExecutor.class );
        Constraint[] constraints = new Constraint[]{new IsEqual( testFile ), new IsEqual( "clean integration-test" ),
            new IsAnything(), new IsEqual( Boolean.TRUE ), new IsNull(), new IsAnything()};
        mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( constraints ).will(
            new ThrowStub( new MavenExecutorException( "...", new Exception() ) ) );

        phase.setMavenExecutor( (MavenExecutor) mock.proxy() );
View Full Code Here

Examples of org.jmock.core.constraint.IsAnything

        config.setPreparationGoals( "clean integration-test" );
        config.setWorkingDirectory( testFile.getAbsolutePath() );

        Mock mock = new Mock( MavenExecutor.class );
        Constraint[] constraints = new Constraint[]{new IsEqual( testFile ), new IsEqual( "clean integration-test" ),
            new IsAnything(), new IsEqual( Boolean.TRUE ), new IsNull(), new IsAnything()};
        mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( constraints ).will(
            new ThrowStub( new MavenExecutorException( "...", new Exception() ) ) );

        phase.setMavenExecutor(ReleaseEnvironment.DEFAULT_MAVEN_EXECUTOR_ID, (MavenExecutor) mock.proxy() );
View Full Code Here

Examples of org.jmock.core.constraint.IsAnything

    public void testInputVariablesInteractive()
        throws Exception
    {
        Mock mockPrompter = new Mock( Prompter.class );
        mockPrompter.expects( new InvokeOnceMatcher() ).method( "prompt" ).with( new IsAnything(),
                                                                                 new IsEqual( "artifactId-1.0" ) ).will(
            new ReturnStub( "tag-value" ) );
        phase.setPrompter( (Prompter) mockPrompter.proxy() );

        List<MavenProject> reactorProjects = Collections.singletonList( createProject( "artifactId", "1.0" ) );

        ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
        releaseDescriptor.mapReleaseVersion( "groupId:artifactId", "1.0" );
        releaseDescriptor.setScmSourceUrl( "scm:svn:file://localhost/tmp/scm-repo" );

        phase.execute( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects );

        assertEquals( "Check tag", "tag-value", releaseDescriptor.getScmReleaseLabel() );

        releaseDescriptor = new ReleaseDescriptor();
        releaseDescriptor.mapReleaseVersion( "groupId:artifactId", "1.0" );
        releaseDescriptor.setScmSourceUrl( "scm:svn:file://localhost/tmp/scm-repo" );

        mockPrompter.reset();
        mockPrompter.expects( new InvokeOnceMatcher() ).method( "prompt" ).with( new IsAnything(),
                                                                                 new IsEqual( "artifactId-1.0" ) ).will(
            new ReturnStub( "simulated-tag-value" ) );

        phase.simulate( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects );
View Full Code Here

Examples of org.jmock.core.constraint.IsAnything

        descriptor.setScmReleaseLabel( "release-label" );

        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( PREFIX + "release-label" )};
        scmProviderMock
            .expects( new InvokeOnceMatcher() )
            .method( "checkIn" )
            .with( arguments )
View Full Code Here

Examples of org.jmock.core.constraint.IsAnything

            poms.add( project.getFile() );
        }
        ScmFileSet fileSet = new ScmFileSet( rootProject.getFile().getParentFile(), poms);

        Mock scmProviderMock = new Mock( ScmProvider.class );
        Constraint[] arguments = new Constraint[]{new IsAnything(), new IsScmFileSetEquals( fileSet ), new IsNull(),
            new IsEqual( PREFIX + "release-label" )};
        scmProviderMock
            .expects( new InvokeOnceMatcher() )
            .method( "checkIn" )
            .with( arguments )
View Full Code Here

Examples of org.jmock.core.constraint.IsAnything

        descriptor.setScmReleaseLabel( "release-label" );

        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( "[maven-release-manager] prepare for next development iteration" )};
        scmProviderMock
            .expects( new InvokeOnceMatcher() )
            .method( "checkIn" )
            .with( arguments )
View Full Code Here

Examples of org.jmock.core.constraint.IsAnything

        files.add( rootProject.getFile() );
        files.add( ReleaseUtil.getReleasePom( rootProject ) );
        ScmFileSet fileSet = new ScmFileSet( rootProject.getFile().getParentFile(), files );

        Mock scmProviderMock = new Mock( ScmProvider.class );
        Constraint[] arguments = new Constraint[]{new IsAnything(), new IsScmFileSetEquals( fileSet ), new IsNull(),
            new IsEqual( PREFIX + "release-label" )};
        scmProviderMock
            .expects( new InvokeOnceMatcher() )
            .method( "checkIn" )
            .with( arguments )
View Full Code Here

Examples of org.jmock.core.constraint.IsAnything

        File checkoutDirectory = getTestFile( "target/checkout-directory" );
        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 );
View Full Code Here

Examples of org.jmock.core.constraint.IsAnything

        File checkoutDirectory = getTestFile( "target/checkout-directory" );
        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 );
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.