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 2020/05/20 11:43:32 UTC

[GitHub] [maven] slachiewicz opened a new pull request #346: [MNG-6909] Use CDI to inject objects under tests

slachiewicz opened a new pull request #346:
URL: https://github.com/apache/maven/pull/346


   simplify tests - use Guice CDI to inject beans - instead of manually in setup methods


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

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



[GitHub] [maven] elharo commented on a change in pull request #346: [MNG-6909] Use CDI to inject objects under tests

Posted by GitBox <gi...@apache.org>.
elharo commented on a change in pull request #346:
URL: https://github.com/apache/maven/pull/346#discussion_r428178523



##########
File path: maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java
##########
@@ -53,12 +57,24 @@
 
     private static String BASE_MIXIN_DIR = BASE_DIR + "/resources-mixins";
 
+    @Inject
     private DefaultProjectBuilder projectBuilder;
 
+    @Inject
     private RepositorySystem repositorySystem;
 
     private File testDirectory;
 
+    @Override
+    protected synchronized void setupContainer()
+    {
+        super.setupContainer();
+
+        ((DefaultPlexusContainer)getContainer())

Review comment:
       This requires Java 8, and would probably be clearer without lambdas




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

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



[GitHub] [maven] michael-o commented on pull request #346: [MNG-6909] Use CDI to inject objects under tests

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #346:
URL: https://github.com/apache/maven/pull/346#issuecomment-734249917


   Why wasn't this merged yet?


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

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



[GitHub] [maven] asfgit closed pull request #346: [MNG-6909] Use CDI to inject objects under tests

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #346:
URL: https://github.com/apache/maven/pull/346


   


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

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



[GitHub] [maven] slachiewicz commented on a change in pull request #346: [MNG-6909] Use CDI to inject objects under tests

Posted by GitBox <gi...@apache.org>.
slachiewicz commented on a change in pull request #346:
URL: https://github.com/apache/maven/pull/346#discussion_r428193862



##########
File path: maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java
##########
@@ -53,12 +57,24 @@
 
     private static String BASE_MIXIN_DIR = BASE_DIR + "/resources-mixins";
 
+    @Inject
     private DefaultProjectBuilder projectBuilder;
 
+    @Inject
     private RepositorySystem repositorySystem;
 
     private File testDirectory;
 
+    @Override
+    protected synchronized void setupContainer()
+    {
+        super.setupContainer();
+
+        ((DefaultPlexusContainer)getContainer())

Review comment:
       For Maven core we already have Java 8.. 
   check here version without lambda: 
   
   https://github.com/apache/maven/blob/master/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java#L325-L335




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

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