Skip to content

Commit

Permalink
TCK Challenge: RepeatedCasterResource#send fixes #1196
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Bescos Gascon <[email protected]>
  • Loading branch information
jbescos committed Dec 5, 2023
1 parent 77e78fc commit 8a746d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
target/
.classpath
.factorypath
.project
.settings/
*.iml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -612,6 +612,7 @@ public void connectionLostFor1500msTest() throws Fault {
* @test_Strategy:
*/
@Test
@Disabled
public void closeTest() throws Fault {
boolean isOpen = true;
LinkedHolder<InboundSseEvent> holder = new LinkedHolder<>();
Expand All @@ -633,8 +634,6 @@ public void closeTest() throws Fault {
source.open();
sleepUntilHolderGetsFilled(holder);
assertNotNull(holder.get(), "Message was not received");
for (InboundSseEvent e : holder)
logMsg("Received message no", e.readData());

// check the session is opened
setProperty(Property.REQUEST, buildRequest(Request.GET, "repeat/isopen"));
Expand All @@ -646,8 +645,6 @@ public void closeTest() throws Fault {
for (int i = 0; i != 3; i++) {
holder.clear();
sleepUntilHolderGetsFilled(holder);
for (InboundSseEvent e : holder)
logMsg("Received message no", e.readData());
}
// close
source.close();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -54,10 +54,10 @@ public void run() {
isOpen = !sink.isClosed();
}
while (!sink.isClosed() && cast) {
sink.send(sse.newEvent(String.valueOf(cnt++)));
try {
Thread.sleep(500L);
} catch (InterruptedException e1) {
sink.send(sse.newEvent(String.valueOf(cnt++)));
Thread.sleep(1L);
} catch (Exception e1) {
cast = false;
}
synchronized (isOpen) {
Expand Down

0 comments on commit 8a746d7

Please sign in to comment.