Commit 1242110c authored by Andre Freyssinet's avatar Andre Freyssinet

Fix compatibility issues with Java 9/10.

parent 8deacb77
......@@ -165,6 +165,7 @@
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
......
......@@ -30,7 +30,7 @@ import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.xml.bind.DatatypeConverter;
import java.util.Base64;
import org.glassfish.jersey.client.ClientConfig;
......@@ -59,7 +59,8 @@ public class AdminREST extends TestCase {
URI uri = target.path("queue").path("myQueue").getUri();
String encodedUserPassword = DatatypeConverter.printBase64Binary("admin:admin".getBytes());
// String encodedUserPassword = DatatypeConverter.printBase64Binary("admin:admin".getBytes());
String encodedUserPassword = Base64.getEncoder().encodeToString("admin:admin".getBytes());
// Create a queue
Response response = client.target(uri).request().header("Authorization", encodedUserPassword).accept(MediaType.TEXT_PLAIN).get();
......
......@@ -33,7 +33,7 @@ import javax.ws.rs.client.Invocation.Builder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.xml.bind.DatatypeConverter;
import java.util.Base64;
import org.glassfish.jersey.client.ClientConfig;
......@@ -172,7 +172,7 @@ public class ClientRESTTextPerf extends TestCase {
public void createQueue(String queueName) throws Exception {
URI uri = target.path("admin").path("queue").path(queueName).getUri();
String encodedUserPassword = DatatypeConverter.printBase64Binary("admin:admin".getBytes());
String encodedUserPassword = Base64.getEncoder().encodeToString("admin:admin".getBytes());
// Create a queue
Response response = client.target(uri).queryParam("bind", true).request().header("Authorization", encodedUserPassword).accept(MediaType.TEXT_PLAIN).get();
if (response.getStatus() != Response.Status.CREATED.getStatusCode())
......@@ -181,7 +181,7 @@ public class ClientRESTTextPerf extends TestCase {
public void deleteQueue(String queueName) throws Exception {
URI uri = target.path("admin").path("queue").path(queueName).getUri();
String encodedUserPassword = DatatypeConverter.printBase64Binary("admin:admin".getBytes());
String encodedUserPassword = Base64.getEncoder().encodeToString("admin:admin".getBytes());
// Create a queue
Response response = client.target(uri).request().header("Authorization", encodedUserPassword).accept(MediaType.TEXT_PLAIN).delete();
if (response.getStatus() != Response.Status.OK.getStatusCode())
......
......@@ -31,7 +31,7 @@ import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.xml.bind.DatatypeConverter;
import java.util.Base64;
import org.glassfish.jersey.client.ClientConfig;
......@@ -57,7 +57,7 @@ public class JmxREST extends TestCase {
Client client = ClientBuilder.newClient(config);
WebTarget target = client.target(Helper.getBaseJmsURI());
String encodedUserPassword = DatatypeConverter.printBase64Binary("admin:admin".getBytes());
String encodedUserPassword = Base64.getEncoder().encodeToString("admin:admin".getBytes());
Gson gson = new GsonBuilder().create();
URI uri = target.path("jmx").getUri();
......
<?xml version="1.0"?>
<!--
- Copyright (C) 2000 - 2012 ScalAgent Distributed Technologies
- Copyright (C) 2000 - 2018 ScalAgent Distributed Technologies
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
......
<?xml version="1.0"?>
<!--
- Copyright (C) 2000 - 2012 ScalAgent Distributed Technologies
- Copyright (C) 2000 - 2018 ScalAgent Distributed Technologies
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment