Package org.codehaus.plexus.components.interactivity

Examples of org.codehaus.plexus.components.interactivity.Prompter


            (CheckDependencySnapshotsPhase) lookup( ReleasePhase.ROLE, "check-dependency-snapshots" );

        ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
        List<MavenProject> reactorProjects = createDescriptorFromProjects( "external-snapshot-parent/child" );

        Prompter mockPrompter = createMockPrompter( YES, DEFAULT_CHOICE, new VersionPair( "1.0-test", "1.0-test" ),
                                                    new VersionPair( "1.0", "1.0-test" ) );
        phase.setPrompter( mockPrompter );

        try
        {
View Full Code Here


    }

    private Prompter createYesNoMockPrompter( boolean yes )
        throws PrompterException
    {
        Prompter mockPrompter = mock( Prompter.class );

        when( mockPrompter.prompt( anyString(), eq( YES_NO_ARRAY ), eq( NO ) ) ).thenReturn( yes ? YES : NO );

        return mockPrompter;
    }
View Full Code Here

    private Prompter createMockPrompterWithSnapshotReleasePlugin( String useSnapshotReleasePlugin,
                                                                  String resolveSnapshots )
        throws PrompterException
    {
        Prompter mockPrompter = mock( Prompter.class );

        when( mockPrompter.prompt( anyString(), eq( YES_NO_ARRAY ), eq( NO ) ) ).thenReturn( useSnapshotReleasePlugin );
        when( mockPrompter.prompt( anyString(), eq( YES_NO_ARRAY ), eq( NO ) ) ).thenReturn( resolveSnapshots );

        return mockPrompter;
    }
View Full Code Here

    private Prompter createMockPrompter( String resolveSnapshots, String resolutionType,
                                         List<VersionPair> resolvedVersions, List<VersionPair> defaultVersions )
        throws PrompterException
    {
        Prompter mockPrompter = mock( Prompter.class );

        when( mockPrompter.prompt( anyString(), eq( YES_NO_ARRAY ), eq( NO ) ) ).thenReturn( resolveSnapshots );
        when( mockPrompter.prompt( anyString(), eq( CHOICE_ARRAY ), eq( DEFAULT_CHOICE ) ) ).thenReturn(
            resolutionType );

        for ( int i = 0; i < resolvedVersions.size(); i++ )
        {
            when( mockPrompter.prompt( "Which release version should it be set to?", defaultVersions.get(
                i ).releaseVersion ) ).thenReturn( resolvedVersions.get( i ).releaseVersion );
            when( mockPrompter.prompt( "What version should the dependency be reset to for development?",
                                       defaultVersions.get( i ).developmentVersion ) ).thenReturn( resolvedVersions.get(
                i ).developmentVersion );
        }
        return mockPrompter;
    }
View Full Code Here

        throws PrompterException
    {
        Map<String, List<Archetype>> map = createDefaultArchetypeCatalog();

        MockControl control = MockControl.createControl( Prompter.class );
        Prompter prompter = (Prompter) control.getMock();
        prompter.prompt( "", "2" );
        control.setMatcher( createArgumentMatcher() );
        control.setReturnValue( "1" );
        queryer.setPrompter( prompter );

        control.replay();
View Full Code Here

        throws PrompterException
    {
        Map<String, List<Archetype>> map = createDefaultArchetypeCatalog();

        MockControl control = MockControl.createControl( Prompter.class );
        Prompter prompter = (Prompter) control.getMock();
        prompter.prompt( "", "2" );
        control.setMatcher( createArgumentMatcher() );
        control.setReturnValue( "2" );
        queryer.setPrompter( prompter );

        control.replay();
View Full Code Here

        throws PrompterException
    {
        Map<String, List<Archetype>> map = createDefaultArchetypeCatalog();

        MockControl control = MockControl.createControl( Prompter.class );
        Prompter prompter = (Prompter) control.getMock();
        prompter.prompt( "" );
        control.setMatcher( createArgumentMatcher() );
        control.setReturnValue( "1" );
        queryer.setPrompter( prompter );

        control.replay();
View Full Code Here

        throws PrompterException
    {
        Map<String, List<Archetype>> map = createDefaultArchetypeCatalog();

        MockControl control = MockControl.createControl( Prompter.class );
        Prompter prompter = (Prompter) control.getMock();
        prompter.prompt( "" );
        control.setMatcher( createArgumentMatcher() );
        control.setReturnValue( "1" );
        queryer.setPrompter( prompter );

        control.replay();
View Full Code Here

        throws PrompterException
    {
        Map<String, List<Archetype>> map = createDefaultArchetypeCatalog();

        MockControl control = MockControl.createControl( Prompter.class );
        Prompter prompter = (Prompter) control.getMock();
        prompter.prompt( "" );
        control.setMatcher( createArgumentMatcher() );
        control.setReturnValue( "set-artifactId" );
        prompter.prompt( "" );
        control.setReturnValue( "1" );
        queryer.setPrompter( prompter );

        control.replay();
View Full Code Here

    {
        // prepare
        MapVersionsPhase phase = (MapVersionsPhase) lookup( ReleasePhase.ROLE, "test-map-release-versions" );
        MavenProject project = createProject( "artifactId", "1.0-SNAPSHOT" );

        Prompter mockPrompter = mock( Prompter.class );
        when( mockPrompter.prompt( startsWith( "What is the release version for \"" + project.getName() + "\"?" ), eq( "1.0" ) ) ).thenReturn( "2.0" );
        phase.setPrompter( mockPrompter );

        List<MavenProject> reactorProjects = Collections.singletonList( project );

        ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.components.interactivity.Prompter

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.