diff --git a/examples/src/main/java/jaxrs/examples/sse/ServerSentEventsResource.java b/examples/src/main/java/jaxrs/examples/sse/ServerSentEventsResource.java index dc19a685a..de70e8d9a 100644 --- a/examples/src/main/java/jaxrs/examples/sse/ServerSentEventsResource.java +++ b/examples/src/main/java/jaxrs/examples/sse/ServerSentEventsResource.java @@ -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 diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSink.java b/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSink.java index b24543530..cb214e624 100644 --- a/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSink.java +++ b/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSink.java @@ -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 diff --git a/jaxrs-tck-docs/TCK-Exclude-List.txt b/jaxrs-tck-docs/TCK-Exclude-List.txt index c1c1b0587..33f0b777e 100644 --- a/jaxrs-tck-docs/TCK-Exclude-List.txt +++ b/jaxrs-tck-docs/TCK-Exclude-List.txt @@ -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 @@ -152,3 +152,6 @@ 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 diff --git a/jaxrs-tck-docs/tckbundle.sh b/jaxrs-tck-docs/tckbundle.sh index d7cb70b6c..fa2c70ed2 100644 --- a/jaxrs-tck-docs/tckbundle.sh +++ b/jaxrs-tck-docs/tckbundle.sh @@ -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 @@ -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 @@ -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 diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/common/JAXRSCommonClient.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/common/JAXRSCommonClient.java index e50a1f2b0..d5c06b142 100644 --- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/common/JAXRSCommonClient.java +++ b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/common/JAXRSCommonClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2021 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 @@ -715,29 +715,29 @@ protected void clearProperty(Property key) { assertEquals(T first, T second, Object... message) { if (first == null && second == null) return; - assertFalse(first == null && second != null, message.toString()); - assertFalse(first != null && second == null, message.toString()); + assertFalse(first == null && second != null, objectsToString(message)); + assertFalse(first != null && second == null, objectsToString(message)); if (first instanceof Comparable) - assertTrue(((Comparable) first).compareTo(second) == 0, message.toString()); + assertTrue(((Comparable) first).compareTo(second) == 0, objectsToString(message)); else - assertTrue(first.equals(second), message.toString()); + assertTrue(first.equals(second), objectsToString(message)); } public static void // assertEqualsInt(int first, int second, Object... message) { - assertTrue(first == second, message.toString()); + assertTrue(first == second, objectsToString(message)); } public static void // assertEqualsLong(long first, long second, Object... message) { - assertTrue(first == second, message.toString()); + assertTrue(first == second, objectsToString(message)); } public static void // assertEqualsBool(boolean first, boolean second, Object... message) { - assertTrue(first == second, message.toString()); + assertTrue(first == second, objectsToString(message)); } /** @@ -751,7 +751,7 @@ protected void clearProperty(Property key) { */ public static void // assertNull(Object object, Object... message) { - assertTrue(object == null, message.toString()); + assertTrue(object == null, objectsToString(message)); } /** @@ -765,7 +765,7 @@ protected void clearProperty(Property key) { */ public static void // assertNotNull(Object object, Object... message) { - assertTrue(object != null, message.toString()); + assertTrue(object != null, objectsToString(message)); } /** @@ -795,7 +795,7 @@ public static void fault(Object... objects) throws Fault { */ public static void assertContains(String string, String substring, Object... message) { - assertTrue(string.contains(substring), message.toString()); + assertTrue(string.contains(substring), objectsToString(message)); } /** @@ -812,7 +812,7 @@ public static void assertContains(String string, String substring, */ public static void assertContainsIgnoreCase(String string, String substring, Object... message) { - assertTrue(string.toLowerCase().contains(substring.toLowerCase()), message.toString()); + assertTrue(string.toLowerCase().contains(substring.toLowerCase()), objectsToString(message)); } /** @@ -828,7 +828,7 @@ public static void assertContainsIgnoreCase(String string, String substring, */ public static void assertContains(T text, T subtext, Object... message) { - assertContains(text.toString(), subtext.toString(), message.toString()); + assertContains(text.toString(), subtext.toString(), objectsToString(message)); } /** @@ -845,7 +845,7 @@ public static void assertContains(T text, T subtext, Object... message) */ public static void assertContainsIgnoreCase(T text, T subtext, Object... message) { - assertContainsIgnoreCase(text.toString(), subtext.toString(), message.toString()); + assertContainsIgnoreCase(text.toString(), subtext.toString(), objectsToString(message)); } /** diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/ee/rs/container/responsecontext/ResponseFilter.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/ee/rs/container/responsecontext/ResponseFilter.java index 0bf416f1b..7c7c3c929 100644 --- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/ee/rs/container/responsecontext/ResponseFilter.java +++ b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/ee/rs/container/responsecontext/ResponseFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2023 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 @@ -317,6 +317,11 @@ public synchronized void write(byte[] b, int off, int len) write(b); } + @Override + public void close() throws IOException { + stream.close(); + } + public final byte[] intToByteArray(int value) { return new byte[] { (byte) (value & 0xff) }; } diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/ee/rs/core/uriinfo/JAXRSClientIT.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/ee/rs/core/uriinfo/JAXRSClientIT.java index 3fbaaa58c..52a001c55 100644 --- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/ee/rs/core/uriinfo/JAXRSClientIT.java +++ b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/ee/rs/core/uriinfo/JAXRSClientIT.java @@ -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 @@ -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; @@ -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(); diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/ssebroadcaster/JAXRSClientIT.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/ssebroadcaster/JAXRSClientIT.java index 2a6e1dd92..677e89514 100644 --- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/ssebroadcaster/JAXRSClientIT.java +++ b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/ssebroadcaster/JAXRSClientIT.java @@ -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 @@ -17,6 +17,7 @@ package ee.jakarta.tck.ws.rs.jaxrs21.ee.sse.ssebroadcaster; import java.util.List; +import java.util.ArrayList; import java.io.InputStream; import java.io.IOException; @@ -188,17 +189,20 @@ public void sseBroadcastTest() throws Fault { } } - for (int i = 0; i != CLIENTS; i++) { - List events = clients[i].getEvents(); - assertEquals(events.size(), MSG_MAX + 1, - "Received unexpected number of events", events.size()); - assertTrue(events.get(0).contains("WELCOME"), - "Received unexpected message"+ events.get(0)); - for (int j = 0; j != MSG_MAX; j++) - assertEquals(events.get(j + 1), SSEMessage.MESSAGE + j, - "Received unexpected message", events.get(j + 1)); + List expectedEvents = new ArrayList(); + for (int j = 0; j != MSG_MAX; j++) { + expectedEvents.add(SSEMessage.MESSAGE + j); } + for (int i = 0; i != CLIENTS; i++) { + List events = clients[i].getEvents(); + assertEquals(events.size(), MSG_MAX + 1, + "Received unexpected number of events", events.size()); + assertTrue(events.get(0).contains("WELCOME"), + "Received unexpected message"+ events.get(0)); + assertTrue(events.containsAll(expectedEvents), "An expected message was not received"); + } + setProperty(Property.REQUEST, buildRequest(Request.GET, "broadcast/check")); invoke(); String response = getResponseBody(); diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsink/CloseResource.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsink/CloseResource.java index 1aa1ad570..55e3f68b9 100644 --- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsink/CloseResource.java +++ b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsink/CloseResource.java @@ -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 diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsink/MBWCheckResource.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsink/MBWCheckResource.java index 5eca3f8e7..b6461840e 100644 --- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsink/MBWCheckResource.java +++ b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsink/MBWCheckResource.java @@ -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 diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsink/StageCheckerResource.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsink/StageCheckerResource.java index a40a3c5a6..3753fc39b 100644 --- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsink/StageCheckerResource.java +++ b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsink/StageCheckerResource.java @@ -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 diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsource/MediaTypeResource.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsource/MediaTypeResource.java index 982a94b9d..1db501027 100644 --- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsource/MediaTypeResource.java +++ b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsource/MediaTypeResource.java @@ -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 diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsource/ServiceUnavailableResource.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsource/ServiceUnavailableResource.java index 55aba3519..cc03d2b32 100644 --- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsource/ServiceUnavailableResource.java +++ b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs21/ee/sse/sseeventsource/ServiceUnavailableResource.java @@ -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