[GitHub] [netbeans] junichi11 commented on a change in pull request #1402: [NETBEANS-1763] Integrate maven failsafe output into test runner output

2019-08-14 Thread GitBox
junichi11 commented on a change in pull request #1402: [NETBEANS-1763] 
Integrate maven failsafe output into test runner output
URL: https://github.com/apache/netbeans/pull/1402#discussion_r314086833
 
 

 ##
 File path: 
java/maven.junit.ui/src/org/netbeans/modules/maven/junit/ui/MavenJUnitTestMethodNode.java
 ##
 @@ -62,52 +63,71 @@ public MavenJUnitTestMethodNode(Testcase testcase, Project 
project, String proje
 @Override
 public Action[] getActions(boolean context) {
 List actions = new ArrayList();
-Action preferred = getPreferredAction();
-if (preferred != null) {
-actions.add(preferred);
-}
-FileObject testFO = getTestcaseFileObject();   
 
-if (testFO != null){
+FileObject testFO = getTestcaseFileObject();
+if (testFO != null) {
+boolean unitTest = getTestcase().getType() == null || 
"UNIT".equals(getTestcase().getType()); // NOI18N
+boolean integrationTest = 
"INTEGRATION".equals(getTestcase().getType()); // NOI18N
 Project suiteProject = FileOwnerQuery.getOwner(testFO);
 if (suiteProject != null) {
 ActionProvider actionProvider = 
suiteProject.getLookup().lookup(ActionProvider.class);
 if (actionProvider != null) {
-boolean runSupported = false;
-boolean debugSupported = false;
-for (String action : actionProvider.getSupportedActions()) 
{
-if (!runSupported && 
action.equals(COMMAND_RUN_SINGLE_METHOD)) {
-runSupported = true;
-if (debugSupported) {
-break;
-}
-}
-if (!debugSupported && 
action.equals(COMMAND_DEBUG_SINGLE_METHOD)) {
-debugSupported = true;
-if (runSupported) {
-break;
-}
-}
-}
-
 SingleMethod methodSpec = new SingleMethod(testFO, 
testcase.getName());
 Lookup nodeContext = Lookups.singleton(methodSpec);
-if (runSupported && 
actionProvider.isActionEnabled(COMMAND_RUN_SINGLE_METHOD,
-nodeContext)) {
-actions.add(new TestMethodNodeAction(actionProvider,
+
+for (String action : actionProvider.getSupportedActions()) 
{
+if (unitTest
+&& action.equals(COMMAND_RUN_SINGLE_METHOD)
+&& actionProvider.isActionEnabled(action, 
nodeContext)) {
+actions.add(new 
TestMethodNodeAction(actionProvider,
 nodeContext,
 COMMAND_RUN_SINGLE_METHOD,
 Bundle.LBL_RerunTest()));
-}
-if (debugSupported && 
actionProvider.isActionEnabled(COMMAND_DEBUG_SINGLE_METHOD,
-nodeContext)) {
-actions.add(new TestMethodNodeAction(actionProvider,
+}
+if (unitTest
+&& action.equals(COMMAND_DEBUG_SINGLE_METHOD)
+&& actionProvider.isActionEnabled(action, 
nodeContext)) {
+actions.add(new 
TestMethodNodeAction(actionProvider,
 nodeContext,
 COMMAND_DEBUG_SINGLE_METHOD,
 Bundle.LBL_DebugTest()));
+}
+if (integrationTest
+&& action.equals("integration-test.single")
 
 Review comment:
   Missing 4 `NOI18N`s
   
   Maybe, should add `NOI18N` to `aName = "";` and `bName = "";`


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[GitHub] [netbeans] junichi11 commented on a change in pull request #1402: [NETBEANS-1763] Integrate maven failsafe output into test runner output

2019-08-14 Thread GitBox
junichi11 commented on a change in pull request #1402: [NETBEANS-1763] 
Integrate maven failsafe output into test runner output
URL: https://github.com/apache/netbeans/pull/1402#discussion_r313818963
 
 

 ##
 File path: 
java/maven.junit.ui/src/org/netbeans/modules/maven/junit/ui/MavenJUnitTestMethodNode.java
 ##
 @@ -62,52 +63,71 @@ public MavenJUnitTestMethodNode(Testcase testcase, Project 
project, String proje
 @Override
 public Action[] getActions(boolean context) {
 List actions = new ArrayList();
-Action preferred = getPreferredAction();
-if (preferred != null) {
-actions.add(preferred);
-}
-FileObject testFO = getTestcaseFileObject();   
 
-if (testFO != null){
+FileObject testFO = getTestcaseFileObject();
+if (testFO != null) {
+boolean unitTest = getTestcase().getType() == null || 
"UNIT".equals(getTestcase().getType());
 
 Review comment:
   Missing `// NOI18N`s?


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[GitHub] [netbeans] junichi11 commented on a change in pull request #1402: [NETBEANS-1763] Integrate maven failsafe output into test runner output

2019-08-14 Thread GitBox
junichi11 commented on a change in pull request #1402: [NETBEANS-1763] 
Integrate maven failsafe output into test runner output
URL: https://github.com/apache/netbeans/pull/1402#discussion_r313818460
 
 

 ##
 File path: 
java/maven.junit.ui/src/org/netbeans/modules/maven/junit/ui/MavenJUnitTestMethodNode.java
 ##
 @@ -62,52 +63,71 @@ public MavenJUnitTestMethodNode(Testcase testcase, Project 
project, String proje
 @Override
 public Action[] getActions(boolean context) {
 List actions = new ArrayList();
-Action preferred = getPreferredAction();
-if (preferred != null) {
-actions.add(preferred);
-}
-FileObject testFO = getTestcaseFileObject();   
 
-if (testFO != null){
+FileObject testFO = getTestcaseFileObject();
+if (testFO != null) {
+boolean unitTest = getTestcase().getType() == null || 
"UNIT".equals(getTestcase().getType());
+boolean integrationTest = 
"INTEGRATION".equals(getTestcase().getType());
 Project suiteProject = FileOwnerQuery.getOwner(testFO);
 if (suiteProject != null) {
 ActionProvider actionProvider = 
suiteProject.getLookup().lookup(ActionProvider.class);
 if (actionProvider != null) {
-boolean runSupported = false;
-boolean debugSupported = false;
-for (String action : actionProvider.getSupportedActions()) 
{
-if (!runSupported && 
action.equals(COMMAND_RUN_SINGLE_METHOD)) {
-runSupported = true;
-if (debugSupported) {
-break;
-}
-}
-if (!debugSupported && 
action.equals(COMMAND_DEBUG_SINGLE_METHOD)) {
-debugSupported = true;
-if (runSupported) {
-break;
-}
-}
-}
-
 SingleMethod methodSpec = new SingleMethod(testFO, 
testcase.getName());
 Lookup nodeContext = Lookups.singleton(methodSpec);
-if (runSupported && 
actionProvider.isActionEnabled(COMMAND_RUN_SINGLE_METHOD,
-nodeContext)) {
-actions.add(new TestMethodNodeAction(actionProvider,
+
+for (String action : actionProvider.getSupportedActions()) 
{
+if (unitTest
+&& action.equals(COMMAND_RUN_SINGLE_METHOD)
+&& actionProvider.isActionEnabled(action, 
nodeContext)) {
+actions.add(new 
TestMethodNodeAction(actionProvider,
 nodeContext,
 COMMAND_RUN_SINGLE_METHOD,
 Bundle.LBL_RerunTest()));
-}
-if (debugSupported && 
actionProvider.isActionEnabled(COMMAND_DEBUG_SINGLE_METHOD,
-nodeContext)) {
-actions.add(new TestMethodNodeAction(actionProvider,
+}
+if (unitTest
+&& action.equals(COMMAND_DEBUG_SINGLE_METHOD)
+&& actionProvider.isActionEnabled(action, 
nodeContext)) {
+actions.add(new 
TestMethodNodeAction(actionProvider,
 nodeContext,
 COMMAND_DEBUG_SINGLE_METHOD,
 Bundle.LBL_DebugTest()));
+}
+if (integrationTest
+&& action.equals("integration-test.single")
+&& actionProvider.isActionEnabled(action, 
nodeContext)) {
+actions.add(new 
TestMethodNodeAction(actionProvider,
+nodeContext,
+"integration-test.single",
 
 Review comment:
   Missing `// NOI18N`s?


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[GitHub] [netbeans] junichi11 commented on a change in pull request #1402: [NETBEANS-1763] Integrate maven failsafe output into test runner output

2019-08-14 Thread GitBox
junichi11 commented on a change in pull request #1402: [NETBEANS-1763] 
Integrate maven failsafe output into test runner output
URL: https://github.com/apache/netbeans/pull/1402#discussion_r313818460
 
 

 ##
 File path: 
java/maven.junit.ui/src/org/netbeans/modules/maven/junit/ui/MavenJUnitTestMethodNode.java
 ##
 @@ -62,52 +63,71 @@ public MavenJUnitTestMethodNode(Testcase testcase, Project 
project, String proje
 @Override
 public Action[] getActions(boolean context) {
 List actions = new ArrayList();
-Action preferred = getPreferredAction();
-if (preferred != null) {
-actions.add(preferred);
-}
-FileObject testFO = getTestcaseFileObject();   
 
-if (testFO != null){
+FileObject testFO = getTestcaseFileObject();
+if (testFO != null) {
+boolean unitTest = getTestcase().getType() == null || 
"UNIT".equals(getTestcase().getType());
+boolean integrationTest = 
"INTEGRATION".equals(getTestcase().getType());
 Project suiteProject = FileOwnerQuery.getOwner(testFO);
 if (suiteProject != null) {
 ActionProvider actionProvider = 
suiteProject.getLookup().lookup(ActionProvider.class);
 if (actionProvider != null) {
-boolean runSupported = false;
-boolean debugSupported = false;
-for (String action : actionProvider.getSupportedActions()) 
{
-if (!runSupported && 
action.equals(COMMAND_RUN_SINGLE_METHOD)) {
-runSupported = true;
-if (debugSupported) {
-break;
-}
-}
-if (!debugSupported && 
action.equals(COMMAND_DEBUG_SINGLE_METHOD)) {
-debugSupported = true;
-if (runSupported) {
-break;
-}
-}
-}
-
 SingleMethod methodSpec = new SingleMethod(testFO, 
testcase.getName());
 Lookup nodeContext = Lookups.singleton(methodSpec);
-if (runSupported && 
actionProvider.isActionEnabled(COMMAND_RUN_SINGLE_METHOD,
-nodeContext)) {
-actions.add(new TestMethodNodeAction(actionProvider,
+
+for (String action : actionProvider.getSupportedActions()) 
{
+if (unitTest
+&& action.equals(COMMAND_RUN_SINGLE_METHOD)
+&& actionProvider.isActionEnabled(action, 
nodeContext)) {
+actions.add(new 
TestMethodNodeAction(actionProvider,
 nodeContext,
 COMMAND_RUN_SINGLE_METHOD,
 Bundle.LBL_RerunTest()));
-}
-if (debugSupported && 
actionProvider.isActionEnabled(COMMAND_DEBUG_SINGLE_METHOD,
-nodeContext)) {
-actions.add(new TestMethodNodeAction(actionProvider,
+}
+if (unitTest
+&& action.equals(COMMAND_DEBUG_SINGLE_METHOD)
+&& actionProvider.isActionEnabled(action, 
nodeContext)) {
+actions.add(new 
TestMethodNodeAction(actionProvider,
 nodeContext,
 COMMAND_DEBUG_SINGLE_METHOD,
 Bundle.LBL_DebugTest()));
+}
+if (integrationTest
+&& action.equals("integration-test.single")
+&& actionProvider.isActionEnabled(action, 
nodeContext)) {
+actions.add(new 
TestMethodNodeAction(actionProvider,
+nodeContext,
+"integration-test.single",
 
 Review comment:
   Missing `// NOI18N`s?


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[GitHub] [netbeans] junichi11 commented on a change in pull request #1402: [NETBEANS-1763] Integrate maven failsafe output into test runner output

2019-08-14 Thread GitBox
junichi11 commented on a change in pull request #1402: [NETBEANS-1763] 
Integrate maven failsafe output into test runner output
URL: https://github.com/apache/netbeans/pull/1402#discussion_r313818042
 
 

 ##
 File path: 
java/maven.junit/src/org/netbeans/modules/maven/junit/JUnitOutputListenerProvider.java
 ##
 @@ -244,42 +247,69 @@ static boolean isFullJavaId(String 
possibleNewRunningTestClass) {
 
 public @Override void sequenceStart(String sequenceId, OutputVisitor 
visitor) {
 session = null;
-   // Fix for #257563 / SUREFIRE-1158, where surefire 2.19.x
-   // removed the printing of the output directory. Get the directory from
-   // the configuration directly or fallback to the plugin standard
-   if (usingSurefire219(this.config.getMavenProject())) {
-   // 
http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#reportsDirectory
-   String reportsDirectory = 
PluginPropertyUtils.getPluginProperty(config.getMavenProject(),
-   Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_SUREFIRE, 
"reportsDirectory", "test", null); // NOI18N
-   if (null == reportsDirectory) {
-   // fallback to default value
-   try {
-   Object defaultValue = 
PluginPropertyUtils.createEvaluator(config.getMavenProject())
-   
.evaluate("${project.build.directory}/surefire-reports");
-   if (defaultValue instanceof String) {
-   reportsDirectory = (String) defaultValue;
-   }
-   } catch (ExpressionEvaluationException ex) {
-   // NOP could not resolved default value
-   }
-   }
-   if (null != reportsDirectory) {
-   File absoluteFile = new File(reportsDirectory);
-   // configuration might be "target/directory", which is relative
-   // to the maven project or an absolute path
-   File relativeFile = new 
File(this.config.getMavenProject().getBasedir(), reportsDirectory);
-   if (absoluteFile.exists() && absoluteFile.isDirectory()) {
-   outputDir = absoluteFile;
-   } else {
-   if (relativeFile.exists() && relativeFile.isDirectory()) {
-   outputDir = relativeFile;
-   }
-   }
-   if (null != outputDir) {
-   createSession(outputDir);
-   }
-   }
-   }
+reportNameSuffix = null;
+testType = null;
+String reportsDirectory = null;
+   if (("mojo-execute#surefire:test".equals(sequenceId))) {
 
 Review comment:
   Missing `NOI18N`s?


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[GitHub] [netbeans] junichi11 commented on a change in pull request #1402: [NETBEANS-1763] Integrate maven failsafe output into test runner output

2019-08-14 Thread GitBox
junichi11 commented on a change in pull request #1402: [NETBEANS-1763] 
Integrate maven failsafe output into test runner output
URL: https://github.com/apache/netbeans/pull/1402#discussion_r313817351
 
 

 ##
 File path: 
java/maven.junit/src/org/netbeans/modules/maven/junit/JUnitOutputProcessorFactory.java
 ##
 @@ -45,7 +45,10 @@ public JUnitOutputProcessorFactory() {
 
 @Override
 public Set createProcessorsSet(Project project, RunConfig 
config) {
-if (config.getGoals().contains("test") || 
config.getGoals().contains("integration-test") || 
config.getGoals().contains("surefire:test")) { //NOI18N
+if (config.getGoals().contains("test") //NOI18N
+|| config.getGoals().contains("integration-test") //NOI18N
+|| config.getGoals().contains("surefire:test")
 
 Review comment:
   Missing `// NOI18N` 


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[GitHub] [netbeans] junichi11 commented on a change in pull request #1402: [NETBEANS-1763] Integrate maven failsafe output into test runner output

2019-08-14 Thread GitBox
junichi11 commented on a change in pull request #1402: [NETBEANS-1763] 
Integrate maven failsafe output into test runner output
URL: https://github.com/apache/netbeans/pull/1402#discussion_r313816997
 
 

 ##
 File path: java/maven/src/org/netbeans/modules/maven/ActionProviderImpl.java
 ##
 @@ -113,11 +113,13 @@
 public static final String BUILD_WITH_DEPENDENCIES = 
"build-with-dependencies"; // NOI18N
 
 private final Project proj;
-
-// XXX introduce constant w/ CosChecker, ActionMappings, 
DefaultReplaceTokenProvider
-public static final String RUN_MAIN = ActionProvider.COMMAND_RUN_SINGLE + 
".main";
-public static final String DEBUG_MAIN = 
ActionProvider.COMMAND_DEBUG_SINGLE + ".main";
-public static final String PROFILE_MAIN = 
ActionProvider.COMMAND_PROFILE_SINGLE + ".main";
+
+public static final String COMMAND_RUN_MAIN = 
ActionProvider.COMMAND_RUN_SINGLE + ".main";
+public static final String COMMAND_DEBUG_MAIN = 
ActionProvider.COMMAND_DEBUG_SINGLE + ".main";
+public static final String COMMAND_PROFILE_MAIN = 
ActionProvider.COMMAND_PROFILE_SINGLE + ".main";
+
+public static final String COMMAND_INTEGRATION_TEST_SINGLE = 
"integration-test.single";
+public static final String COMMAND_DEBUG_INTEGRATION_TEST_SINGLE = 
"debug.integration-test.single";
 
 Review comment:
   Add `// NOI18N` ?


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists