mbien commented on code in PR #5763:
URL: https://github.com/apache/netbeans/pull/5763#discussion_r1155323047


##########
java/debugger.jpda/test/unit/src/org/netbeans/api/debugger/jpda/EvaluatorDirectTest.java:
##########
@@ -0,0 +1,108 @@
+/*
+ * 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.api.debugger.jpda;
+
+import java.io.File;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import junit.framework.Test;
+import org.netbeans.api.debugger.DebuggerManager;
+import org.netbeans.api.java.classpath.ClassPath;
+import org.netbeans.api.java.source.ClasspathInfo;
+import org.netbeans.api.java.source.JavaSource;
+import org.netbeans.api.project.FileOwnerQuery;
+import org.netbeans.api.project.Project;
+import org.netbeans.api.project.ui.OpenProjects;
+import org.netbeans.junit.NbTestCase;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.modules.SpecificationVersion;
+
+/**
+ * Tests evaluation of various expressions.
+ */
+public class EvaluatorDirectTest extends NbTestCase {
+    
+    private JPDASupport     support;
+
+    public EvaluatorDirectTest (String s) {
+        super (s);
+    }
+
+    public static Test suite() {
+        return JPDASupport.createTestSuite(EvaluatorDirectTest.class);
+    }
+    
+    protected void setUp () throws Exception {
+        super.setUp ();
+//        //PreferredCCParser is using SourceUtils.isScanInProgress() to 
modify behavior; ensure indexing is not running.
+        FileObject prjRoot = FileUtil.toFileObject(new 
File(System.getProperty("test.dir.src")));
+        assertNotNull(prjRoot);
+        Project prj = FileOwnerQuery.getOwner(prjRoot);
+        assertNotNull(prj);
+        Project annotationsPrj = 
FileOwnerQuery.getOwner(prj.getProjectDirectory().getParent().getParent().getFileObject("platform/api.annotations.common"));
+        assertNotNull(annotationsPrj);
+        OpenProjects.getDefault().open(new Project[] {annotationsPrj}, false);
+        JavaSource.create(ClasspathInfo.create(ClassPath.EMPTY, 
ClassPath.EMPTY, ClassPath.EMPTY)).runWhenScanFinished(p -> {}, true).get();
+        System.setProperty("debugger.evaluator2", "true");
+        JPDASupport.removeAllBreakpoints ();
+    }
+
+    public void testEvaluate() throws Exception {
+        SpecificationVersion javaVersion = new 
SpecificationVersion(System.getProperty("java.specification.version"));
+        SpecificationVersion version17 = new SpecificationVersion("17");
+        if (javaVersion.compareTo(version17) < 0) {
+            return ; //don't run on JDK < 17
+        }

Review Comment:
   this reminded me that NbTestCase doesn't support junit assumptions (e.g 
assumeTrue()) yet.



##########
.github/workflows/main.yml:
##########
@@ -1521,6 +1521,48 @@ jobs:
           paths: "./*/*/build/test/*/results/TEST-*.xml"
 
 
+  java-debugger-test:
+    name: Java Debugger ${{ matrix.config }} on Linux/JDK ${{ matrix.java }}

Review Comment:
   here too,` ${{ matrix.config }}` can be removed since the job doesn't 
actually have the "config" axis, it only has `java` `[11, 17]`.



##########
.github/workflows/main.yml:
##########
@@ -1521,6 +1521,48 @@ jobs:
           paths: "./*/*/build/test/*/results/TEST-*.xml"
 
 
+  java-debugger-test:
+    name: Java Debugger ${{ matrix.config }} on Linux/JDK ${{ matrix.java }}
+    # equals env.test_java == 'true'
+    if: ${{ contains(github.event.pull_request.labels.*.name, 'Java') || 
contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || 
github.event_name != 'pull_request' }}
+    needs: base-build
+    runs-on: ubuntu-latest
+    timeout-minutes: 60
+    strategy:
+      matrix:
+        java: [ '11', '17' ]
+      fail-fast: false
+    steps:
+
+      - name: Set up JDK ${{ matrix.java }}
+        uses: actions/setup-java@v3
+        with:
+          java-version: ${{ matrix.java }}
+          distribution: ${{ env.default_java_distribution }}
+
+      - name: Setup Xvfb
+        run: |
+          echo "DISPLAY=:99.0" >> $GITHUB_ENV
+          Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
+
+      - name: Download Build
+        uses: actions/download-artifact@v3
+        with:
+          name: build
+
+      - name: Extract
+        run: tar --zstd -xf build.tar.zst
+
+      - name: debugger.jpda ${{ matrix.config }}
+        run: ant $OPTS -Dtest.config=${{ matrix.config }} -f 
java/debugger.jpda test

Review Comment:
   you sure you want to set this`-Dtest.config=${{ matrix.config }}`? This 
isn't actually set, so the variable would be empty.



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