Skip to content

Commit 05febf1

Browse files
committed
Test updates for Graaljs 24.0.0
1 parent fa2a8ee commit 05febf1

File tree

6 files changed

+48
-24
lines changed

6 files changed

+48
-24
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,7 @@ jobs:
249249
- name: Commit Validation tests
250250
run: .github/retry.sh ant $OPTS -Dcluster.config=$CLUSTER_CONFIG commit-validation
251251

252-
- name: Set up JDK 11 for core.network
253-
uses: actions/setup-java@v4
254-
if: matrix.java == 17 && success()
255-
with:
256-
java-version: 11
257-
distribution: ${{ env.default_java_distribution }}
258-
259-
# TODO fails on 17+
260252
- name: platform/core.network
261-
if: matrix.java == 17 && success()
262253
run: ant $OPTS -f platform/core.network test
263254

264255
- name: Create Test Summary
@@ -2632,9 +2623,9 @@ jobs:
26322623

26332624
- name: Setup GraalVM {{ matrix.graal }}
26342625
run: |
2635-
URL=https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${{ matrix.graal }}/graalvm-ce-java11-linux-amd64-${{ matrix.graal }}.tar.gz
2626+
URL=https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${{ matrix.graal }}/graalvm-ce-java17-linux-amd64-${{ matrix.graal }}.tar.gz
26362627
curl -L $URL | tar -xz
2637-
GRAALVM=`pwd`/graalvm-ce-java11-${{ matrix.graal }}
2628+
GRAALVM=`pwd`/graalvm-ce-java17-${{ matrix.graal }}
26382629
echo "JAVA_HOME=$GRAALVM" >> $GITHUB_ENV
26392630
26402631
- name: Setup GraalVM Languages

java/nashorn.execution/test/unit/src/org/netbeans/modules/nashorn/execution/JSExecutorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void testLoadAllGraalJsLibraries() throws Exception {
4646
find.setAccessible(true);
4747
final ClassPath cp = (ClassPath) find.invoke(null);
4848
final FileObject[] roots = cp.getRoots();
49-
assertEquals("Seven roots", 7, roots.length);
49+
assertEquals("Fifteen roots", 15, roots.length);
5050
for (FileObject fo : roots) {
5151
assertTrue("valid: " + fo, fo.isValid());
5252
assertTrue("folder: " + fo, fo.isFolder());

platform/core.network/nbproject/project.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@
149149
<test-dependency>
150150
<code-name-base>org.netbeans.core.startup</code-name-base>
151151
<compile-dependency/>
152-
<test/>
152+
</test-dependency>
153+
<test-dependency>
154+
<code-name-base>org.netbeans.libs.graaljs</code-name-base>
155+
<recursive/>
156+
<compile-dependency/>
153157
</test-dependency>
154158
<test-dependency>
155159
<code-name-base>org.netbeans.libs.junit4</code-name-base>
@@ -179,12 +183,12 @@
179183
<test/>
180184
</test-dependency>
181185
<test-dependency>
182-
<code-name-base>org.openide.util.ui</code-name-base>
183-
<compile-dependency/>
186+
<code-name-base>org.openide.util.lookup</code-name-base>
184187
<test/>
185188
</test-dependency>
186189
<test-dependency>
187-
<code-name-base>org.openide.util.lookup</code-name-base>
190+
<code-name-base>org.openide.util.ui</code-name-base>
191+
<compile-dependency/>
188192
<test/>
189193
</test-dependency>
190194
</test-type>

platform/core.network/test/unit/src/org/netbeans/core/network/proxy/ProxyAutoConfigDirectTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.util.LinkedList;
2626
import java.util.List;
2727
import java.util.regex.Pattern;
28+
import org.netbeans.junit.NbModuleSuite;
2829
import org.netbeans.junit.NbTestCase;
2930

3031
public class ProxyAutoConfigDirectTest extends NbTestCase {
@@ -34,6 +35,15 @@ public class ProxyAutoConfigDirectTest extends NbTestCase {
3435
public ProxyAutoConfigDirectTest(String name) {
3536
super(name);
3637
}
38+
39+
public static final junit.framework.Test suite() {
40+
NbModuleSuite.Configuration cfg = NbModuleSuite.emptyConfiguration().
41+
honorAutoloadEager(true).
42+
enableClasspathModules(false).
43+
gui(false);
44+
45+
return cfg.clusters("platform|webcommon|ide").addTest(ProxyAutoConfigDirectTest.class).suite();
46+
}
3747

3848
public void testGetProxyAutoConfigWithLocalPAC() throws URISyntaxException {
3949
List<String> pacFileLocations = new LinkedList<String>();

platform/core.network/test/unit/src/org/netbeans/core/network/proxy/pac/PacEngineTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.junit.BeforeClass;
2929
import org.junit.Test;
3030
import org.netbeans.core.network.proxy.pac.impl.NbPacScriptEvaluatorFactory;
31+
import org.netbeans.junit.NbModuleSuite;
3132
import org.netbeans.junit.NbTestCase;
3233

3334
/**
@@ -56,6 +57,14 @@ public void tearDown() {
5657
}
5758

5859

60+
public static final junit.framework.Test suite() {
61+
NbModuleSuite.Configuration cfg = NbModuleSuite.emptyConfiguration().
62+
honorAutoloadEager(true).
63+
enableClasspathModules(false).
64+
gui(false);
65+
66+
return cfg.clusters("platform|webcommon|ide").addTest(PacEngineTest.class).suite();
67+
}
5968

6069

6170
/**

platform/core.network/test/unit/src/org/netbeans/core/network/proxy/pac/impl/NbPacScriptEvaluatorTest.java

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,25 @@
2020

2121
import javax.script.ScriptEngine;
2222
import org.junit.Assert;
23-
import static org.junit.Assert.assertNotNull;
24-
import static org.junit.Assert.assertNull;
25-
import org.junit.Test;
23+
import org.netbeans.junit.NbModuleSuite;
24+
import org.netbeans.junit.NbTestCase;
2625

27-
public class NbPacScriptEvaluatorTest {
26+
public class NbPacScriptEvaluatorTest extends NbTestCase {
2827

29-
@Test
30-
public void findsAnEngineByDefault() {
28+
public NbPacScriptEvaluatorTest(String name) {
29+
super(name);
30+
}
31+
32+
public static final junit.framework.Test suite() {
33+
NbModuleSuite.Configuration cfg = NbModuleSuite.emptyConfiguration().
34+
honorAutoloadEager(true).
35+
enableClasspathModules(false).
36+
gui(false);
37+
38+
return cfg.clusters("platform|webcommon|ide").addTest(NbPacScriptEvaluatorTest.class).suite();
39+
}
40+
41+
public void testFindsAnEngineByDefault() {
3142
StringBuilder err = new StringBuilder();
3243
ScriptEngine eng = findDefaultEngineInTheSystem(err);
3344
assertNotNull(err.toString(), eng);
@@ -37,8 +48,7 @@ public static ScriptEngine findDefaultEngineInTheSystem(StringBuilder err) {
3748
return NbPacScriptEvaluator.newAllowedPacEngine(null, err);
3849
}
3950

40-
@Test
41-
public void reportsAnErrorForNonExistingEngine() {
51+
public void testReportsAnErrorForNonExistingEngine() {
4252
StringBuilder err = new StringBuilder();
4353
ScriptEngine eng = NbPacScriptEvaluator.newAllowedPacEngine("NonExisting", err);
4454
assertNull("No engine should be found: " + err.toString(), eng);

0 commit comments

Comments
 (0)