Convert from HttpClient 3.1 to HttpClient 4.3
This commit is contained in:
parent
48c679babc
commit
d932f851e9
7 changed files with 153 additions and 134 deletions
Binary file not shown.
|
@ -2,9 +2,10 @@
|
|||
|
||||
package edu.cornell.mannlib.vitro.webapp.controller.edit;
|
||||
|
||||
import static javax.servlet.http.HttpServletResponse.SC_UNAUTHORIZED;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
@ -42,7 +43,7 @@ public class PrimitiveDelete extends VitroAjaxController {
|
|||
|
||||
if( !hasPermission ){
|
||||
//if not okay, send error message
|
||||
doError(response,"Insufficent permissions.", HttpStatus.SC_UNAUTHORIZED);
|
||||
doError(response,"Insufficent permissions.", SC_UNAUTHORIZED);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
package edu.cornell.mannlib.vitro.webapp.controller.edit;
|
||||
|
||||
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
|
@ -11,9 +13,9 @@ import java.util.Set;
|
|||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.http.HttpStatus;
|
||||
|
||||
import com.hp.hpl.jena.ontology.OntModel;
|
||||
import com.hp.hpl.jena.rdf.model.Model;
|
||||
|
@ -66,7 +68,7 @@ public class PrimitiveRdfEdit extends VitroAjaxController {
|
|||
try {
|
||||
additions = parseRdfParam(vreq.getParameterValues("additions"),format);
|
||||
} catch (Exception e) {
|
||||
doError(response,"Error reading RDF, set log level to debug for this class to get error messages in the server logs.",HttpStatus.SC_BAD_REQUEST);
|
||||
doError(response,"Error reading RDF, set log level to debug for this class to get error messages in the server logs.",SC_BAD_REQUEST);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -74,7 +76,7 @@ public class PrimitiveRdfEdit extends VitroAjaxController {
|
|||
try {
|
||||
retractions = parseRdfParam(vreq.getParameterValues("retractions"),format);
|
||||
} catch (Exception e) {
|
||||
doError(response,"Error reading RDF, set log level to debug for this class to get error messages in the server logs.",HttpStatus.SC_BAD_REQUEST);
|
||||
doError(response,"Error reading RDF, set log level to debug for this class to get error messages in the server logs.",SC_BAD_REQUEST);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,9 +2,13 @@
|
|||
|
||||
package edu.cornell.mannlib.vitro.webapp.controller.edit;
|
||||
|
||||
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
|
||||
import static javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
|
||||
import static javax.servlet.http.HttpServletResponse.SC_OK;
|
||||
import static javax.servlet.http.HttpServletResponse.SC_UNAUTHORIZED;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
@ -57,7 +61,7 @@ public class ReorderController extends VitroAjaxController {
|
|||
if (rankPredicate == null) {
|
||||
errorMsg = "No rank parameter specified";
|
||||
log.error(errorMsg);
|
||||
doError(response, errorMsg, HttpServletResponse.SC_BAD_REQUEST );
|
||||
doError(response, errorMsg, SC_BAD_REQUEST );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -65,7 +69,7 @@ public class ReorderController extends VitroAjaxController {
|
|||
if (individualUris == null || individualUris.length == 0) {
|
||||
errorMsg = "No individuals specified";
|
||||
log.error(errorMsg);
|
||||
doError(response, errorMsg, HttpServletResponse.SC_BAD_REQUEST);
|
||||
doError(response, errorMsg, SC_BAD_REQUEST);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -73,7 +77,7 @@ public class ReorderController extends VitroAjaxController {
|
|||
if( vreq.getWebappDaoFactory() == null) {
|
||||
errorMsg = "No WebappDaoFactory available";
|
||||
log.error(errorMsg);
|
||||
doError(response, errorMsg, HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||
doError(response, errorMsg, SC_INTERNAL_SERVER_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -81,7 +85,7 @@ public class ReorderController extends VitroAjaxController {
|
|||
if( dpsDao == null) {
|
||||
errorMsg = "No DataPropertyStatementDao available";
|
||||
log.error(errorMsg);
|
||||
doError(response, errorMsg, HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||
doError(response, errorMsg, SC_INTERNAL_SERVER_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -91,7 +95,7 @@ public class ReorderController extends VitroAjaxController {
|
|||
boolean hasPermission = true;
|
||||
if( !hasPermission ){
|
||||
//if not okay, send error message
|
||||
doError(response,"Insufficent permissions", HttpStatus.SC_UNAUTHORIZED);
|
||||
doError(response,"Insufficent permissions", SC_UNAUTHORIZED);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -100,7 +104,7 @@ public class ReorderController extends VitroAjaxController {
|
|||
reorderIndividuals(individualUris, vreq, rankPredicate);
|
||||
|
||||
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.setStatus(SC_OK);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -7,20 +7,25 @@ import java.io.ByteArrayOutputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringWriter;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
|
||||
import org.apache.commons.httpclient.NameValuePair;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.commons.httpclient.params.HttpMethodParams;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.client.utils.URIBuilder;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.openrdf.model.Resource;
|
||||
import org.openrdf.repository.RepositoryConnection;
|
||||
import org.openrdf.repository.RepositoryException;
|
||||
|
@ -41,7 +46,6 @@ import com.hp.hpl.jena.rdf.model.ModelFactory;
|
|||
import com.hp.hpl.jena.rdf.model.RDFNode;
|
||||
import com.hp.hpl.jena.rdf.model.Statement;
|
||||
import com.hp.hpl.jena.rdf.model.StmtIterator;
|
||||
import com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.SparqlGraph;
|
||||
import edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeListener;
|
||||
|
@ -65,7 +69,7 @@ public class RDFServiceSparql extends RDFServiceImpl implements RDFService {
|
|||
protected String updateEndpointURI;
|
||||
private HTTPRepository readRepository;
|
||||
private HTTPRepository updateRepository;
|
||||
private HttpClient httpClient;
|
||||
private CloseableHttpClient httpClient;
|
||||
private boolean useSesameContextQuery = true;
|
||||
// the number of triples to be
|
||||
private static final int CHUNK_SIZE = 1000; // added/removed in a single
|
||||
|
@ -88,9 +92,9 @@ public class RDFServiceSparql extends RDFServiceImpl implements RDFService {
|
|||
this.readRepository = new HTTPRepository(readEndpointURI);
|
||||
this.updateRepository = new HTTPRepository(updateEndpointURI);
|
||||
|
||||
MultiThreadedHttpConnectionManager mgr = new MultiThreadedHttpConnectionManager();
|
||||
mgr.getParams().setDefaultMaxConnectionsPerHost(50);
|
||||
this.httpClient = new HttpClient(mgr);
|
||||
PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();
|
||||
cm.setDefaultMaxPerRoute(50);
|
||||
this.httpClient = HttpClients.custom().setConnectionManager(cm).build();
|
||||
|
||||
testConnection();
|
||||
}
|
||||
|
@ -285,23 +289,19 @@ public class RDFServiceSparql extends RDFServiceImpl implements RDFService {
|
|||
|
||||
//QueryEngineHTTP qh = new QueryEngineHTTP(readEndpointURI, queryStr);
|
||||
|
||||
GetMethod meth = new GetMethod(readEndpointURI);
|
||||
try {
|
||||
meth.addRequestHeader("Accept", "application/sparql-results+xml");
|
||||
NameValuePair param = new NameValuePair();
|
||||
param.setName("query");
|
||||
param.setValue(queryStr);
|
||||
NameValuePair[] params = new NameValuePair[1];
|
||||
params[0] = param;
|
||||
meth.setQueryString(params);
|
||||
int response = httpClient.executeMethod(meth);
|
||||
if (response > 399) {
|
||||
log.error("response " + response + " to query. \n");
|
||||
HttpGet meth = new HttpGet(new URIBuilder(readEndpointURI).addParameter("query", queryStr).build());
|
||||
meth.addHeader("Accept", "application/sparql-results+xml");
|
||||
CloseableHttpResponse response = httpClient.execute(meth);
|
||||
try {
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if (statusCode > 399) {
|
||||
log.error("response " + statusCode + " to query. \n");
|
||||
log.debug("update string: \n" + queryStr);
|
||||
throw new RDFServiceException("Unable to perform SPARQL UPDATE");
|
||||
}
|
||||
|
||||
InputStream in = meth.getResponseBodyAsStream();
|
||||
InputStream in = response.getEntity().getContent();
|
||||
ResultSet resultSet = ResultSetFactory.fromXML(in);
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
|
||||
|
@ -323,11 +323,13 @@ public class RDFServiceSparql extends RDFServiceImpl implements RDFService {
|
|||
}
|
||||
InputStream result = new ByteArrayInputStream(outputStream.toByteArray());
|
||||
return result;
|
||||
} finally {
|
||||
response.close();
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
throw new RuntimeException(ioe);
|
||||
} finally {
|
||||
//qh.close();
|
||||
meth.releaseConnection();
|
||||
} catch (URISyntaxException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -486,20 +488,19 @@ public class RDFServiceSparql extends RDFServiceImpl implements RDFService {
|
|||
|
||||
protected void executeUpdate(String updateString) throws RDFServiceException {
|
||||
try {
|
||||
PostMethod meth = new PostMethod(updateEndpointURI);
|
||||
HttpPost meth = new HttpPost(updateEndpointURI);
|
||||
meth.addHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||
meth.setEntity(new UrlEncodedFormEntity(Arrays.asList(new BasicNameValuePair("update", updateString))));
|
||||
CloseableHttpResponse response = httpClient.execute(meth);
|
||||
try {
|
||||
meth.addRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||
NameValuePair[] body = new NameValuePair[1];
|
||||
body[0] = new NameValuePair("update", updateString);
|
||||
meth.setRequestBody(body);
|
||||
int response = httpClient.executeMethod(meth);
|
||||
if (response > 399) {
|
||||
log.error("response " + response + " to update. \n");
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if (statusCode > 399) {
|
||||
log.error("response " + statusCode + " to update. \n");
|
||||
//log.debug("update string: \n" + updateString);
|
||||
throw new RDFServiceException("Unable to perform SPARQL UPDATE");
|
||||
}
|
||||
} finally {
|
||||
meth.releaseConnection();
|
||||
response.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RDFServiceException("Unable to perform change set update", e);
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
package edu.cornell.mannlib.vitro.webapp.servlet.setup;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.ConnectException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.SocketTimeoutException;
|
||||
|
@ -13,12 +12,14 @@ import java.net.UnknownHostException;
|
|||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpException;
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.http.HttpException;
|
||||
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 edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
|
||||
import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
|
||||
|
@ -142,7 +143,10 @@ public class SolrSmokeTest implements ServletContextListener {
|
|||
}
|
||||
|
||||
private void reportPingProblem(SolrProblemException e) {
|
||||
ss.warning(listener, "The Solr search engine did not respond to a 'ping' request", e);
|
||||
ss.warning(
|
||||
listener,
|
||||
"The Solr search engine did not respond to a 'ping' request",
|
||||
e);
|
||||
}
|
||||
|
||||
private void warnSocketTimeout() {
|
||||
|
@ -203,7 +207,8 @@ public class SolrSmokeTest implements ServletContextListener {
|
|||
private static final long SLEEP_INTERVAL = 20000; // 20 seconds
|
||||
|
||||
private final URL solrUrl;
|
||||
private final HttpClient httpClient = new HttpClient();
|
||||
private final CloseableHttpClient httpClient = HttpClients
|
||||
.createDefault();
|
||||
|
||||
private int statusCode;
|
||||
|
||||
|
@ -230,23 +235,22 @@ public class SolrSmokeTest implements ServletContextListener {
|
|||
}
|
||||
|
||||
private void tryToConnect() throws SolrProblemException {
|
||||
GetMethod method = new GetMethod(solrUrl.toExternalForm());
|
||||
try {
|
||||
HttpGet method = new HttpGet(solrUrl.toExternalForm());
|
||||
SolrSmokeTest.log.debug("Trying to connect to Solr");
|
||||
statusCode = httpClient.executeMethod(method);
|
||||
CloseableHttpResponse response = httpClient.execute(method);
|
||||
try {
|
||||
statusCode = response.getStatusLine().getStatusCode();
|
||||
SolrSmokeTest.log.debug("HTTP status was " + statusCode);
|
||||
|
||||
// clear the buffer.
|
||||
InputStream stream = method.getResponseBodyAsStream();
|
||||
stream.close();
|
||||
} finally {
|
||||
response.close();
|
||||
}
|
||||
} catch (SocketTimeoutException e) {
|
||||
// Catch the exception so we can retry this.
|
||||
// Save the status so we know why we failed.
|
||||
statusCode = SolrSmokeTest.SOCKET_TIMEOUT_STATUS;
|
||||
} catch (Exception e) {
|
||||
throw new SolrProblemException(e);
|
||||
} finally {
|
||||
method.releaseConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -275,30 +279,30 @@ public class SolrSmokeTest implements ServletContextListener {
|
|||
*/
|
||||
private static class SolrPinger {
|
||||
private final URL solrUrl;
|
||||
private final HttpClient httpClient = new HttpClient();
|
||||
private final CloseableHttpClient httpClient = HttpClients
|
||||
.createDefault();
|
||||
|
||||
public SolrPinger(URL solrUrl) {
|
||||
this.solrUrl = solrUrl;
|
||||
}
|
||||
|
||||
public void ping() throws SolrProblemException {
|
||||
GetMethod method = new GetMethod(solrUrl.toExternalForm() + "/admin/ping");
|
||||
try {
|
||||
HttpGet method = new HttpGet(solrUrl.toExternalForm()
|
||||
+ "/admin/ping");
|
||||
SolrSmokeTest.log.debug("Trying to ping Solr");
|
||||
int statusCode = httpClient.executeMethod(method);
|
||||
CloseableHttpResponse response = httpClient.execute(method);
|
||||
SolrSmokeTest.log.debug("Finished pinging Solr");
|
||||
|
||||
// clear the buffer.
|
||||
InputStream stream = method.getResponseBodyAsStream();
|
||||
stream.close();
|
||||
|
||||
try {
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if (statusCode != HttpStatus.SC_OK) {
|
||||
throw new SolrProblemException(statusCode);
|
||||
}
|
||||
} finally {
|
||||
response.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new SolrProblemException(e);
|
||||
} finally {
|
||||
method.releaseConnection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,12 +19,14 @@ import javax.servlet.ServletContextEvent;
|
|||
import javax.servlet.ServletContextListener;
|
||||
|
||||
import org.apache.commons.dbcp.BasicDataSource;
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
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 edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
|
||||
import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
|
||||
|
@ -70,7 +72,8 @@ public class OpenSocialSmokeTests implements ServletContextListener {
|
|||
configProps = ConfigurationProperties.getBean(ctx);
|
||||
|
||||
/*
|
||||
* If OpenSocial is not configured in runtime.properties, skip the tests.
|
||||
* If OpenSocial is not configured in runtime.properties, skip the
|
||||
* tests.
|
||||
*/
|
||||
if (!configurationPresent()) {
|
||||
ss.info(this, "The OpenSocial connection is not configured.");
|
||||
|
@ -210,14 +213,15 @@ public class OpenSocialSmokeTests implements ServletContextListener {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the Token Service info from runtime.properties. It must be in the form
|
||||
* of host:port, and may not refer to localhost.
|
||||
* Get the Token Service info from runtime.properties. It must be in the
|
||||
* form of host:port, and may not refer to localhost.
|
||||
*/
|
||||
private void checkTokenServiceInfo() {
|
||||
String tsInfo = configProps.getProperty(PROPERTY_SHINDIG_TOKEN_SERVICE);
|
||||
if (StringUtils.isEmpty(tsInfo)) {
|
||||
warnings.add(new Warning("There is no value for '"
|
||||
+ PROPERTY_SHINDIG_TOKEN_SERVICE + "' in runtime.properties"));
|
||||
+ PROPERTY_SHINDIG_TOKEN_SERVICE
|
||||
+ "' in runtime.properties"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -346,7 +350,8 @@ public class OpenSocialSmokeTests implements ServletContextListener {
|
|||
|
||||
private final String shindigBaseUrl;
|
||||
private final String shindigTestUrl;
|
||||
private final HttpClient httpClient = new HttpClient();
|
||||
private final CloseableHttpClient httpClient = HttpClients
|
||||
.createDefault();
|
||||
|
||||
private int statusCode = Integer.MIN_VALUE;
|
||||
|
||||
|
@ -375,15 +380,16 @@ public class OpenSocialSmokeTests implements ServletContextListener {
|
|||
}
|
||||
|
||||
private void testConnection() throws ShindigTesterException {
|
||||
GetMethod method = new GetMethod(shindigTestUrl);
|
||||
HttpGet method = new HttpGet(shindigTestUrl);
|
||||
try {
|
||||
log.debug("Trying to connect to Shindig");
|
||||
statusCode = httpClient.executeMethod(method);
|
||||
CloseableHttpResponse response = httpClient.execute(method);
|
||||
try {
|
||||
statusCode = response.getStatusLine().getStatusCode();
|
||||
log.debug("HTTP status was " + statusCode);
|
||||
|
||||
// clear the buffer.
|
||||
InputStream stream = method.getResponseBodyAsStream();
|
||||
stream.close();
|
||||
} finally {
|
||||
response.close();
|
||||
}
|
||||
} catch (SocketTimeoutException e) {
|
||||
// Catch the exception so we can retry this.
|
||||
// Save the status so we know why we failed.
|
||||
|
@ -391,8 +397,6 @@ public class OpenSocialSmokeTests implements ServletContextListener {
|
|||
} catch (Exception e) {
|
||||
throw new ShindigTesterException(e, shindigBaseUrl,
|
||||
shindigTestUrl);
|
||||
} finally {
|
||||
method.releaseConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -513,7 +517,7 @@ public class OpenSocialSmokeTests implements ServletContextListener {
|
|||
try {
|
||||
log.debug("Connecting to the token service");
|
||||
Socket s = new Socket(host, port);
|
||||
|
||||
try {
|
||||
s.getOutputStream().write("c=default\n".getBytes());
|
||||
|
||||
int byteCount = 0;
|
||||
|
@ -533,6 +537,9 @@ public class OpenSocialSmokeTests implements ServletContextListener {
|
|||
log.debug("Recieved the token.");
|
||||
problem = null;
|
||||
}
|
||||
} finally {
|
||||
s.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.debug("Problem with the token service", e);
|
||||
problem = e;
|
||||
|
|
Loading…
Add table
Reference in a new issue