-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated GF, Jetty, Mimepull, Moxy, Yasson dependencies (#4425)
* Updated GF, Jetty, Mimepull, Moxy, Yasson dependencies Signed-off-by: Jan Supol <[email protected]>
- Loading branch information
Showing
9 changed files
with
252 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2020 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 | ||
http://www.eclipse.org/legal/epl-2.0. | ||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>project</artifactId> | ||
<groupId>org.glassfish.jersey.tests.integration</groupId> | ||
<version>2.31-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>jetty-response-close</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.glassfish.jersey.containers</groupId> | ||
<artifactId>jersey-container-jetty-http</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-server</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-server</artifactId> | ||
<!-- Test Backward compatibility with this version --> | ||
<version>9.4.17.v20190418</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<properties> | ||
<surefire.security.argline>-Djava.security.manager -Djava.security.policy=${project.build.directory}/test-classes/surefire.policy</surefire.security.argline> | ||
</properties> | ||
|
||
</project> |
28 changes: 28 additions & 0 deletions
28
...-response-close/src/main/java/org/glassfish/jersey/tests/jettyresponseclose/Resource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright (c) 2020 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 | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package org.glassfish.jersey.tests.jettyresponseclose; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
|
||
@Path("/") | ||
public class Resource { | ||
@GET | ||
public String get() { | ||
return Resource.class.getName(); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
.../test/java/org/glassfish/jersey/tests/jettyresponseclose/JettyHttpContainerCloseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (c) 2020 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 | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package org.glassfish.jersey.tests.jettyresponseclose; | ||
|
||
import org.eclipse.jetty.server.Server; | ||
import org.glassfish.jersey.jetty.JettyHttpContainer; | ||
import org.glassfish.jersey.jetty.JettyHttpContainerFactory; | ||
import org.glassfish.jersey.server.ResourceConfig; | ||
import org.junit.jupiter.api.AfterAll; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import javax.ws.rs.client.ClientBuilder; | ||
import javax.ws.rs.core.Response; | ||
import java.net.URI; | ||
|
||
public class JettyHttpContainerCloseTest { | ||
|
||
private static Server server; | ||
private static JettyHttpContainer container; | ||
private static final String URL = "http://localhost:9080"; | ||
|
||
@BeforeAll | ||
public static void setup() { | ||
server = JettyHttpContainerFactory.createServer(URI.create(URL), | ||
new ResourceConfig(Resource.class)); | ||
container = (JettyHttpContainer) server.getHandler(); | ||
} | ||
|
||
@AfterAll | ||
public static void teardown() throws Exception { | ||
container.doStop(); | ||
} | ||
|
||
@Test | ||
public void testResponseClose() { | ||
try (Response response = ClientBuilder.newClient().target(URL).request().get()) { | ||
Assertions.assertEquals(200, response.getStatus()); | ||
Assertions.assertEquals(Resource.class.getName(), response.readEntity(String.class)); | ||
|
||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
tests/integration/jetty-response-close/src/test/resources/surefire.policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (c) 2020 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 | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
// we do not care about java lib itself | ||
grant codebase "file:${java.home}/-" { | ||
permission java.security.AllPermission; | ||
}; | ||
|
||
// we do not care about our dependencies | ||
grant codebase "file:${settings.localRepository}/-" { | ||
permission java.security.AllPermission; | ||
}; | ||
|
||
grant codebase "file:${user.home}/-" { | ||
permission java.io.FilePermission "<<ALL FILES>>", "read"; | ||
}; | ||
|
||
grant { | ||
permission java.lang.management.ManagementPermission "monitor"; | ||
permission java.util.PropertyPermission "*", "read, write"; | ||
permission java.util.logging.LoggingPermission "control"; | ||
permission java.lang.RuntimePermission "setIO"; | ||
permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; | ||
|
||
permission java.lang.RuntimePermission "accessDeclaredMembers"; | ||
permission java.lang.RuntimePermission "modifyThread"; | ||
permission java.io.FilePermission "<<ALL FILES>>", "read"; | ||
|
||
permission java.lang.RuntimePermission "getenv.JETTY_AVAILABLE_PROCESSORS"; | ||
permission java.net.SocketPermission "localhost", "accept,connect,listen,resolve"; | ||
permission java.lang.RuntimePermission "setContextClassLoader"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters