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/07/23 16:33:23 UTC

[GitHub] [maven-integration-testing] michael-o commented on a diff in pull request #177: [MNG-7474] Add an IT

michael-o commented on code in PR #177:
URL: https://github.com/apache/maven-integration-testing/pull/177#discussion_r928140402


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7474SessionScopeTest.java:
##########
@@ -0,0 +1,64 @@
+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 java.io.File;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7474">MNG-7474</a>:
+ * check that Session scope beans are actually singletons for the session.
+ */
+public class MavenITmng7474SessionScopeTest
+        extends AbstractMavenIntegrationTestCase
+{
+    private File projectDir;
+
+    public MavenITmng7474SessionScopeTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    @Override
+    protected void setUp()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7474-session-scope" );
+        projectDir = new File( testDir, "project" );
+    }
+
+    public void testSessionScope()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7474-session-scope" );
+
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        List<String> logLines = verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false );

Review Comment:
   Why do you load them w/o any verification?



##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7474SessionScopeTest.java:
##########
@@ -0,0 +1,64 @@
+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 java.io.File;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7474">MNG-7474</a>:
+ * check that Session scope beans are actually singletons for the session.
+ */
+public class MavenITmng7474SessionScopeTest
+        extends AbstractMavenIntegrationTestCase
+{
+    private File projectDir;
+
+    public MavenITmng7474SessionScopeTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    @Override
+    protected void setUp()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7474-session-scope" );
+        projectDir = new File( testDir, "project" );
+    }
+
+    public void testSessionScope()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7474-session-scope" );

Review Comment:
   Why another extract?



-- 
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