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 2afb36228e Start running enterprise tests on JDK 11
     new 25efb2e34e Merge pull request #6296 from mbien/ci-enterprise-more-on-11
2afb36228e is described below

commit 2afb36228e46f7627fb2b877b87101e41431a09b
Author: Michael Bien <[email protected]>
AuthorDate: Thu Aug 3 20:21:57 2023 +0200

    Start running enterprise tests on JDK 11
    
    Not all are compatible yet, but this should not stop us from running
    those who are on JDK 11.
---
 .github/workflows/main.yml                         | 23 +++---
 .../modules/j2ee/sun/dd/api/DDProviderTest.java    | 88 +++++++---------------
 2 files changed, 40 insertions(+), 71 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index b1c2246ffa..eb02d3203e 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -1954,13 +1954,13 @@ jobs:
 
 
   enterprise-test:
-    name: Enterprise on Linux/JDK ${{ matrix.java }}
+    name: Enterprise on Linux/JDK ${{ matrix.java }} (some on 8)
     needs: base-build
     runs-on: ubuntu-latest
     timeout-minutes: 60
     strategy:
       matrix:
-        java: [ '8' ]
+        java: [ '11' ]
     steps:
 
       - name: Set up JDK ${{ matrix.java }} 
@@ -2024,9 +2024,6 @@ jobs:
       - name: j2ee.ddloaders
         run: ant $OPTS -f enterprise/j2ee.ddloaders test
 
-      - name: j2ee.dd.webservice
-        run: ant $OPTS -f enterprise/j2ee.dd.webservice test
-
 # Fails + Slow
 #      - name: j2ee.ejbjarproject
 #        run: ant $OPTS -f enterprise/j2ee.ejbjarproject test
@@ -2151,10 +2148,6 @@ jobs:
 #      - name: websvc.design
 #        run: ant $OPTS -f enterprise/websvc.design test
 
-# Fails
-#      - name: websvc.editor.hints
-#        run: ant $OPTS -f enterprise/websvc.editor.hints test
-
       - name: websvc.jaxwsapi
         run: ant $OPTS -f enterprise/websvc.jaxwsapi test
 
@@ -2190,6 +2183,18 @@ jobs:
       - name: websvc.wsstackapi
         run: ant $OPTS -f enterprise/websvc.wsstackapi test
 
+      - name: Set up JDK 8 for incompatible tests
+        uses: actions/setup-java@v3
+        with:
+          java-version: 8
+          distribution: ${{ env.default_java_distribution }}
+
+      - name: websvc.editor.hints
+        run: ant $OPTS -f enterprise/websvc.editor.hints test
+
+      - name: j2ee.dd.webservice
+        run: ant $OPTS -f enterprise/j2ee.dd.webservice test
+
       - name: Create Test Summary
         uses: test-summary/action@v2
         if: failure()
diff --git 
a/enterprise/j2ee.sun.dd/test/unit/src/org/netbeans/modules/j2ee/sun/dd/api/DDProviderTest.java
 
b/enterprise/j2ee.sun.dd/test/unit/src/org/netbeans/modules/j2ee/sun/dd/api/DDProviderTest.java
index bef4cd9054..dfe376b0e8 100644
--- 
a/enterprise/j2ee.sun.dd/test/unit/src/org/netbeans/modules/j2ee/sun/dd/api/DDProviderTest.java
+++ 
b/enterprise/j2ee.sun.dd/test/unit/src/org/netbeans/modules/j2ee/sun/dd/api/DDProviderTest.java
@@ -24,12 +24,13 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.netbeans.junit.NbTestCase;
+import org.netbeans.modules.j2ee.sun.dd.api.app.SunApplication;
+import org.netbeans.modules.j2ee.sun.dd.api.client.SunApplicationClient;
+import org.netbeans.modules.j2ee.sun.dd.api.ejb.SunEjbJar;
+import org.netbeans.modules.j2ee.sun.dd.api.web.SunWebApp;
 import org.xml.sax.InputSource;
-import static org.junit.Assert.*;
 import org.xml.sax.SAXException;
 
 /**
@@ -42,37 +43,21 @@ public class DDProviderTest extends NbTestCase {
         super("DDProvider");
     }
 
-    @Before
-    public void setUp() {
-    }
-
-    @After
-    public void tearDown() {
-    }
-
     @Test
     public void testGetEjbDDRoot() throws FileNotFoundException, IOException, 
SAXException {
         File[] list = getDataDir().listFiles();
         if (null == list || list.length == 0)
             return;
+        SunEjbJar root = null;
         for (File fo : list) {
             if (fo.getName().startsWith("valid-sun-ejb-jar")) {
-                InputStream is = null;
-                try {
-                    is = new FileInputStream(fo);
-
-                    DDProvider.getDefault().getEjbDDRoot(new InputSource(is));
-                } finally {
-                    if (null != is) {
-                        try {
-                            is.close();
-                        } catch (IOException ioe) { }
-                    }
+                try (InputStream is = new FileInputStream(fo)) {
+                    root = DDProvider.getDefault().getEjbDDRoot(new 
InputSource(is));
+                    assertNotNull(root);
                 }
             }
         }
-
-
+        assertNotNull(root);
     }
 
     @Test
@@ -80,70 +65,49 @@ public class DDProviderTest extends NbTestCase {
         File[] list = getDataDir().listFiles();
         if (null == list || list.length == 0)
             return;
+        SunWebApp root = null;
         for (File fo : list) {
             if (fo.getName().startsWith("valid-sun-web")) {
-                InputStream is = null;
-                try {
-                    is = new FileInputStream(fo);
-
-                    DDProvider.getDefault().getWebDDRoot(new InputSource(is));
-                } finally {
-                    if (null != is) {
-                        try {
-                            is.close();
-                        } catch (IOException ioe) { }
-                    }
+                try (InputStream is = new FileInputStream(fo)) {
+                    root = DDProvider.getDefault().getWebDDRoot(new 
InputSource(is));
+                    assertNotNull(root);
                 }
             }
         }
-
+        assertNotNull(root);
     }
 
     @Test
-    public void testGetAppDDRoot() throws FileNotFoundException, IOException, 
SAXException {
+    public void fails_testGetAppDDRoot() throws FileNotFoundException, 
IOException, SAXException {
         File[] list = getDataDir().listFiles();
         if (null == list || list.length == 0)
             return;
+        SunApplication root = null;
         for (File fo : list) {
             if (fo.getName().startsWith("valid-sun-application")) {
-                InputStream is = null;
-                try {
-                    is = new FileInputStream(fo);
-
-                    DDProvider.getDefault().getAppDDRoot(new InputSource(is));
-                } finally {
-                    if (null != is) {
-                        try {
-                            is.close();
-                        } catch (IOException ioe) { }
-                    }
+                try (InputStream is = new FileInputStream(fo)) {
+                    root = DDProvider.getDefault().getAppDDRoot(new 
InputSource(is));
+                    assertNotNull(root);
                 }
             }
         }
-
+        assertNotNull(root);
     }
 
     @Test
-    public void testGetAppClientDDRoot() throws FileNotFoundException, 
IOException, SAXException {
+    public void fails_testGetAppClientDDRoot() throws FileNotFoundException, 
IOException, SAXException {
         File[] list = getDataDir().listFiles();
         if (null == list || list.length == 0)
             return;
+        SunApplicationClient root = null;
         for (File fo : list) {
             if (fo.getName().startsWith("valid-sun-appclient")) {
-                InputStream is = null;
-                try {
-                    is = new FileInputStream(fo);
-
-                    DDProvider.getDefault().getAppClientDDRoot(new 
InputSource(is));
-                } finally {
-                    if (null != is) {
-                        try {
-                            is.close();
-                        } catch (IOException ioe) { }
-                    }
+                try (InputStream is = new FileInputStream(fo)) {
+                    root = DDProvider.getDefault().getAppClientDDRoot(new 
InputSource(is));
+                    assertNotNull(root);
                 }
             }
         }
-
+        assertNotNull(root);
     }
 }
\ No newline at end of file


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