Package org.jmock.core.constraint

Examples of org.jmock.core.constraint.IsEqual


        releaseDescriptor.setAdditionalArguments( "-Dmaven.test.skip=true" );
        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( "-Dmaven.test.skip=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 );
View Full Code Here


        releaseDescriptor.setScmSourceUrl( "scm-url" );
        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 );
View Full Code Here

        releaseDescriptor.setScmSourceUrl( "scm-url" );
        releaseDescriptor.setWorkingDirectory( getTestFile( "target/test/checkout" ).getAbsolutePath() );

        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 );
        configurator.setScmManager( scmManager );
View Full Code Here

        releaseDescriptor.setScmSourceUrl( "scm-url" );
        releaseDescriptor.setWorkingDirectory( getTestFile( "target/test/checkout" ).getAbsolutePath() );

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

        ScmManager scmManager = (ScmManager) scmManagerMock.proxy();
        DefaultScmRepositoryConfigurator configurator =
            (DefaultScmRepositoryConfigurator) lookup( ScmRepositoryConfigurator.ROLE );
        configurator.setScmManager( scmManager );
View Full Code Here

        throws Exception
    {
        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
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

        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

        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, arguments, null );
View Full Code Here

        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() );

        try
View Full Code Here

    {
        File workingDirectory = getTestFile( "target/working-directory" );

        Mock commandLineMock = new Mock( Commandline.class );
        commandLineMock.expects( new InvokeOnceMatcher() ).method( "setWorkingDirectory" ).with(
            new IsEqual( workingDirectory.getAbsolutePath() ) );
        commandLineMock.expects( new InvokeOnceMatcher() ).method( "addEnvironment" ).with(
            new IsEqual( "MAVEN_TERMINATE_CMD" ), new IsEqual( "on" ) );
        commandLineMock.expects( new InvokeOnceMatcher() ).method( "execute" ).will(
            new ThrowStub( new CommandLineException( "..." ) ) );

        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() );

        try
View Full Code Here

TOP

Related Classes of org.jmock.core.constraint.IsEqual

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.