You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/05/26 11:50:45 UTC

[GitHub] [maven-integration-testing] mthmulders commented on a diff in pull request #168: [MNG-7443] IT for consistent logging of optional selectors

mthmulders commented on code in PR #168:
URL: https://github.com/apache/maven-integration-testing/pull/168#discussion_r882592111


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7443ConsistencyOfOptionalProjectsAndProfilesTest.java:
##########
@@ -0,0 +1,69 @@
+package org.apache.maven.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.it.util.ResourceExtractor;
+import org.junit.Assert;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+
+public class MavenITmng7443ConsistencyOfOptionalProjectsAndProfilesTest extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7443ConsistencyOfOptionalProjectsAndProfilesTest()
+    {
+        super( "[4.0.0,)" );
+    }
+
+    public void testConsistentLoggingOfOptionalProfilesAndProjects() throws IOException, VerificationException
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(),
+                "/mng-7443-consistency-of-optional-profiles-and-projects" );
+
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.addCliOption( "-pl ?:does-not-exist" );
+        verifier.addCliOption( "-P?does-not-exist-either" );
+
+        verifier.executeGoals( Arrays.asList( "clean", "verify" ) );
+
+        final List<String> logLines = verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false );
+
+        int projectSelectorMissingCounter = 0;
+        int profileSelectorMissingCounter = 0;
+
+        for ( String logLine : logLines )
+        {
+            if ( logLine.equals( "[INFO] The requested optional projects [:does-not-exist] do not exist." ) )

Review Comment:
   I would try to match on the most relevant part of the log line, e.g. "requested optional project" and ":does not exist". The other parts are not so important. Same goes for line 60.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org