[ https://issues.apache.org/jira/browse/MNG-7098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17602008#comment-17602008 ]
ASF GitHub Bot commented on MNG-7098: ------------------------------------- Giovds commented on code in PR #783: URL: https://github.com/apache/maven/pull/783#discussion_r966412679 ########## 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: It might be an idea to validate just the counter and the project name? This way the test cases will not fail if it's decided to change the amount of whitespaces, or when the wording of the sentence changes for example. > 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)