JaroslavTulach commented on a change in pull request #3022:
URL: https://github.com/apache/netbeans/pull/3022#discussion_r660711948



##########
File path: ide/gsf.testrunner.ui/apichanges.xml
##########
@@ -64,6 +64,19 @@
         </description>
         <class package="org.netbeans.modules.gsf.testrunner.ui.api" 
name="TestMethodController"/>
     </change>
+    <change id="ComputeTestMethodsAndTestMethodGetTestClassPosition">
+        <api name="CommonTestrunnerUIAPI"/>
+        <summary>Added ComputeTestMethods SPI and getTestClassPosition() to 
TestMethod</summary>
+        <version major="1" minor="25"/>
+        <date day="26" month="6" year="2021"/>
+        <author login="dbalek"/>
+        <compatibility addition="yes"/>
+        <description>
+            Added SPI to provide a list of {@link TestMethod}s found in a 
parsed {@link Source}s.

Review comment:
       `{@link}` is unlikely to work. Use `<a href="@TOP@/pkg/TestMethod.html">`

##########
File path: 
ide/gsf.testrunner.ui/src/org/netbeans/modules/gsf/testrunner/ui/spi/ComputeTestMethods.java
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.netbeans.modules.gsf.testrunner.ui.spi;
+
+import java.util.List;
+import org.netbeans.api.editor.mimelookup.MimeLookup;
+import 
org.netbeans.modules.gsf.testrunner.ui.api.TestMethodController.TestMethod;
+import org.netbeans.modules.parsing.spi.Parser;
+
+/**
+ * SPI to provide a list of {@link TestMethod}s found in a parsed {@link 
Source}s.
+ *
+ * @author Dusan Balek
+ * @since 1.25
+ */
+public interface ComputeTestMethods {
+
+    /**
+     * Provides a list of {@link TestMethod}s found in a parsed {@link Source}.
+     *
+     * @param result result of parsing given {@link Source}
+     * @return list of test methods found
+     * @since 1.25
+     */
+    public List<TestMethod> computeTestMethods(Parser.Result result);
+
+    /**
+     * After this method is called the test methods computation if running 
should exit immediately.
+     *
+     * @since 1.25
+     */
+    public void cancel();
+
+    /**
+     * Factory for creating {@link ComputeTestMethods} instances.
+     * It should be registered in the {@link MimeLookup}.
+     *
+     * @since 1.25
+     */
+    public interface Factory {

Review comment:
       Interface, a factory & co. seems a bit too verbose. I would prefer 
interface with a single method `computeTestMethods` and some parameter:
   ```java
   interface ComputeTestMethods {
     public void computeTestMethods(Info info);
     public final class Info {
        private Info()
        public Parser.Result getResult();
        public boolean addMethod(TestMethod m); // if returns false, consider 
the request cancelled
     }
   }
   ```
   with this approach the implementors need to implement just a single 
interface with a single method. Only one instance needs to be created. 
Evolution plan: add new methods into the `Info` class.

##########
File path: groovy/libs.groovy/nbproject/project.xml
##########
@@ -44,6 +44,7 @@
                 <package>org.codehaus.groovy.control</package>
                 <package>org.codehaus.groovy.control.customizers</package>
                 
<package>org.codehaus.groovy.control.customizers.builder</package>
+                <package>org.codehaus.groovy.control.io</package>

Review comment:
       This change should be associated with some versioning. Increment spec 
version of the `libs.groovy` module; make sure those who depend on the 
`org.codehaus.groovy.control.io` package require the new version.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to