[ 
https://issues.apache.org/jira/browse/MNG-7098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17602219#comment-17602219
 ] 

ASF GitHub Bot commented on MNG-7098:
-------------------------------------

MartinKanters commented on code in PR #783:
URL: https://github.com/apache/maven/pull/783#discussion_r966805017


##########
maven-embedder/src/test/java/org/apache/maven/cli/event/ExecutionEventLoggerTest.java:
##########
@@ -191,6 +194,80 @@ public void testProjectStartedNoPom()
         inOrder.verify( logger ).info( "--------------------------------[ pom 
]---------------------------------" );
     }
 
+    @Test
+    void testMultiModuleProjectProgress()
+    {
+        // prepare
+        MavenProject project1 = generateMavenProject("Apache Maven Embedder 
1");
+        MavenProject project2 = generateMavenProject("Apache Maven Embedder 
2");
+        MavenProject project3 = generateMavenProject("Apache Maven Embedder 
3");
+
+        MavenSession session = mock( MavenSession.class );
+        when( session.getProjects() ).thenReturn( ImmutableList.of( project1, 
project2, project3 ) );
+        when( session.getAllProjects() ).thenReturn( ImmutableList.of( 
project1, project2, project3 ) );
+
+        ExecutionEvent sessionStartedEvent = mock( ExecutionEvent.class );
+        when( sessionStartedEvent.getSession() ).thenReturn( session );
+        ExecutionEvent projectStartedEvent1 = mock( ExecutionEvent.class );
+        when( projectStartedEvent1.getProject() ).thenReturn( project1 );
+        ExecutionEvent projectStartedEvent2 = mock( ExecutionEvent.class );
+        when( projectStartedEvent2.getProject() ).thenReturn( project2 );
+        ExecutionEvent projectStartedEvent3 = mock( ExecutionEvent.class );
+        when( projectStartedEvent3.getProject() ).thenReturn( project3 );
+
+        // execute
+        executionEventLogger.sessionStarted( sessionStartedEvent );
+        executionEventLogger.projectStarted( projectStartedEvent1 );
+        executionEventLogger.projectStarted( projectStartedEvent2 );
+        executionEventLogger.projectStarted( projectStartedEvent3 );
+
+        // verify
+        InOrder inOrder = inOrder( logger );
+        inOrder.verify( logger ).info( "Building Apache Maven Embedder 1 
3.5.4-SNAPSHOT                    [1/3]" );

Review Comment:
   Great suggestion. I thought I would have to use ArgumentCaptors for this, 
but I realised (regex) matchers also work for methods under `verify`. Thanks! 





> Project counter should be cumulative when using resume
> ------------------------------------------------------
>
>                 Key: MNG-7098
>                 URL: https://issues.apache.org/jira/browse/MNG-7098
>             Project: Maven
>          Issue Type: Improvement
>          Components: Reactor and Workspace
>            Reporter: Robert Scholte
>            Priority: Minor
>             Fix For: 4.0.x-candidate
>
>
> When doing a resume on a build, the counter now starts again at 1.
> E.g. Suppose a project has 10 modules and the 7th module fails. With a resume 
> now you'll see {{[1/4]}}.
> To me it makes more sense to say {{[7/10]}}. You're still as close to the end 
> as usual, but this indicates the size of the complete project.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to