You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by mb...@apache.org on 2023/01/10 04:33:00 UTC
[netbeans] branch master updated: move java modules job to JDK 11 and fix tests where needed.
This is an automated email from the ASF dual-hosted git repository.
mbien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 26e47e17ab move java modules job to JDK 11 and fix tests where needed.
new 19fa82359f Merge pull request #5138 from mbien/java-modules-to-11
26e47e17ab is described below
commit 26e47e17abdab1ab77897a6145d1e94a212d5187
Author: Michael Bien <mb...@gmail.com>
AuthorDate: Fri Dec 23 05:07:53 2022 +0100
move java modules job to JDK 11 and fix tests where needed.
- put java module system flags into project properties instead of CI config.
- allows running the tests out-of-the-box from IDE
- has the benefit of not overriding other JVM flag defaults for CI
- move whole job from 8 to 11 and remove (now) redundant steps
- ModuleTest: fix JRTFS module root for JDK 9-12.
- remove empty ConstantPoolTest
---
.github/workflows/main.yml | 36 ++----------------
.../modules/classfile/ConstantPoolTest.java | 44 ----------------------
.../org/netbeans/modules/classfile/ModuleTest.java | 7 +++-
java/java.completion/nbproject/project.properties | 5 +++
java/java.editor/nbproject/project.properties | 5 +++
java/java.source.base/nbproject/project.properties | 4 ++
java/java.source/nbproject/project.properties | 5 +++
java/refactoring.java/nbproject/project.properties | 5 +++
java/whitelist/nbproject/project.properties | 3 ++
9 files changed, 36 insertions(+), 78 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index fc6e71dbb5..6e9447003e 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -1207,21 +1207,15 @@ jobs:
java-modules-test:
- name: Java Modules on Linux/JDK ${{ matrix.java }} (some on 11)
+ name: Java Modules on Linux/JDK ${{ matrix.java }}
needs: base-build
runs-on: ubuntu-latest
timeout-minutes: 100
strategy:
matrix:
- java: [ '8' ]
+ java: [ '11' ]
steps:
- - name: Set up JDK 11
- uses: actions/setup-java@v3
- with:
- java-version: 11
- distribution: ${{ env.default_java_distribution }}
-
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
@@ -1391,36 +1385,12 @@ jobs:
- name: xml.jaxb
run: ant $OPTS -f java/xml.jaxb test
- - name: Set up JDK 11
- uses: actions/setup-java@v3
- with:
- java-version: 11
- distribution: ${{ env.default_java_distribution }}
-
- - name: Set up opts
- run: echo "OPTS_11=-Dtest.run.args=--limit-modules=java.base,java.logging,java.xml,java.prefs,java.desktop,java.management,java.instrument,jdk.zipfs,java.scripting,java.naming -Dtest.bootclasspath.prepend.args=-Dno.netbeans.bootclasspath.prepend.needed=true" >> $GITHUB_ENV
-
- name: java.lexer
run: ant $OPTS -f java/java.lexer test
- - name: java.completion
- if: env.test_java == 'true' && success()
- run: ant $OPTS $OPTS_11 -f java/java.completion test
-
- - name: java.editor
- if: env.test_java == 'true' && success()
- run: .github/retry.sh ant $OPTs $OPTS_11 -f java/java.editor test-unit
-
- - name: java.source
- run: ant $OPTS $OPTS_11 -f java/java.source test-unit
-
- - name: java.source.base
- if: env.test_java == 'true' && success()
- run: .github/retry.sh ant $OPTS $OPTS_11 -f java/java.source.base test
-
- name: refactoring.java
if: env.test_java == 'true' && success()
- run: ant $OPTS $OPTS_11 -f java/refactoring.java test-unit
+ run: ant $OPTS -f java/refactoring.java test-unit
- name: form
if: env.test_java == 'true' && success()
diff --git a/java/classfile/test/unit/src/org/netbeans/modules/classfile/ConstantPoolTest.java b/java/classfile/test/unit/src/org/netbeans/modules/classfile/ConstantPoolTest.java
deleted file mode 100644
index 1416c3aceb..0000000000
--- a/java/classfile/test/unit/src/org/netbeans/modules/classfile/ConstantPoolTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.classfile;
-
-import junit.framework.*;
-
-/**
- *
- * @author tball
- */
-public class ConstantPoolTest extends TestCase {
-
- public ConstantPoolTest(String testName) {
- super(testName);
- }
-
- public void testGet() {
- }
-
- public void testGetClass() {
- }
-
- public void testGetAllConstants() {
- }
-
- public void testGetAllClassNames() {
- }
-}
diff --git a/java/classfile/test/unit/src/org/netbeans/modules/classfile/ModuleTest.java b/java/classfile/test/unit/src/org/netbeans/modules/classfile/ModuleTest.java
index ec44a51b90..4387f16507 100644
--- a/java/classfile/test/unit/src/org/netbeans/modules/classfile/ModuleTest.java
+++ b/java/classfile/test/unit/src/org/netbeans/modules/classfile/ModuleTest.java
@@ -228,8 +228,13 @@ public class ModuleTest extends TestCase {
if (provider == null) {
return null;
}
+
+ // JDK 9-12 returns /
+ // JDK 13+ returns /modules as root
final Path jimageRoot = provider.getPath(URI.create("jrt:///")); //NOI18N
- return jimageRoot;
+
+ final Path modules = jimageRoot.resolve("modules");
+ return Files.exists(modules) ? modules : jimageRoot;
} catch (IOException ioe) {
LOG.log(Level.WARNING, "Cannot load jrt nio provider.", ioe); //NOI18N
return null;
diff --git a/java/java.completion/nbproject/project.properties b/java/java.completion/nbproject/project.properties
index 1135b05694..58ed8509d9 100644
--- a/java/java.completion/nbproject/project.properties
+++ b/java/java.completion/nbproject/project.properties
@@ -31,3 +31,8 @@ test.timeout=1200000
# requires nb.javac for compiling of tests on Mac
requires.nb.javac=true
+
+# remove default compiler JMS flags so that we don't get "Unknown module" warnings due to --limit-modules
+jms-compiler.flags.jvm=
+test.jms.flags=--limit-modules=java.base,java.logging,java.xml,java.prefs,java.desktop,java.management,java.instrument,jdk.zipfs,java.scripting,java.naming
+test.bootclasspath.prepend.args=-Dno.netbeans.bootclasspath.prepend.needed=true
diff --git a/java/java.editor/nbproject/project.properties b/java/java.editor/nbproject/project.properties
index 69e222b386..69714a893e 100644
--- a/java/java.editor/nbproject/project.properties
+++ b/java/java.editor/nbproject/project.properties
@@ -112,3 +112,8 @@ test.timeout=1200000
# requires nb.javac for compiling of tests on Mac
requires.nb.javac=true
+
+# remove default compiler JMS flags so that we don't get "Unknown module" warnings due to --limit-modules
+jms-compiler.flags.jvm=
+test.jms.flags=--limit-modules=java.base,java.logging,java.xml,java.prefs,java.desktop,java.management,java.instrument,jdk.zipfs,java.scripting,java.naming
+test.bootclasspath.prepend.args=-Dno.netbeans.bootclasspath.prepend.needed=true
diff --git a/java/java.source.base/nbproject/project.properties b/java/java.source.base/nbproject/project.properties
index 8b29bb9be7..dd104e3170 100644
--- a/java/java.source.base/nbproject/project.properties
+++ b/java/java.source.base/nbproject/project.properties
@@ -204,3 +204,7 @@ test.config.vanilla-javac.excludes=\
**/gen/TreeManipulationTest.class,\
**/parsing/JavacParserTest.class
+# remove default compiler JMS flags so that we don't get "Unknown module" warnings due to --limit-modules
+jms-compiler.flags.jvm=
+test.jms.flags=--limit-modules=java.base,java.logging,java.xml,java.prefs,java.desktop,java.management,java.instrument,jdk.zipfs,java.scripting,java.naming
+test.bootclasspath.prepend.args=-Dno.netbeans.bootclasspath.prepend.needed=true
diff --git a/java/java.source/nbproject/project.properties b/java/java.source/nbproject/project.properties
index c49b8a4e79..f800654005 100644
--- a/java/java.source/nbproject/project.properties
+++ b/java/java.source/nbproject/project.properties
@@ -55,3 +55,8 @@ test.timeout=3600000
test.config.jet-main.includes=\
org/netbeans/modules/java/JavaNodeTest.class,\
**/UiUtilsTest.class
+
+# remove default compiler JMS flags so that we don't get "Unknown module" warnings due to --limit-modules
+jms-compiler.flags.jvm=
+test.jms.flags=--limit-modules=java.base,java.logging,java.xml,java.prefs,java.desktop,java.management,java.instrument,jdk.zipfs,java.scripting,java.naming
+test.bootclasspath.prepend.args=-Dno.netbeans.bootclasspath.prepend.needed=true
diff --git a/java/refactoring.java/nbproject/project.properties b/java/refactoring.java/nbproject/project.properties
index 90af342779..d5dadad3c0 100644
--- a/java/refactoring.java/nbproject/project.properties
+++ b/java/refactoring.java/nbproject/project.properties
@@ -67,3 +67,8 @@ test.config.stableBTD.excludes=org/netbeans/modules/test/*
requires.nb.javac=true
test.unit.cp.extra=../java.source.nbjavac/build/test-nb-javac/cluster/modules/org-netbeans-modules-java-source-nbjavac-test.jar
+
+# remove default compiler JMS flags so that we don't get "Unknown module" warnings due to --limit-modules
+jms-compiler.flags.jvm=
+test.jms.flags=--limit-modules=java.base,java.logging,java.xml,java.prefs,java.desktop,java.management,java.instrument,jdk.zipfs,java.scripting,java.naming
+test.bootclasspath.prepend.args=-Dno.netbeans.bootclasspath.prepend.needed=true
diff --git a/java/whitelist/nbproject/project.properties b/java/whitelist/nbproject/project.properties
index 97e808415f..c2291df464 100644
--- a/java/whitelist/nbproject/project.properties
+++ b/java/whitelist/nbproject/project.properties
@@ -22,3 +22,6 @@ javadoc.apichanges=${basedir}/apichanges.xml
requires.nb.javac=true
test.config.stableBTD.includes=**/*Test.class
+
+# for JDK 11+
+test.bootclasspath.prepend.args=-Dno.netbeans.bootclasspath.prepend.needed=true
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists