You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by jt...@apache.org on 2020/01/07 06:37:21 UTC

[netbeans] branch master updated: [TRAVIS] Enable platform/core.windows tests

This is an automated email from the ASF dual-hosted git repository.

jtulach 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 0cf6618  [TRAVIS] Enable platform/core.windows tests
     new 9496d70  Merge pull request #1824 from blackleg/enable_core_windows_tests
0cf6618 is described below

commit 0cf66189ab85b53f3615fe38d4e977061f38ae11
Author: Hector Espert <he...@gmail.com>
AuthorDate: Fri Dec 13 18:08:49 2019 +0100

    [TRAVIS] Enable platform/core.windows tests
---
 .travis.yml                                        |  2 +-
 .../InvokeWhenUIReadInHeadlessModeTest.java        |  3 ++-
 .../core/windows/awt/ValidateLayerMenuTest.java    | 27 ++++++++++++++--------
 .../core/windows/awt/ValidateLayerToolbarTest.java | 12 ++++++----
 4 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 7c84b97..605a073 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -126,7 +126,7 @@ matrix:
             - hide-logs.sh ant $OPTS -f platform/core.startup test
             - hide-logs.sh ant $OPTS -f platform/core.startup.base test
             - hide-logs.sh ant $OPTS -f platform/core.ui test
-            #- hide-logs.sh ant $OPTS -f platform/core.windows test
+            - travis_wait hide-logs.sh ant $OPTS -f platform/core.windows test
             - hide-logs.sh ant $OPTS -f platform/editor.mimelookup test
             - hide-logs.sh ant $OPTS -f platform/editor.mimelookup.impl test
             - hide-logs.sh ant $OPTS -f platform/favorites test
diff --git a/platform/core.windows/test/unit/src/org/netbeans/core/windows/InvokeWhenUIReadInHeadlessModeTest.java b/platform/core.windows/test/unit/src/org/netbeans/core/windows/InvokeWhenUIReadInHeadlessModeTest.java
index 2a10d5e..ced3a9d 100644
--- a/platform/core.windows/test/unit/src/org/netbeans/core/windows/InvokeWhenUIReadInHeadlessModeTest.java
+++ b/platform/core.windows/test/unit/src/org/netbeans/core/windows/InvokeWhenUIReadInHeadlessModeTest.java
@@ -20,6 +20,7 @@ package org.netbeans.core.windows;
 
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
+import junit.framework.Test;
 import org.netbeans.junit.NbModuleSuite;
 import org.netbeans.junit.NbTestCase;
 import org.openide.windows.WindowManager;
@@ -30,7 +31,7 @@ public class InvokeWhenUIReadInHeadlessModeTest extends NbTestCase {
         super(name);
     }
 
-    public static junit.framework.Test suite() {
+    public static Test suite() {
         return NbModuleSuite.emptyConfiguration().
             gui(false).
             addTest(InvokeWhenUIReadInHeadlessModeTest.class).
diff --git a/platform/core.windows/test/unit/src/org/netbeans/core/windows/awt/ValidateLayerMenuTest.java b/platform/core.windows/test/unit/src/org/netbeans/core/windows/awt/ValidateLayerMenuTest.java
index ab5769f..1a868fa 100644
--- a/platform/core.windows/test/unit/src/org/netbeans/core/windows/awt/ValidateLayerMenuTest.java
+++ b/platform/core.windows/test/unit/src/org/netbeans/core/windows/awt/ValidateLayerMenuTest.java
@@ -19,6 +19,8 @@
 
 package org.netbeans.core.windows.awt;
 
+import java.net.URL;
+import java.util.ArrayList;
 import javax.swing.Box;
 import junit.framework.*;
 import org.netbeans.junit.*;
@@ -45,10 +47,11 @@ public class ValidateLayerMenuTest extends NbTestCase {
     }
 
     public static Test suite() {
-        return
-            NbModuleSuite.createConfiguration(ValidateLayerMenuTest.class)
-                .clusters(".*").enableModules(".*").gui(false)
-        .suite();
+        return NbModuleSuite.createConfiguration(ValidateLayerMenuTest.class)
+                .clusters(".*")
+                .enableModules(".*")
+                .gui(false)
+                .suite();
     }
 
     //
@@ -63,6 +66,8 @@ public class ValidateLayerMenuTest extends NbTestCase {
     protected boolean skipFile (FileObject fo) {
         if (fo.getPath().equals("Menu/Help/org-netbeans-modules-usersguide-master.xml")) {
             return true;
+        } else if(fo.getPath().equals("Menu/Help/master-help.xml")) {
+            return true;
         }
         // ignore these files, there are helper for implementation of 
         // View/filesystems, View/Runtime, View/Projects, etc.
@@ -99,17 +104,19 @@ public class ValidateLayerMenuTest extends NbTestCase {
         // where xml layers live - uaah sometimes I think I just live in another world
         Lookup.getDefault().lookup(ModuleInfo.class);
         
-        java.util.ArrayList errors = new java.util.ArrayList ();
+        ArrayList<String> errors = new ArrayList<>();
+
+        DataFolder dataFolder = DataFolder.findFolder(FileUtil.getConfigFile(rootName()));
         
-        DataFolder df = DataFolder.findFolder (FileUtil.getConfigFile(rootName ()));
-        verifyMenu (df, errors);
+        assertNotNull(dataFolder);
+        verifyMenu (dataFolder, errors);
         
         if (!errors.isEmpty()) {
             fail ("Some files do not provide valid menu elements" + errors);
         }
     }
     
-    private void verifyMenu (DataFolder f, java.util.ArrayList errors) throws Exception {
+    private void verifyMenu (DataFolder f, ArrayList<String> errors) throws Exception {
         DataObject[] arr = f.getChildren();
         for (int i = 0; i < arr.length; i++) {
             if (arr[i] instanceof DataFolder) {
@@ -117,12 +124,12 @@ public class ValidateLayerMenuTest extends NbTestCase {
                 continue;
             } 
             FileObject file = arr[i].getPrimaryFile ();
-            
+                                    
             if (skipFile (file)) {
                 continue;
             }
             
-            Object url = file.getURL();
+            URL url = file.toURL();
             
             InstanceCookie ic = (InstanceCookie)arr[i].getCookie(InstanceCookie.class);
             if (ic == null) {
diff --git a/platform/core.windows/test/unit/src/org/netbeans/core/windows/awt/ValidateLayerToolbarTest.java b/platform/core.windows/test/unit/src/org/netbeans/core/windows/awt/ValidateLayerToolbarTest.java
index 0b966f1..e3d4161 100644
--- a/platform/core.windows/test/unit/src/org/netbeans/core/windows/awt/ValidateLayerToolbarTest.java
+++ b/platform/core.windows/test/unit/src/org/netbeans/core/windows/awt/ValidateLayerToolbarTest.java
@@ -40,25 +40,29 @@ public class ValidateLayerToolbarTest extends ValidateLayerMenuTest {
     }
 
     public static Test suite() {
-        return
-            NbModuleSuite.createConfiguration(ValidateLayerToolbarTest.class).
-                clusters(".*").enableModules(".*").gui(false)
-        .suite();
+        return NbModuleSuite.createConfiguration(ValidateLayerToolbarTest.class)
+                .clusters(".*")
+                .enableModules(".*")
+                .gui(false)
+                .suite();
     }
     
     //
     // override in subclasses
     //
     
+    @Override
     protected String rootName () {
         return "Toolbars";
     }
     
     /** Allowes to skip filest that are know to be broken */
+    @Override
     protected boolean skipFile (FileObject fo) {
         return false;
     }
     
+    @Override
     protected boolean correctInstance (Object obj) {
         if (obj instanceof javax.swing.Action) {
             return 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