Skip to content

unit test bootstrap no securitymanager#9284

Merged
ebarboni merged 1 commit intoapache:masterfrom
ebarboni:bootstrapbuild
Mar 24, 2026
Merged

unit test bootstrap no securitymanager#9284
ebarboni merged 1 commit intoapache:masterfrom
ebarboni:bootstrapbuild

Conversation

@ebarboni
Copy link
Contributor

@ebarboni ebarboni commented Mar 18, 2026

Hi,
unit test were not working using jdk21 as baseline for bootstrap. changing to release on javac target.

So this is a rewrite of the test using ant buildRule,

Most test pass without changing existing assets,

nbm and jnlp use genkey from ant but needs now algo set. I use DSA not sure it's ok.
fixdependencies uses deprecated openide.options

AFAIK
ant bootrap; ant build-platform;ant localtest are needed to get test compile

Comment on lines +1165 to +1166
"dname='CN=A NetBeans Friend, OU=NetBeans, O=netbeans.org, C=US' \n" +
"keyalg='DSA' \n" +
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mandatory change to have ant task executed

Comment on lines 210 to 211
"keyalg='DSA' \n" +
"/>\n" +
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same keyalgo DSA changes

@ebarboni ebarboni added the build label Mar 18, 2026
@mbien
Copy link
Member

mbien commented Mar 18, 2026

unit test were not working using jdk21 as baseline for bootstrap

this indicates that CI isn't running those tests? Should something be added? (tests which don't run don't test anything ;))

@mbien mbien added the tests label Mar 18, 2026
@ebarboni
Copy link
Contributor Author

unit test were not working using jdk21 as baseline for bootstrap

this indicates that CI isn't running those tests? Should something be added? (tests which don't run don't test anything ;))

Would be nice.
A test is KO right now with checklicense where I put System.print

Comment on lines +105 to 108
if (fail != null && "whenpresent".equals(fail.getValue())) {
failMsg = "License found in " + f;
log(failMsg, Project.MSG_ERR);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

construct failMsg anyway, and log it

@ebarboni
Copy link
Contributor Author

@mbien the default build-nozip is in fact minimal. What would be the good place in workflow to have such test running?

@ebarboni ebarboni added this to the NB30 milestone Mar 19, 2026
Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care here!

nbm and jnlp use genkey from ant but needs now algo set. I use DSA not sure it's ok.

My reading of JDK-8212111 is that DSA was the default and now needs to explicitly set. So from my POV this makes sense.

I added two minimal inline comments, with nitpicks.

For the changes I suggest to also apply these changes:

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index a7b5eeaad60c..614694ae2aa6 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -441,6 +441,9 @@ jobs:
 #      - name: nb/updatecenters
 #        run: ant $OPTS -f nb/updatecenters test
 
+      - name: nbbuild
+        run: ant $OPTS -f nbbuild localtest
+
       # 5-6 min
       - name: Build nbms
         run: ant $OPTS build-nbms
diff --git a/nbbuild/nbproject/project.xml b/nbbuild/nbproject/project.xml
index b275928a62f2..976d1a4e0fe3 100644
--- a/nbbuild/nbproject/project.xml
+++ b/nbbuild/nbproject/project.xml
@@ -205,20 +205,20 @@
             <subprojects/>
             <project-license>apache20-asf</project-license>
         </general-data>
-        <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/4">
+        <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/5">
             <compilation-unit>
                 <package-root>antsrc</package-root>
-                <classpath mode="compile">${ant.core.lib}:${nb_all}/platform/javahelp/external/jhall-2.0_05.jar:${nb_all}/nbbuild/external/json-simple-1.1.1.jar:${nb_all}/nbbuild/external/external/jsoup-1.15.3.jar</classpath>
+                <classpath mode="compile">${ant.core.lib}:${nb_all}/platform/javahelp/external/jhall-2.0_05.jar:${nb_all}/nbbuild/external/json-simple-1.1.1.jar:${nb_all}/nbbuild/external/jsoup-1.15.3.jar</classpath>
                 <built-to>${nb.build.dir}/antclasses</built-to>
                 <built-to>${nbantext.jar}</built-to>
-                <source-level>1.8</source-level>
+                <source-level>11</source-level>
             </compilation-unit>
             <compilation-unit>
                 <package-root>test/unit/src</package-root>
                 <unit-tests/>
                 <classpath mode="compile">${test.unit.cp}</classpath>
                 <built-to>${nb.build.dir}/test/unit/classes</built-to>
-                <source-level>1.8</source-level>
+                <source-level>11</source-level>
             </compilation-unit>
         </java-data>
     </configuration>

The first entry ensures that the unittests are run as part of the CI/CD. The second fixes the IDEs "view" of the code. I.e. correct source level and a fix for the dependencies.

@ebarboni
Copy link
Contributor Author

updated project file and workflow

@ebarboni
Copy link
Contributor Author

merging maybe can do another round of cleanup for jnlp

@ebarboni ebarboni merged commit 0bb0a38 into apache:master Mar 24, 2026
30 checks passed
@mbien mbien added the Code cleanup Label for cleanup done on the Netbeans IDE label Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Code cleanup Label for cleanup done on the Netbeans IDE tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants