Skip to content

Commit 8f2bce0

Browse files
committed
ADAP-130: adapter updates
1 parent c1de1e0 commit 8f2bce0

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

RELEASENOTES-ADAPTER.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
## New Features
55
* Improved thread safety with concurrent collection classes.
66
* Added error message to DesktopStateListener.onClose (breaking change)
7+
* Added OpenFinRuntime.getRuntimeInfo
8+
* Added OpenFinRuntime.getRvmInfo
79

810
## Bug Fixes
911
* Fixed an issue with passing arguments in System.launchExternalProcess

src/main/java/com/openfin/desktop/demo/OpenFinDesktopDemo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ public void onOutgoingMessage(String message) {
527527

528528
try {
529529
if (this.desktopPort > 0) {
530-
this.runtimeConfiguration.setRuntimePort(9696);
530+
this.runtimeConfiguration.setRuntimePort(this.desktopPort);
531531
updateMessagePanel("Connecting to Runtime already running at port " + this.desktopPort);
532532
this.runtimeConfiguration.setMaxMessageSize(1024*1024);
533533
desktopConnection.connect(this.runtimeConfiguration, listener, 10);

src/test/java/com/openfin/desktop/SystemTest.java

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,5 +541,51 @@ public void onError(Ack ack) {
541541

542542
}
543543

544+
@Test
545+
public void getRuntimeInfo() throws Exception {
546+
CountDownLatch latch = new CountDownLatch(1);
547+
runtime.getRuntimeInfo(new AckListener() {
548+
@Override
549+
public void onSuccess(Ack ack) {
550+
if (ack.isSuccessful()) {
551+
// { "manifestUrl":"http://localhost:5090/getManifest","port":9696,"version":"8.56.30.37","architecture":"x64"}
552+
JSONObject data = (JSONObject) ack.getData();
553+
if (data.has("manifestUrl") && data.has("port") && data.has("version")) {
554+
latch.countDown();
555+
}
556+
}
557+
}
558+
559+
@Override
560+
public void onError(Ack ack) {
561+
}
562+
});
563+
latch.await(5, TimeUnit.SECONDS);
564+
assertEquals("getRuntimeInfo timeout", latch.getCount(), 0);
565+
}
566+
567+
@Test
568+
public void getRvmInfo() throws Exception {
569+
CountDownLatch latch = new CountDownLatch(1);
570+
runtime.getRvmInfo(new AckListener() {
571+
@Override
572+
public void onSuccess(Ack ack) {
573+
if (ack.isSuccessful()) {
574+
// { "action":"get-rvm-info","path":"C:\\Users\\abc\\AppData\\Local\\OpenFin\\OpenFinRVM.exe","start-time":"2018-04-12 14:01:41","version":"4.0.1.1","working-dir":"C:\\Users\\abc\\AppData\\Local\\OpenFin"}
575+
JSONObject data = (JSONObject) ack.getData();
576+
if (data.has("action") && data.has("path") && data.has("start-time")) {
577+
latch.countDown();
578+
}
579+
}
580+
}
581+
582+
@Override
583+
public void onError(Ack ack) {
584+
}
585+
});
586+
latch.await(5, TimeUnit.SECONDS);
587+
assertEquals("getRvmInfo timeout", latch.getCount(), 0);
588+
}
589+
544590

545591
}

0 commit comments

Comments
 (0)