Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions liberty-maven-plugin/src/it/alt-outputdir-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions liberty-maven-plugin/src/it/binary-scanner-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<version>@pom.version@</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
import static org.junit.Assert.*;
import org.junit.BeforeClass;
import org.junit.Test;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class EndpointTest {
private static String URL;
Expand All @@ -17,20 +20,18 @@ public static void init() {

@Test
public void testServlet() throws Exception {
HttpClient client = new HttpClient();
try (CloseableHttpClient client = HttpClients.createDefault()) {
HttpGet method = new HttpGet(URL);

GetMethod method = new GetMethod(URL);
try (CloseableHttpResponse response = client.execute(method)) {
int statusCode = response.getStatusLine().getStatusCode();

try {
int statusCode = client.executeMethod(method);
assertEquals("HTTP GET failed", HttpStatus.SC_OK, statusCode);

assertEquals("HTTP GET failed", HttpStatus.SC_OK, statusCode);
String responseBody = EntityUtils.toString(response.getEntity());

String response = method.getResponseBodyAsString();

assertTrue("Unexpected response body", response.contains("Hello! How are you today?"));
} finally {
method.releaseConnection();
}
assertTrue("Unexpected response body", responseBody.contains("Hello! How are you today?"));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
import static org.junit.Assert.*;
import org.junit.BeforeClass;
import org.junit.Test;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class EndpointTest {
private static String URL;
Expand All @@ -32,20 +35,18 @@ public static void init() {

@Test
public void testServlet() throws Exception {
HttpClient client = new HttpClient();
try (CloseableHttpClient client = HttpClients.createDefault()) {
HttpGet method = new HttpGet(URL);

GetMethod method = new GetMethod(URL);
try (CloseableHttpResponse response = client.execute(method)) {
int statusCode = response.getStatusLine().getStatusCode();

try {
int statusCode = client.executeMethod(method);
assertEquals("HTTP GET failed", HttpStatus.SC_OK, statusCode);

assertEquals("HTTP GET failed", HttpStatus.SC_OK, statusCode);
String responseBody = EntityUtils.toString(response.getEntity());

String response = method.getResponseBodyAsString();

assertTrue("Unexpected response body", response.contains("Hello! How are you today?"));
} finally {
method.releaseConnection();
}
assertTrue("Unexpected response body", responseBody.contains("Hello! How are you today?"));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
import static org.junit.Assert.*;
import org.junit.BeforeClass;
import org.junit.Test;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class EndpointTest {
private static String URL;
Expand All @@ -32,20 +35,18 @@ public static void init() {

@Test
public void testServlet() throws Exception {
HttpClient client = new HttpClient();
try (CloseableHttpClient client = HttpClients.createDefault()) {
HttpGet method = new HttpGet(URL);

GetMethod method = new GetMethod(URL);
try (CloseableHttpResponse response = client.execute(method)) {
int statusCode = response.getStatusLine().getStatusCode();

try {
int statusCode = client.executeMethod(method);
assertEquals("HTTP GET failed", HttpStatus.SC_OK, statusCode);

assertEquals("HTTP GET failed", HttpStatus.SC_OK, statusCode);
String responseBody = EntityUtils.toString(response.getEntity());

String response = method.getResponseBodyAsString();

assertTrue("Unexpected response body", response.contains("Hello! How are you today?"));
} finally {
method.releaseConnection();
}
assertTrue("Unexpected response body", responseBody.contains("Hello! How are you today?"));
}
}
}
}
6 changes: 3 additions & 3 deletions liberty-maven-plugin/src/it/deploy-loose-config-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
import static org.junit.Assert.*;
import org.junit.BeforeClass;
import org.junit.Test;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class EndpointTest {
private static String URL;
Expand All @@ -32,20 +35,18 @@ public static void init() {

@Test
public void testServlet() throws Exception {
HttpClient client = new HttpClient();
try (CloseableHttpClient client = HttpClients.createDefault()) {
HttpGet method = new HttpGet(URL);

GetMethod method = new GetMethod(URL);
try (CloseableHttpResponse response = client.execute(method)) {
int statusCode = response.getStatusLine().getStatusCode();

try {
int statusCode = client.executeMethod(method);
assertEquals("HTTP GET failed", HttpStatus.SC_OK, statusCode);

assertEquals("HTTP GET failed", HttpStatus.SC_OK, statusCode);
String responseBody = EntityUtils.toString(response.getEntity());

String response = method.getResponseBodyAsString();

assertTrue("Unexpected response body", response.contains("Hello! How are you today?"));
} finally {
method.releaseConnection();
}
assertTrue("Unexpected response body", responseBody.contains("Hello! How are you today?"));
}
}
}
}
6 changes: 3 additions & 3 deletions liberty-maven-plugin/src/it/dev-container-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<version>@pom.version@</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions liberty-maven-plugin/src/it/dev-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<version>@pom.version@</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
<type>war</type>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
import static org.junit.Assert.*;
import org.junit.BeforeClass;
import org.junit.Test;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class EndpointIT {
private static String URL;
Expand All @@ -32,20 +35,18 @@ public static void init() {

@Test
public void testServlet() throws Exception {
HttpClient client = new HttpClient();
try (CloseableHttpClient client = HttpClients.createDefault()) {
HttpGet method = new HttpGet(URL);

GetMethod method = new GetMethod(URL);
try (CloseableHttpResponse response = client.execute(method)) {
int statusCode = response.getStatusLine().getStatusCode();

try {
int statusCode = client.executeMethod(method);
assertEquals("HTTP GET failed", HttpStatus.SC_OK, statusCode);

assertEquals("HTTP GET failed", HttpStatus.SC_OK, statusCode);
String responseBody = EntityUtils.toString(response.getEntity());

String response = method.getResponseBodyAsString(1000);

assertTrue("Unexpected response body", response.contains("Hello EJB World."));
} finally {
method.releaseConnection();
}
assertTrue("Unexpected response body", responseBody.contains("Hello EJB World."));
}
}
}
}
Loading
Loading