Skip to content

Commit 568dac1

Browse files
committed
Enh 38282554 - [38277648->25.09] GraalVM Add Coherence GraalVM native feature - fix SSL tests
(merge main -> ce/main 118215) [git-p4: depot-paths = "//dev/coherence-ce/main/": change = 118216]
1 parent 9fd4176 commit 568dac1

File tree

2 files changed

+32
-20
lines changed

2 files changed

+32
-20
lines changed

prj/test/functional/ssl/build.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
<!-- Utility targets -->
2828
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2929

30-
<target name="create.keystores"
30+
<target name="check-keystores">
31+
<available file="target/classes/server.jks" property="keystores.present"/>
32+
</target>
33+
34+
<target name="create.keystores" depends="check-keystores" unless="keystores.present"
3135
description="Generate the various keystore files used by the SSL tests.">
3236

3337
<mkdir dir="target/ca"/>

prj/test/functional/ssl/src/main/java/ssl/GlobalSocketProviderTests.java

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
2+
* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -22,6 +22,7 @@
2222
import com.oracle.bedrock.runtime.coherence.options.OperationalOverride;
2323
import com.oracle.bedrock.runtime.coherence.options.WellKnownAddress;
2424

25+
import com.oracle.bedrock.runtime.coherence.profiles.NativeImageProfile;
2526
import com.oracle.bedrock.runtime.concurrent.RemoteCallable;
2627

2728
import com.oracle.bedrock.runtime.java.features.JmxFeature;
@@ -236,25 +237,32 @@ public void shouldUseGlobalSocketProviderWithExtendProxy() throws Exception
236237
assertThat(member.invoke(new IsSecureProxy()), is(true));
237238
}
238239

239-
System.setProperty(PROP_METRICS_ENABLED, "false");
240-
System.setProperty("coherence.extend.address", "127.0.0.1");
241-
System.setProperty("coherence.extend.port", String.valueOf(extendPort.get()));
242-
243-
Coherence coherence = Coherence.client().start().get(5, TimeUnit.MINUTES);
244-
Session session = coherence.getSession();
245-
try (NamedCache<String, String> cache = session.getCache("nameservice-test"))
246-
{
247-
String value = new UUID().toString();
248-
cache.put("key-1", value);
249-
assertThat(cache.get("key-1"), is(value));
250-
}
240+
// if (!NativeImageProfile.isEnabled())
241+
// {
242+
// Because of the way the certs are generated using an Ant script this test fails
243+
// when running with native image because the Ant script runs again after the native
244+
// image has built overwriting the certs, so the native image contains different certs
245+
// to those being used by this client.
246+
System.setProperty(PROP_METRICS_ENABLED, "false");
247+
System.setProperty("coherence.extend.address", "127.0.0.1");
248+
System.setProperty("coherence.extend.port", String.valueOf(extendPort.get()));
249+
250+
Coherence coherence = Coherence.client().start().get(5, TimeUnit.MINUTES);
251+
Session session = coherence.getSession();
252+
try (NamedCache<String, String> cache = session.getCache("nameservice-test"))
253+
{
254+
String value = new UUID().toString();
255+
cache.put("key-1", value);
256+
assertThat(cache.get("key-1"), is(value));
257+
}
251258

252-
try (NamedCache<String, String> cache = session.getCache("fixed-test"))
253-
{
254-
String value = new UUID().toString();
255-
cache.put("key-1", value);
256-
assertThat(cache.get("key-1"), is(value));
257-
}
259+
try (NamedCache<String, String> cache = session.getCache("fixed-test"))
260+
{
261+
String value = new UUID().toString();
262+
cache.put("key-1", value);
263+
assertThat(cache.get("key-1"), is(value));
264+
}
265+
// }
258266
}
259267
}
260268

0 commit comments

Comments
 (0)