Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add changes from release-3.1.x and release-4.0 TCK to release-3.2 #1220

Merged
merged 9 commits into from
Feb 20, 2024
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -98,10 +98,7 @@ public void startDomain(@PathParam("id") final String id,
sseEventSink.close();
} catch (final InterruptedException e) {
e.printStackTrace();
} catch (IOException ioe) {
//handle I/O error
}

});
}
}
6 changes: 2 additions & 4 deletions jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSink.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 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 All @@ -16,7 +16,6 @@

package jakarta.ws.rs.sse;

import java.io.IOException;
import java.util.concurrent.CompletionStage;

/**
Expand Down Expand Up @@ -72,8 +71,7 @@ public interface SseEventSink extends AutoCloseable {
* <p>
* Subsequent calls have no effect and are ignored. Once the {@link SseEventSink} is closed, invoking any method other
* than this one and {@link #isClosed()} would result in an {@link IllegalStateException} being thrown.
* @throws IOException if an I/O error occurs.
*/
@Override
void close() throws IOException;
void close();
}
11 changes: 10 additions & 1 deletion jaxrs-tck-docs/TCK-Exclude-List.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2021, 2024 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 @@ -76,6 +76,9 @@ ee/jakarta/tck/ws/rs/jaxrs21/ee/client/executor/async/JAXRSClientIT.java#traceWi
ee/jakarta/tck/ws/rs/jaxrs21/ee/client/executor/async/JAXRSClientIT.java#traceWithStringCallbackWhileServerWaitTest
ee/jakarta/tck/ws/rs/jaxrs21/ee/client/executor/async/JAXRSClientIT.java#traceWithStringClassWhileServerWaitTest

# https://github.com/jakartaee/rest/issues/1162
ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/ssebroadcaster/JAXRSClientIT.java#sseBroadcastTest

#
#
ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsource/JAXRSClientIT.java#connectionLostForDefault500msTest
Expand Down Expand Up @@ -152,3 +155,9 @@ ee/jakarta/tck/ws/rs/jaxrs21/ee/client/rxinvoker/JAXRSClientIT.java#traceWithStr
ee/jakarta/tck/ws/rs/jaxrs21/ee/client/rxinvoker/JAXRSClientIT.java#traceWithResponseClassTest
ee/jakarta/tck/ws/rs/jaxrs21/ee/client/rxinvoker/JAXRSClientIT.java#traceWithGenericTypeStringTest
ee/jakarta/tck/ws/rs/jaxrs21/ee/client/rxinvoker/JAXRSClientIT.java#traceWithGenericTypeResponseTest

https://github.com/jakartaee/rest/issues/1138
ee/jakarta/tck/ws/rs/ee/rs/core/uriinfo/JAXRSClientIT#getNormalizedUriTest

https://github.com/jakartaee/rest/issues/1163
ee/jakarta/tck/ws/rs/ee/rs/container/responsecontext/JAXRSClientIT#setEntityStreamTest
11 changes: 9 additions & 2 deletions jaxrs-tck-docs/tckbundle.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -xe

# Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2024 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 @@ -40,6 +40,7 @@ mvn

rm -rf $WORKSPACE/bundle

mkdir -p $WORKSPACE/bundle
mkdir -p $WORKSPACE/bundle/docs
mkdir -p $WORKSPACE/bundle/docs/html-usersguide
mkdir -p $WORKSPACE/bundle/docs/pdf-usersguide
Expand All @@ -51,17 +52,23 @@ cp $WORKSPACE/jaxrs-tck-docs/*.html $WORKSPACE/bundle/docs/
cp $WORKSPACE/jaxrs-tck-docs/*.txt $WORKSPACE/bundle/docs/
cp -r $WORKSPACE/jaxrs-tck-docs/assertions $WORKSPACE/bundle/docs/

mkdir -p $WORKSPACE/bundle
cp $WORKSPACE/jaxrs-tck/target/*.jar $WORKSPACE/bundle/

cd $WORKSPACE/bundle
mkdir -p $WORKSPACE/bundle/META-INF

if [[ "$1" == "epl" || "$1" == "EPL" ]]; then
cp $WORKSPACE/LICENSE.md $WORKSPACE/bundle/LICENSE.md
cp $WORKSPACE/LICENSE.md $WORKSPACE/bundle/META-INF/LICENSE.md
cp $WORKSPACE/jaxrs-tck/pom.epl.xml $WORKSPACE/bundle/restful-ws-tck-"$VERSION".pom
jar -uvf restful-ws-tck-"$VERSION".jar META-INF/LICENSE.md
rm -rf $WORKSPACE/bundle/META-INF
zip -r restful-ws-tck-"$VERSION".zip *
else
cp $WORKSPACE/jaxrs-tck-docs/LICENSE_EFTL.md $WORKSPACE/bundle/LICENSE.md
cp $WORKSPACE/jaxrs-tck-docs/LICENSE_EFTL.md $WORKSPACE/bundle/META-INF/LICENSE.md
cp $WORKSPACE/jaxrs-tck/pom.xml $WORKSPACE/bundle/jakarta-restful-ws-tck-"$VERSION".pom
jar -uvf jakarta-restful-ws-tck-"$VERSION".jar META-INF/LICENSE.md
rm -rf $WORKSPACE/bundle/META-INF
zip -r jakarta-restful-ws-tck-"$VERSION".zip *
fi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 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 @@ -53,7 +53,7 @@
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.AfterEach;

import org.junit.jupiter.api.Disabled;
/*
* @class.setup_props: webServerHost;
* webServerPort;
Expand Down Expand Up @@ -1103,6 +1103,7 @@ public void setEntityTest() throws Fault {
* Throws IOException.
*/
@Test
@Disabled
public void setEntityStreamTest() throws Fault {
setProperty(Property.SEARCH_STRING, ResponseFilter.ENTITY);
setProperty(Property.SEARCH_STRING, "OK");
Expand All @@ -1121,6 +1122,7 @@ public void setEntityStreamTest() throws Fault {
* Throws IOException.
*/
@Test
@Disabled
public void setStatusTest() throws Fault {
for (Response.Status status : Response.Status.values()) {
String content = String.valueOf(status.getStatusCode());
Expand All @@ -1142,6 +1144,7 @@ public void setStatusTest() throws Fault {
* Throws IOException.
*/
@Test
@Disabled
public void setStatusInfoTest() throws Fault {
for (Response.Status status : Response.Status.values()) {
String content = String.valueOf(status.getStatusCode());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2024 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 @@ -34,6 +34,7 @@
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Disabled;

/*
* @class.setup_props: webServerHost;
Expand Down Expand Up @@ -414,6 +415,7 @@ public void getMatchedURIsTest2() throws Fault {
* obtained from an injected UriInfo
*/
@Test
@Disabled
public void getNormalizedUriTest() throws Fault {
setProperty(Property.REQUEST, buildRequest(GET, URIInfoTest.DECODED));
invoke();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024 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 @@ -46,6 +46,7 @@
import org.jboss.shrinkwrap.api.spec.WebArchive;

import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.TestInfo;
Expand Down Expand Up @@ -143,6 +144,7 @@ public void cleanup() throws Fault {
* @test_Strategy:
*/
@Test
@Disabled
public void sseBroadcastTest() throws Fault {
int MSG_MAX = 7;
int wait = 25;
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, 2024 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 All @@ -25,9 +25,6 @@
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.sse.Sse;
import jakarta.ws.rs.sse.SseEventSink;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

@Path("close")
public class CloseResource {
Expand All @@ -36,8 +33,6 @@ public class CloseResource {

private static volatile boolean isClosed = false;

private static final Logger LOG = Logger.getLogger(CloseResource.class.getName());

@GET
@Path("reset")
@Produces(MediaType.SERVER_SENT_EVENTS)
Expand All @@ -46,8 +41,6 @@ public void reset(@Context SseEventSink sink, @Context Sse sse) {
isClosed = false;
try (SseEventSink s = sink) {
s.send(sse.newEvent("RESET"));
} catch (IOException e) {
throw new RuntimeException(e);
}
}

Expand All @@ -59,19 +52,15 @@ public void send(@Context SseEventSink sink, @Context Sse sse) {
public void run() {
SseEventSink s = sink;
s.send(sse.newEvent(SSEMessage.MESSAGE));
try {
s.close();
isClosed = s.isClosed();
if (!isClosed)
return;
s.close();
isClosed = s.isClosed();
if (!isClosed)
return;
s.close();
} catch (IOException e) {
//ignore this exception and isClosed will be checked later.
}
s.close();
isClosed = s.isClosed();
if (!isClosed)
return;
s.close();
isClosed = s.isClosed();
if (!isClosed)
return;
s.close();
isClosed = s.isClosed();
if (!isClosed)
return;
Expand Down Expand Up @@ -99,8 +88,6 @@ public void check(@Context SseEventSink sink, @Context Sse sse) {
return;
}
s.send(sse.newEvent("CHECK"));
} catch (IOException e) {
LOG.log(Level.WARNING, "Failed to close SseEventSink", e);
}
}

Expand Down
Loading