Examples of TestFailureMatcher


Examples of org.jmock.core.matcher.TestFailureMatcher

    public void testInputVariablesNonInteractiveConfigured()
        throws Exception
    {
        Mock mockPrompter = new Mock( Prompter.class );
        mockPrompter.expects( new TestFailureMatcher( "prompter should not be called" ) ).method( "prompt" );
        phase.setPrompter( (Prompter) mockPrompter.proxy() );

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

        ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
        releaseDescriptor.setInteractive( false );
        releaseDescriptor.setScmReleaseLabel( "tag-value" );

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

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

        mockPrompter.reset();
        mockPrompter.expects( new TestFailureMatcher( "prompter should not be called" ) ).method( "prompt" );

        releaseDescriptor = new ReleaseDescriptor();
        releaseDescriptor.setInteractive( false );
        releaseDescriptor.setScmReleaseLabel( "simulated-tag-value" );
View Full Code Here

Examples of org.jmock.core.matcher.TestFailureMatcher

    public void testInputVariablesInteractiveConfigured()
        throws Exception
    {
        Mock mockPrompter = new Mock( Prompter.class );
        mockPrompter.expects( new TestFailureMatcher( "prompter should not be called" ) ).method( "prompt" );
        phase.setPrompter( (Prompter) mockPrompter.proxy() );

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

        ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
        releaseDescriptor.setScmReleaseLabel( "tag-value" );

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

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

        mockPrompter.reset();
        mockPrompter.expects( new TestFailureMatcher( "prompter should not be called" ) ).method( "prompt" );

        releaseDescriptor = new ReleaseDescriptor();
        releaseDescriptor.setScmReleaseLabel( "simulated-tag-value" );

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

Examples of org.jmock.core.matcher.TestFailureMatcher

    //MRELEASE-110
    public void testCvsTag()
        throws Exception
    {
        Mock mockPrompter = new Mock( Prompter.class );
        mockPrompter.expects( new TestFailureMatcher( "prompter should not be called" ) ).method( "prompt" );
        phase.setPrompter( (Prompter) mockPrompter.proxy() );

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

        ReleaseDescriptor releaseConfiguration = new ReleaseDescriptor();
        releaseConfiguration.setInteractive( false );
        releaseConfiguration.mapReleaseVersion( "groupId:artifactId", "1.0" );
        releaseConfiguration.setScmSourceUrl( "scm:cvs:pserver:anoncvs@localhost:/tmp/scm-repo:module" );

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

        assertEquals( "Check tag", "artifactId-1_0", releaseConfiguration.getScmReleaseLabel() );

        mockPrompter.reset();
        mockPrompter.expects( new TestFailureMatcher( "prompter should not be called" ) ).method( "prompt" );

        releaseConfiguration = new ReleaseDescriptor();
        releaseConfiguration.setInteractive( false );
        releaseConfiguration.mapReleaseVersion( "groupId:artifactId", "1.0" );
        releaseConfiguration.setScmSourceUrl( "scm:cvs:pserver:anoncvs@localhost:/tmp/scm-repo:module" );
View Full Code Here

Examples of org.jmock.core.matcher.TestFailureMatcher

    //MRELEASE-159
    public void testCustomTagFormat()
        throws Exception
    {
        Mock mockPrompter = new Mock( Prompter.class );
        mockPrompter.expects( new TestFailureMatcher( "prompter should not be called" ) ).method( "prompt" );
        phase.setPrompter( (Prompter) mockPrompter.proxy() );

        List<MavenProject> reactorProjects = Collections.singletonList( createProject( "artifactId", "1.0" ) );
        ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
        releaseDescriptor.setInteractive( false );
        releaseDescriptor.mapReleaseVersion( "groupId:artifactId", "1.0" );
        releaseDescriptor.setScmSourceUrl( "scm:svn:file://localhost/tmp/scm-repo" );

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

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

        mockPrompter.reset();
        mockPrompter.expects( new TestFailureMatcher( "prompter should not be called" ) ).method( "prompt" );

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

Examples of org.jmock.core.matcher.TestFailureMatcher

    private void validateNoCheckin()
        throws Exception
    {
        Mock scmProviderMock = new Mock( ScmProvider.class );
        scmProviderMock.expects( new TestFailureMatcher( "Shouldn't have called checkIn" ) ).method( "checkIn" );

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

Examples of org.jmock.core.matcher.TestFailureMatcher

    private void validateNoCheckin()
        throws Exception
    {
        Mock scmProviderMock = new Mock( ScmProvider.class );
        scmProviderMock.expects( new TestFailureMatcher( "Shouldn't have called checkIn" ) ).method( "checkIn" );

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

Examples of org.jmock.core.matcher.TestFailureMatcher

        ReleaseDescriptor config = new ReleaseDescriptor();
        config.setCompletionGoals( "" );
        config.setWorkingDirectory( testFile.getAbsolutePath() );

        Mock mock = new Mock( MavenExecutor.class );
        mock.expects( new TestFailureMatcher( "Shouldn't invoke executeGoals" ) ).method( "executeGoals" );

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

        phase.execute( config, (Settings) null, (List<MavenProject>) null );
View Full Code Here

Examples of org.jmock.core.matcher.TestFailureMatcher

    public InvocationMatcher exactly( int expectedCount ) {
        return new InvokeCountMatcher(expectedCount);
    }
   
    public InvocationMatcher never() {
        return new TestFailureMatcher("not expected");
    }
View Full Code Here

Examples of org.jmock.core.matcher.TestFailureMatcher

    public InvocationMatcher never() {
        return new TestFailureMatcher("not expected");
    }

    public InvocationMatcher never( String errorMessage ) {
        return new TestFailureMatcher("not expected ("+errorMessage+")");
    }
View Full Code Here

Examples of org.jmock.core.matcher.TestFailureMatcher

    public InvocationMatcher exactly( int expectedCount ) {
        return new InvokeCountMatcher(expectedCount);
    }
   
    public InvocationMatcher never() {
        return new TestFailureMatcher("not expected");
    }
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.