From a683b0ea8ef0109e407a1c76574f4a863a126e4f Mon Sep 17 00:00:00 2001 From: David Russell Date: Tue, 31 Mar 2015 14:24:22 +0100 Subject: [PATCH] RW-754: Added self-signed SSL cert support. The DeployR server supports and can be configured to require HTTPS connections from clients. Sometimes (primarily for testing or prototyping) self-signed SSL certificates are used on the server. The client library has been updated to work with servers using self-signed certs: - RClientFactory.createClient(endpoint, allowSelfSignedSSLCert ) To facilitate these changes instances of URL are no longer returned on download calls on the API. In place of URLs, instances of InputStream are returned on the following interfaces: - InputStream RProject.export() - InputStream RProjectFile.download() - InputStream RProjectResult.download() - InputStream RRepositoryFile.download() The underlying URL is still avaiable on the *Details instance associated with the File or Result. All unit tests and tutorial examples have been updated to reflect these changes. --- .../project/AuthProjectDirectory.java | 12 +- .../repository/AuthRepositoryManagement.java | 5 +- .../com/revo/deployr/client/RProject.java | 4 +- .../com/revo/deployr/client/RProjectFile.java | 3 +- .../revo/deployr/client/RProjectResult.java | 8 ++ .../revo/deployr/client/RRepositoryFile.java | 3 +- .../client/about/RProjectFileDetails.java | 12 +- .../client/about/RProjectResultDetails.java | 6 +- .../client/about/RRepositoryFileDetails.java | 7 ++ .../client/api/RProjectDirectoryCalls.java | 4 +- .../client/api/RProjectExecuteCalls.java | 4 +- .../deployr/client/core/RClientExecutor.java | 7 ++ .../deployr/client/core/impl/RClientImpl.java | 85 +++++++++++++- .../client/core/impl/RProjectFileImpl.java | 33 +++--- .../client/core/impl/RProjectImpl.java | 110 +++++++++--------- .../client/core/impl/RProjectResultImpl.java | 49 +++++--- .../client/core/impl/RRepositoryFileImpl.java | 19 ++- .../client/factory/RClientFactory.java | 39 +++++++ test/build.gradle | 4 +- .../java/com/revo/deployr/DeployrUtil.java | 17 +++ ...ClientStandardExecutionModelCallsTest.java | 15 +-- .../com/revo/deployr/client/RClientTest.java | 9 +- .../com/revo/deployr/client/RJobTest.java | 9 +- .../revo/deployr/client/RProjectFileTest.java | 38 +++--- .../deployr/client/RProjectTempClose.java | 9 +- .../com/revo/deployr/client/RProjectTest.java | 26 ++--- .../api/RProjectDirectoryCallsTest.java | 64 +++++----- .../RProjectExecuteCallsLocalPathTest.java | 12 +- .../client/api/RProjectPackageCallsTest.java | 9 +- ...rojectStandardExecutionModelCallsTest.java | 14 +-- .../api/RProjectWorkspaceCallsTest.java | 14 ++- ...erDefaultRepositoryDirectoryCallsTest.java | 92 +-------------- .../RUserDefaultRepositoryFileCallsTest.java | 50 ++++---- ...RUserDefaultRepositoryScriptCallsTest.java | 9 +- ...rExternalRepositoryDirectoryCallsTest.java | 9 +- .../RUserExternalRepositoryFileCallsTest.java | 9 +- ...UserExternalRepositoryScriptCallsTest.java | 9 +- ...RUserExternalRepositoryShellCallsTest.java | 9 +- ...serJobStandardExecutionModelCallsTest.java | 13 ++- .../client/api/RUserProjectCallsTest.java | 9 +- .../client/factory/RDataFactoryTest.java | 9 +- test/src/test/resources/log4j.properties | 2 +- ...t-4c4d0308-579f-4826-a37f-cc80a18e4a2a.zip | Bin 0 -> 10151 bytes 43 files changed, 519 insertions(+), 351 deletions(-) create mode 100644 test/test-4c4d0308-579f-4826-a37f-cc80a18e4a2a.zip diff --git a/examples/tutorial/src/main/java/com/revo/deployr/tutorial/services/project/AuthProjectDirectory.java b/examples/tutorial/src/main/java/com/revo/deployr/tutorial/services/project/AuthProjectDirectory.java index 12ce43f..4260b1d 100644 --- a/examples/tutorial/src/main/java/com/revo/deployr/tutorial/services/project/AuthProjectDirectory.java +++ b/examples/tutorial/src/main/java/com/revo/deployr/tutorial/services/project/AuthProjectDirectory.java @@ -22,7 +22,7 @@ import com.revo.deployr.client.params.DirectoryUploadOptions; import org.apache.log4j.Logger; -import java.net.URL; +import java.io.InputStream; import java.util.List; public class AuthProjectDirectory { @@ -95,9 +95,15 @@ public static void main(String args[]) throws Exception { /* * Download working directory file content using - * standard Java URL. + * standard Java InputStream. */ - URL fileURL = rProjectFile.download(); + InputStream fileStream = null; + try { + fileStream = rProjectFile.download(); + } finally { + if(fileStream != null) + fileStream.close(); + } /* * Retrieve a list of files in the R session's diff --git a/examples/tutorial/src/main/java/com/revo/deployr/tutorial/services/repository/AuthRepositoryManagement.java b/examples/tutorial/src/main/java/com/revo/deployr/tutorial/services/repository/AuthRepositoryManagement.java index ef9530c..8b9a9de 100644 --- a/examples/tutorial/src/main/java/com/revo/deployr/tutorial/services/repository/AuthRepositoryManagement.java +++ b/examples/tutorial/src/main/java/com/revo/deployr/tutorial/services/repository/AuthRepositoryManagement.java @@ -21,7 +21,7 @@ import com.revo.deployr.client.params.RepoUploadOptions; import org.apache.log4j.Logger; -import java.net.URL; +import java.io.InputStream; import java.util.List; public class AuthRepositoryManagement { @@ -82,7 +82,8 @@ public static void main(String args[]) throws Exception { * Download working directory file content using * standard Java URL. */ - URL fileURL = rRepositoryFile.download(); + InputStream downStream = rRepositoryFile.download(); + downStream.close(); /* * Retrieve a list of files in the authenticated user's diff --git a/src/main/java/com/revo/deployr/client/RProject.java b/src/main/java/com/revo/deployr/client/RProject.java index 428e850..5835199 100644 --- a/src/main/java/com/revo/deployr/client/RProject.java +++ b/src/main/java/com/revo/deployr/client/RProject.java @@ -20,7 +20,7 @@ import com.revo.deployr.client.params.ProjectCloseOptions; import com.revo.deployr.client.params.ProjectDropOptions; -import java.net.URL; +import java.io.InputStream; /** * Represents a DeployR managed project. @@ -183,6 +183,6 @@ public RProjectDetails recycle(boolean preserveWorkspace, * @throws RClientException if RClient fails to complete call. * @throws RSecurityException if DeployR server security conditions not met on call. */ - public URL export() throws RClientException, RSecurityException; + public InputStream export() throws RClientException, RSecurityException; } diff --git a/src/main/java/com/revo/deployr/client/RProjectFile.java b/src/main/java/com/revo/deployr/client/RProjectFile.java index 33617c8..bf8a718 100644 --- a/src/main/java/com/revo/deployr/client/RProjectFile.java +++ b/src/main/java/com/revo/deployr/client/RProjectFile.java @@ -16,6 +16,7 @@ import com.revo.deployr.client.params.RepoUploadOptions; import java.net.URL; +import java.io.InputStream; /** * Represents a DeployR project directory file. @@ -65,6 +66,6 @@ public interface RProjectFile { * @throws RSecurityException if DeployR server security conditions not met on call. * @see RProjectFileDetails */ - public URL download() throws RClientException, RSecurityException; + public InputStream download() throws RClientException, RSecurityException; } diff --git a/src/main/java/com/revo/deployr/client/RProjectResult.java b/src/main/java/com/revo/deployr/client/RProjectResult.java index 6d67f8e..746ce38 100644 --- a/src/main/java/com/revo/deployr/client/RProjectResult.java +++ b/src/main/java/com/revo/deployr/client/RProjectResult.java @@ -13,6 +13,7 @@ package com.revo.deployr.client; import com.revo.deployr.client.about.RProjectResultDetails; +import java.io.InputStream; /** * Represents a DeployR project execution result. @@ -34,5 +35,12 @@ public interface RProjectResult { */ public void delete() throws RClientException, RSecurityException; + /** + * Download execution result. + * + * @throws RClientException if RClient fails to complete call. + * @throws RSecurityException if DeployR server security conditions not met on call. + */ + public InputStream download() throws RClientException, RSecurityException; } diff --git a/src/main/java/com/revo/deployr/client/RRepositoryFile.java b/src/main/java/com/revo/deployr/client/RRepositoryFile.java index 0da6c8b..8808ec7 100644 --- a/src/main/java/com/revo/deployr/client/RRepositoryFile.java +++ b/src/main/java/com/revo/deployr/client/RRepositoryFile.java @@ -15,6 +15,7 @@ import com.revo.deployr.client.about.RRepositoryFileDetails; import java.net.URL; +import java.io.InputStream; import java.util.List; /** @@ -95,7 +96,7 @@ public interface RRepositoryFile { * @throws RSecurityException if DeployR server security conditions not met on call. * @see RRepositoryFileDetails */ - public URL download() throws RClientException, RSecurityException; + public InputStream download() throws RClientException, RSecurityException; /** * Delete managed repository file. diff --git a/src/main/java/com/revo/deployr/client/about/RProjectFileDetails.java b/src/main/java/com/revo/deployr/client/about/RProjectFileDetails.java index f43c14a..0e24557 100644 --- a/src/main/java/com/revo/deployr/client/about/RProjectFileDetails.java +++ b/src/main/java/com/revo/deployr/client/about/RProjectFileDetails.java @@ -19,11 +19,16 @@ */ public class RProjectFileDetails { - public RProjectFileDetails(String filename, String descr, String type, long size, URL url) { + public RProjectFileDetails(String filename, + String descr, + String type, + long size, + URL url) { this.filename = filename; this.descr = descr; this.type = type; this.size = size; + this.url = url; } /** @@ -46,4 +51,9 @@ public RProjectFileDetails(String filename, String descr, String type, long size */ public final long size; + /** + * Project directory file URL. + */ + public final URL url; + } diff --git a/src/main/java/com/revo/deployr/client/about/RProjectResultDetails.java b/src/main/java/com/revo/deployr/client/about/RProjectResultDetails.java index 6e4051c..f56bd4b 100644 --- a/src/main/java/com/revo/deployr/client/about/RProjectResultDetails.java +++ b/src/main/java/com/revo/deployr/client/about/RProjectResultDetails.java @@ -19,7 +19,11 @@ */ public class RProjectResultDetails { - public RProjectResultDetails(String execution, String filename, String type, long size, URL url) { + public RProjectResultDetails(String execution, + String filename, + String type, + long size, + URL url) { this.execution = execution; this.filename = filename; this.type = type; diff --git a/src/main/java/com/revo/deployr/client/about/RRepositoryFileDetails.java b/src/main/java/com/revo/deployr/client/about/RRepositoryFileDetails.java index ea7502b..3801b18 100644 --- a/src/main/java/com/revo/deployr/client/about/RRepositoryFileDetails.java +++ b/src/main/java/com/revo/deployr/client/about/RRepositoryFileDetails.java @@ -50,6 +50,7 @@ public RRepositoryFileDetails(String filename, String directory, this.category = category; this.md5 = md5; this.lastModified = lastModified; + this.url = url; } /** @@ -151,4 +152,10 @@ public RRepositoryFileDetails(String filename, String directory, */ public final Date lastModified; + /** + * Repository file url. + */ + public final URL url; + + } diff --git a/src/main/java/com/revo/deployr/client/api/RProjectDirectoryCalls.java b/src/main/java/com/revo/deployr/client/api/RProjectDirectoryCalls.java index 7e7839b..357e70b 100644 --- a/src/main/java/com/revo/deployr/client/api/RProjectDirectoryCalls.java +++ b/src/main/java/com/revo/deployr/client/api/RProjectDirectoryCalls.java @@ -73,7 +73,7 @@ public interface RProjectDirectoryCalls { * @throws RClientException if RClient fails to complete call. * @throws RSecurityException if DeployR server security conditions not met on call. */ - public URL downloadFiles() throws RClientException, RSecurityException; + public InputStream downloadFiles() throws RClientException, RSecurityException; /** * Download files from project directory. @@ -81,6 +81,6 @@ public interface RProjectDirectoryCalls { * @throws RClientException if RClient fails to complete call. * @throws RSecurityException if DeployR server security conditions not met on call. */ - public URL downloadFiles(List files) throws RClientException, RSecurityException; + public InputStream downloadFiles(List files) throws RClientException, RSecurityException; } diff --git a/src/main/java/com/revo/deployr/client/api/RProjectExecuteCalls.java b/src/main/java/com/revo/deployr/client/api/RProjectExecuteCalls.java index 69f6704..e2305f0 100644 --- a/src/main/java/com/revo/deployr/client/api/RProjectExecuteCalls.java +++ b/src/main/java/com/revo/deployr/client/api/RProjectExecuteCalls.java @@ -15,7 +15,7 @@ import com.revo.deployr.client.*; import com.revo.deployr.client.params.ProjectExecutionOptions; -import java.net.URL; +import java.io.InputStream; import java.util.List; /** @@ -215,6 +215,6 @@ public RProjectExecution executeExternal(String externalSource, * @throws RClientException if RClient fails to complete call. * @throws RSecurityException if DeployR server security conditions not met on call. */ - public URL downloadResults() throws RClientException, RSecurityException; + public InputStream downloadResults() throws RClientException, RSecurityException; } diff --git a/src/main/java/com/revo/deployr/client/core/RClientExecutor.java b/src/main/java/com/revo/deployr/client/core/RClientExecutor.java index 9a0a824..37f560c 100644 --- a/src/main/java/com/revo/deployr/client/core/RClientExecutor.java +++ b/src/main/java/com/revo/deployr/client/core/RClientExecutor.java @@ -17,6 +17,10 @@ import com.revo.deployr.client.RSecurityException; import com.revo.deployr.client.call.RCall; +import org.apache.http.client.utils.URIBuilder; + +import java.io.InputStream; + public interface RClientExecutor { public RCoreResult processCall(RCall call) @@ -28,4 +32,7 @@ public RCoreResult processCallOnGrid(RCall call) RSecurityException, RGridException; + public InputStream download(URIBuilder builder) + throws RClientException; + } diff --git a/src/main/java/com/revo/deployr/client/core/impl/RClientImpl.java b/src/main/java/com/revo/deployr/client/core/impl/RClientImpl.java index e27e6da..749a4cc 100644 --- a/src/main/java/com/revo/deployr/client/core/impl/RClientImpl.java +++ b/src/main/java/com/revo/deployr/client/core/impl/RClientImpl.java @@ -70,9 +70,20 @@ import org.apache.http.client.params.CookiePolicy; import org.apache.http.client.params.ClientPNames; import org.apache.http.client.utils.URIBuilder; +import javax.net.ssl.SSLContext; +import org.apache.http.conn.ssl.*; +import org.apache.http.config.*; +import org.apache.http.conn.socket.*; +import org.apache.http.impl.client.HttpClients; +import java.security.cert.X509Certificate; +import java.security.*; + +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; import java.util.*; import java.net.*; +import java.io.*; import java.util.concurrent.Executors; import java.util.concurrent.Callable; @@ -91,6 +102,7 @@ public class RClientImpl implements RClient, RClientExecutor { private ExecutorService eService; private String serverurl; private String httpcookie; + private SSLSocketFactory sslSocketFactory; private RLiveContext liveContext; private ArrayList GRID_EXCEPTION_CODES = new ArrayList( @@ -99,13 +111,24 @@ public class RClientImpl implements RClient, RClientExecutor { public RClientImpl(String serverurl) throws RClientException, RSecurityException { - this(serverurl, 200); + this(serverurl, 200, false); } public RClientImpl(String serverurl, int concurrentCallLimit) throws RClientException, RSecurityException { - log.debug("Creating client connection: serverurl=" + serverurl + " concurrentCallLimit=" + concurrentCallLimit); + this(serverurl, concurrentCallLimit, false); + } + + public RClientImpl(String serverurl, + int concurrentCallLimit, + boolean allowSelfSignedSSLCert) + throws RClientException, RSecurityException { + + + log.debug("Creating client connection: serverurl=" + serverurl + + ", concurrentCallLimit=" + concurrentCallLimit + + ", allowSelfSignedSSLCert=" + allowSelfSignedSSLCert); this.serverurl = serverurl; @@ -114,20 +137,52 @@ public RClientImpl(String serverurl, int concurrentCallLimit) // Set Infinite Connection and Socket Timeouts. HttpConnectionParams.setConnectionTimeout(httpParams, 0); HttpConnectionParams.setSoTimeout(httpParams, 0); - ConnManagerParams.setMaxTotalConnections(httpParams, concurrentCallLimit); - ConnManagerParams.setMaxConnectionsPerRoute(httpParams, new ConnPerRouteBean(concurrentCallLimit)); + ConnManagerParams.setMaxTotalConnections(httpParams, + concurrentCallLimit); + ConnManagerParams.setMaxConnectionsPerRoute(httpParams, + new ConnPerRouteBean(concurrentCallLimit)); HttpProtocolParams.setVersion(httpParams, HttpVersion.HTTP_1_1); // Create and initialize scheme registry SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register( - new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); + new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); + + if(allowSelfSignedSSLCert) { + /* + * Register scheme for "https" that bypasses + * SSL cert trusted-origin verification check + * which makes it possible to connect to a + * DeployR server using a self-signed certificate. + * + * Recommended for prototyping and testing only, + * not recommended for production environments. + */ + TrustStrategy blindTrust = new TrustStrategy() { + @Override + public boolean isTrusted(X509Certificate[] certificate, + String authType) { + return true; + } + }; + try { + sslSocketFactory = new SSLSocketFactory(blindTrust, + SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); + schemeRegistry.register(new Scheme("https", + 8443, sslSocketFactory)); + } catch(GeneralSecurityException gsex) { + String exMsg = "Self-signed SSL cert config failed, " + + gsex.getMessage(); + log.debug(exMsg); + throw new RSecurityException(exMsg, 0); + } + } // Create a HttpClient with the ThreadSafeClientConnManager. // This connection manager must be used if more than one thread will // be using the HttpClient. ClientConnectionManager cm = - new ThreadSafeClientConnManager(httpParams, schemeRegistry); + new ThreadSafeClientConnManager(httpParams, schemeRegistry); httpClient = new DefaultHttpClient(cm, httpParams); @@ -556,6 +611,24 @@ public RCoreResult processCallOnGrid(RCall rCall) return rResult; } + public InputStream download(URIBuilder builder) + throws RClientException { + + try { + log.debug("download: uri builder=" + builder); + String uriPath = builder.build().toString(); + HttpGet request = new HttpGet(uriPath); + HttpResponse response = httpClient.execute(request); + return response.getEntity().getContent(); + + } catch(Exception ex){ + String exMsg = builder + + " download failed, " + ex.getMessage(); + throw new RClientException(exMsg, ex); + } + + } + // Private method implementations. public RCoreResponse execute(RCall call) { diff --git a/src/main/java/com/revo/deployr/client/core/impl/RProjectFileImpl.java b/src/main/java/com/revo/deployr/client/core/impl/RProjectFileImpl.java index 4688c1f..0c10496 100644 --- a/src/main/java/com/revo/deployr/client/core/impl/RProjectFileImpl.java +++ b/src/main/java/com/revo/deployr/client/core/impl/RProjectFileImpl.java @@ -33,11 +33,12 @@ import com.revo.deployr.client.core.REndpoints; import com.revo.deployr.client.util.REntityUtil; +import org.apache.http.client.utils.URIBuilder; + import java.util.List; import java.util.ArrayList; import java.util.Map; -import java.net.URL; -import java.net.MalformedURLException; +import java.io.InputStream; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -121,19 +122,21 @@ public void delete() log.debug("delete: projectFile, success=" + success + " error=" + error + " errorCode=" + errorCode); } - public URL download() - throws RClientException, RSecurityException { - - String urlPath = this.liveContext.serverurl + REndpoints.RPROJECTDIRECTORYDOWNLOAD; - String urlQuery = urlPath + "/" + this.project.id + "/" + this.about.filename + ";jsessionid=" + this.liveContext.httpcookie; - log.debug("download: url=" + urlQuery); - URL downloadURL = null; - try { - downloadURL = new URL(urlQuery); - } catch(MalformedURLException mex) { - throw new RClientException("Download directory file url malformed, ex=" + mex.getMessage()); - } - return downloadURL; + public InputStream download() + throws RClientException, RSecurityException { + + try { + + String urlBase = liveContext.serverurl + + REndpoints.RPROJECTDIRECTORYDOWNLOAD; + String urlPath = urlBase + ";jsessionid=" + liveContext.httpcookie; + URIBuilder builder = new URIBuilder(urlPath); + builder.addParameter("project", this.project.id); + builder.addParameter("filename", this.about.filename); + return liveContext.executor.download(builder); + } catch(Exception dex) { + throw new RClientException("Download failed: " + dex.getMessage()); + } } } diff --git a/src/main/java/com/revo/deployr/client/core/impl/RProjectImpl.java b/src/main/java/com/revo/deployr/client/core/impl/RProjectImpl.java index 9f6de13..963a8c9 100644 --- a/src/main/java/com/revo/deployr/client/core/impl/RProjectImpl.java +++ b/src/main/java/com/revo/deployr/client/core/impl/RProjectImpl.java @@ -308,20 +308,21 @@ public void delete() log.debug("delete: success=" + success + " error=" + error + " errorCode=" + errorCode); } - public URL export() + public InputStream export() throws RClientException, RSecurityException { - String urlPath = this.liveContext.serverurl + REndpoints.RPROJECTEXPORT; - urlPath = urlPath + "/" + this.about.id + ";jsessionid=" + this.liveContext.httpcookie; - log.debug("export: url=" + urlPath); - URL exportURL = null; try { - URIBuilder builder = new URIBuilder(urlPath); - exportURL = builder.build().toURL(); - } catch(Exception uex) { - throw new RClientException("Export url: ex=" + uex.getMessage()); + String urlBase = this.liveContext.serverurl + + REndpoints.RPROJECTEXPORT; + String urlPath = urlBase + "/" + this.about.id + + ";jsessionid=" + this.liveContext.httpcookie; + URIBuilder builder = new URIBuilder(urlPath); + builder.addParameter("project", this.about.id); + return liveContext.executor.download(builder); + } catch(Exception ex) { + throw new RClientException("Export failed: " + + ex.getMessage()); } - return exportURL; } /* @@ -679,20 +680,21 @@ public void deleteResults() log.debug("deleteResults: success=" + success + " error=" + error + " errorCode=" + errorCode); } - public URL downloadResults() + public InputStream downloadResults() throws RClientException, RSecurityException { - String urlPath = this.liveContext.serverurl + REndpoints.RPROJECTEXECUTERESULTDOWNLOAD; - urlPath = urlPath + "/" + this.about.id + ";jsessionid=" + this.liveContext.httpcookie; - log.debug("downloadResults: url=" + urlPath); - URL downloadURL = null; - try { - URIBuilder builder = new URIBuilder(urlPath); - downloadURL = builder.build().toURL(); - } catch(Exception uex) { - throw new RClientException("Download project execution results url: ex=" + uex.getMessage()); - } - return downloadURL; + try { + + String urlPath = liveContext.serverurl + + REndpoints.RPROJECTEXECUTERESULTDOWNLOAD; + urlPath = urlPath + ";jsessionid=" + liveContext.httpcookie; + URIBuilder builder = new URIBuilder(urlPath); + builder.addParameter("project", this.about.id); + return liveContext.executor.download(builder); + } catch(Exception ex) { + throw new RClientException("Download failed: " + + ex.getMessage()); + } } @@ -1000,51 +1002,43 @@ public RProjectFile loadFile(RRepositoryFile repoFile) return projectFile; } - public URL downloadFiles() + public InputStream downloadFiles() throws RClientException, RSecurityException { - - String urlPath = this.liveContext.serverurl + REndpoints.RPROJECTDIRECTORYDOWNLOAD; - urlPath = urlPath + "/" + this.about.id + ";jsessionid=" + this.liveContext.httpcookie; - log.debug("downloadFiles: url=" + urlPath); - URL downloadURL = null; - try { - URIBuilder builder = new URIBuilder(urlPath); - downloadURL = builder.build().toURL(); - } catch(Exception uex) { - throw new RClientException("Download directory archive url: ex=" + uex.getMessage()); - } - return downloadURL; + return downloadFiles(null); } - public URL downloadFiles(List files) + public InputStream downloadFiles(List files) throws RClientException, RSecurityException { - String urlPath = this.liveContext.serverurl + REndpoints.RPROJECTDIRECTORYDOWNLOAD; - - String fileNames = null; - if(files != null) { - for(String fileName : files) { - if(fileNames != null) { - fileNames = fileNames + "," + fileName; - } else { - fileNames = fileName; - } - } - } - - urlPath = urlPath + "/" + this.about.id + "/" + fileNames + ";jsessionid=" + this.liveContext.httpcookie; - log.debug("downloadFiles: url=" + urlPath); - URL downloadURL = null; try { - URIBuilder builder = new URIBuilder(urlPath); - downloadURL = builder.build().toURL(); - } catch(Exception uex) { - throw new RClientException("Download directory files url: ex=" + uex.getMessage()); + + String fileNames = null; + if(files != null) { + for(String fileName : files) { + if(fileNames != null) { + fileNames = fileNames + "," + fileName; + } else { + fileNames = fileName; + } + } + } + + String urlPath = liveContext.serverurl + + REndpoints.RPROJECTDIRECTORYDOWNLOAD; + urlPath = urlPath + ";jsessionid=" + liveContext.httpcookie; + + URIBuilder builder = new URIBuilder(urlPath); + builder.addParameter("project", this.about.id); + if(fileNames != null) { + builder.addParameter("filename", fileNames); + } + return liveContext.executor.download(builder); + } catch(Exception ex) { + throw new RClientException("Download failed: " + + ex.getMessage()); } - return downloadURL; } - /* * RProjectPackageCalls Interfaces. */ diff --git a/src/main/java/com/revo/deployr/client/core/impl/RProjectResultImpl.java b/src/main/java/com/revo/deployr/client/core/impl/RProjectResultImpl.java index d7c012d..5933483 100644 --- a/src/main/java/com/revo/deployr/client/core/impl/RProjectResultImpl.java +++ b/src/main/java/com/revo/deployr/client/core/impl/RProjectResultImpl.java @@ -22,11 +22,13 @@ import com.revo.deployr.client.call.RCall; import com.revo.deployr.client.call.project.ProjectExecuteResultDeleteCall; +import com.revo.deployr.client.core.REndpoints; import com.revo.deployr.client.RClientException; import com.revo.deployr.client.RSecurityException; -import java.net.URL; +import java.io.InputStream; +import org.apache.http.client.utils.URIBuilder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -42,27 +44,48 @@ public class RProjectResultImpl implements RProjectResult { RProjectResultDetails about; RLiveContext liveContext; - public RProjectResultImpl(RProjectDetails project, RProjectResultDetails about, RLiveContext liveContext) { - this.project = project; - this.about = about; - this.liveContext = liveContext; + public RProjectResultImpl(RProjectDetails project, + RProjectResultDetails about, + RLiveContext liveContext) { + this.project = project; + this.about = about; + this.liveContext = liveContext; } public RProjectResultDetails about() { - return this.about; + return this.about; + } + + public InputStream download() + throws RClientException, RSecurityException { + + try { + String urlBase = this.liveContext.serverurl + + REndpoints.RPROJECTEXECUTERESULTDOWNLOAD; + String urlPath = urlBase + ";jsessionid=" + liveContext.httpcookie; + URIBuilder builder = new URIBuilder(urlPath); + builder.addParameter("project", this.project.id); + builder.addParameter("filename", this.about.filename); + return liveContext.executor.download(builder); + } catch(Exception ex) { + throw new RClientException("Download failed: " + + ex.getMessage()); + } } public void delete() - throws RClientException, RSecurityException { + throws RClientException, RSecurityException { - RCall rCall = new ProjectExecuteResultDeleteCall(this.project.id, this.about.execution, this.about.filename); - RCoreResult rResult = liveContext.executor.processCall(rCall); + RCall rCall = new ProjectExecuteResultDeleteCall(this.project.id, + this.about.execution, this.about.filename); + RCoreResult rResult = liveContext.executor.processCall(rCall); - boolean success = rResult.isSuccess(); - String error = rResult.getError(); - int errorCode = rResult.getErrorCode(); + boolean success = rResult.isSuccess(); + String error = rResult.getError(); + int errorCode = rResult.getErrorCode(); - log.debug("delete: success=" + success + " error=" + error + " errorCode=" + errorCode); + log.debug("delete: success=" + success + " error=" + + error + " errorCode=" + errorCode); } } diff --git a/src/main/java/com/revo/deployr/client/core/impl/RRepositoryFileImpl.java b/src/main/java/com/revo/deployr/client/core/impl/RRepositoryFileImpl.java index 0b6cc8f..aea9118 100644 --- a/src/main/java/com/revo/deployr/client/core/impl/RRepositoryFileImpl.java +++ b/src/main/java/com/revo/deployr/client/core/impl/RRepositoryFileImpl.java @@ -34,6 +34,7 @@ import java.util.ArrayList; import java.util.Map; import java.net.*; +import java.io.InputStream; import org.apache.http.client.utils.URIBuilder; import org.apache.commons.logging.Log; @@ -188,26 +189,24 @@ public URL diff() throws RClientException, RSecurityException { return diffURL; } - public URL download() + public InputStream download() throws RClientException, RSecurityException { - URL downloadURL = null; try { - String urlPath = liveContext.serverurl + REndpoints.RREPOSITORYFILEDOWNLOAD; - urlPath = urlPath + ";jsessionid=" + liveContext.httpcookie; - + String urlBase = liveContext.serverurl + + REndpoints.RREPOSITORYFILEDOWNLOAD; + String urlPath = urlBase + ";jsessionid=" + liveContext.httpcookie; URIBuilder builder = new URIBuilder(urlPath); builder.addParameter("filename", this.about.filename); builder.addParameter("directory", this.about.directory); builder.addParameter("author", this.about.author); builder.addParameter("version", this.about.version); - - downloadURL = builder.build().toURL(); - } catch(Exception uex) { - throw new RClientException("Download url: " + downloadURL + ", ex=" + uex.getMessage()); + return liveContext.executor.download(builder); + } catch(Exception ex) { + throw new RClientException("Download failed: " + + ex.getMessage()); } - return downloadURL; } public void delete() diff --git a/src/main/java/com/revo/deployr/client/factory/RClientFactory.java b/src/main/java/com/revo/deployr/client/factory/RClientFactory.java index 25535df..9d9bbc3 100644 --- a/src/main/java/com/revo/deployr/client/factory/RClientFactory.java +++ b/src/main/java/com/revo/deployr/client/factory/RClientFactory.java @@ -57,4 +57,43 @@ public static RClient createClient(String deployrUrl, int concurrentCallLimit) return new RClientImpl(deployrUrl, concurrentCallLimit); } + /** + * Create connection at the specified DeployR URL. + * + * @param deployrUrl url address of DeployR Server + * @param allowSelfSignedSSLCert when enabled, HTTPS connections using self-signed SSL certs are permitted + * @return {@link com.revo.deployr.client.RClient} + */ + public static RClient createClient(String deployrUrl, + boolean allowSelfSignedSSLCert) + throws RClientException, RSecurityException { + + log.debug("RClientFactory: createClient, deployrUrl=" + deployrUrl + + ", allowSelfSignedSSLCert=" + allowSelfSignedSSLCert); + return new RClientImpl(deployrUrl, + 200, + allowSelfSignedSSLCert); + } + + /** + * Create connection at the specified DeployR URL. + * + * @param deployrUrl url address of DeployR Server + * @param concurrentCallLimit beyond which DeployR API calls are queued for execution + * @param allowSelfSignedSSLCert when enabled, HTTPS connections using self-signed SSL certs are permitted + * @return {@link com.revo.deployr.client.RClient} + */ + public static RClient createClient(String deployrUrl, + int concurrentCallLimit, + boolean allowSelfSignedSSLCert) + throws RClientException, RSecurityException { + + log.debug("RClientFactory: createClient, deployrUrl=" + deployrUrl + + ", concurrentCallLimit=" + concurrentCallLimit + + ", allowSelfSignedSSLCert=" + allowSelfSignedSSLCert); + return new RClientImpl(deployrUrl, + concurrentCallLimit, + allowSelfSignedSSLCert); + } + } diff --git a/test/build.gradle b/test/build.gradle index 73defa9..36eca30 100644 --- a/test/build.gradle +++ b/test/build.gradle @@ -23,7 +23,9 @@ dependencies { } test { - systemProperty "url.property", "localhost:7400" + systemProperty "connection.protocol", "http://" + systemProperty "connection.endpoint", "localhost:7400/deployr" + systemProperty "allow.SelfSignedSSLCert", "false" } task wrapper(type: Wrapper) { diff --git a/test/src/test/java/com/revo/deployr/DeployrUtil.java b/test/src/test/java/com/revo/deployr/DeployrUtil.java index 485bf2a..885b562 100644 --- a/test/src/test/java/com/revo/deployr/DeployrUtil.java +++ b/test/src/test/java/com/revo/deployr/DeployrUtil.java @@ -91,6 +91,23 @@ public static String getDataFromURL(URL url) { return null; } + public static String getDataFromStream(InputStream is) { + try { + BufferedReader reader = new BufferedReader(new InputStreamReader(is)); + StringBuffer buff = new StringBuffer(""); + String line; + while ((line = reader.readLine()) != null) { + buff.append(line); + } + reader.close(); + is.close(); + return buff.toString(); + } catch (IOException ex) { + Logger.getLogger(DeployrUtil.class.getName()).log(Level.SEVERE, null, ex); + } + return null; + } + public static RProject createPersistentProject(RUser rUser, String projectName, String projectDesc) { RProject rProject = null; diff --git a/test/src/test/java/com/revo/deployr/client/RClientStandardExecutionModelCallsTest.java b/test/src/test/java/com/revo/deployr/client/RClientStandardExecutionModelCallsTest.java index 4a2a864..88d1161 100644 --- a/test/src/test/java/com/revo/deployr/client/RClientStandardExecutionModelCallsTest.java +++ b/test/src/test/java/com/revo/deployr/client/RClientStandardExecutionModelCallsTest.java @@ -63,14 +63,15 @@ public static void tearDownClass() throws Exception { public void setUp() { try { - url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - - anonymousRClient = RClientFactory.createClient("http://" + url + "/deployr"); - - authenticatedRClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + anonymousRClient =RClientFactory.createClient(url, allowSelfSigned); + authenticatedRClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); rUser = authenticatedRClient.login(rAuthentication); @@ -349,7 +350,7 @@ public void testRClientExecuteScriptExternal() { // Test. try { - scriptExecution = authenticatedRClient.executeExternal(repositoryFile.download().toString(), + scriptExecution = authenticatedRClient.executeExternal(repositoryFile.about().url.toString(), executionOptions); console = scriptExecution.about().console; routputs = scriptExecution.about().workspaceObjects; diff --git a/test/src/test/java/com/revo/deployr/client/RClientTest.java b/test/src/test/java/com/revo/deployr/client/RClientTest.java index b8ed2b1..bf051c1 100644 --- a/test/src/test/java/com/revo/deployr/client/RClientTest.java +++ b/test/src/test/java/com/revo/deployr/client/RClientTest.java @@ -40,11 +40,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); } catch (Exception ex) { if (rClient != null) { rClient.release(); diff --git a/test/src/test/java/com/revo/deployr/client/RJobTest.java b/test/src/test/java/com/revo/deployr/client/RJobTest.java index d263637..781cb8c 100644 --- a/test/src/test/java/com/revo/deployr/client/RJobTest.java +++ b/test/src/test/java/com/revo/deployr/client/RJobTest.java @@ -42,11 +42,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); rUser = rClient.login(rAuthentication); diff --git a/test/src/test/java/com/revo/deployr/client/RProjectFileTest.java b/test/src/test/java/com/revo/deployr/client/RProjectFileTest.java index fe64821..fb72b31 100644 --- a/test/src/test/java/com/revo/deployr/client/RProjectFileTest.java +++ b/test/src/test/java/com/revo/deployr/client/RProjectFileTest.java @@ -20,7 +20,7 @@ import com.revo.deployr.client.params.RepoUploadOptions; import org.junit.*; -import java.net.URL; +import java.io.InputStream; import java.util.List; import static org.junit.Assert.*; @@ -50,11 +50,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - connectUrl = System.getProperty("url.property"); - if (connectUrl == null) { - connectUrl = "localhost:" + DeployrUtil.DEFAULT_PORT; + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); + if (url == null) { + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + connectUrl + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); rUser = rClient.login(rAuthentication); @@ -110,7 +113,7 @@ public void testProjectFileAbout() { RProjectFileDetails fileDetails = null; String expFileName = fileName; String expDescr = fileDesc; - URL resultURL = null; + InputStream resultStream = null; String urlData; // Test. @@ -120,7 +123,7 @@ public void testProjectFileAbout() { fail("rProjectFile.about failed: " + ex.getMessage()); } try { - resultURL = rProjectFile.download(); + resultStream = rProjectFile.download(); } catch (Exception ex) { fail("rProjectFile.download failed: " + ex.getMessage()); } @@ -129,12 +132,13 @@ public void testProjectFileAbout() { assertEquals(expFileName, fileDetails.filename); assertEquals(expDescr, fileDetails.descr); - assertNotNull(resultURL); + assertNotNull(resultStream); - urlData = DeployrUtil.getDataFromURL(resultURL); + urlData = DeployrUtil.getDataFromStream(resultStream); assertNotNull(urlData); - assertEquals(DeployrUtil.encodeString(fileContents), DeployrUtil.encodeString(urlData)); + assertEquals(DeployrUtil.encodeString(fileContents), + DeployrUtil.encodeString(urlData)); } /** @@ -209,7 +213,7 @@ public void testProjectFileStore() { String actualFileName = null; String actualDesc = null; String actualAuthor = null; - URL url = null; + InputStream repoStream = null; // Test error handling. Exception exception = null; @@ -230,13 +234,13 @@ public void testProjectFileStore() { actualFileName = repoFile.about().filename; actualDesc = repoFile.about().descr; actualAuthor = repoFile.about().author; - url = repoFile.download(); + repoStream = repoFile.download(); } catch (Exception ex) { exception = ex; exceptionMsg = "rProjectFile.store failed: "; } - urlData = DeployrUtil.getDataFromURL(url); + urlData = DeployrUtil.getDataFromStream(repoStream); // Test cleanup. try { @@ -314,18 +318,18 @@ public void testProjectFileDownload() { // Test variables. String urlData = null; - URL url = null; + InputStream fileStream = null; //Test. try { - url = rProjectFile.download(); + fileStream = rProjectFile.download(); } catch (Exception ex) { fail("rProjectFile.download failed: " + ex.getMessage()); } // Test asserts. - assertNotNull(url); - urlData = DeployrUtil.getDataFromURL(url); + assertNotNull(fileStream); + urlData = DeployrUtil.getDataFromStream(fileStream); assertNotNull(urlData); assertEquals(DeployrUtil.encodeString(fileContents), DeployrUtil.encodeString(urlData)); } diff --git a/test/src/test/java/com/revo/deployr/client/RProjectTempClose.java b/test/src/test/java/com/revo/deployr/client/RProjectTempClose.java index 4f54c06..13f37a0 100644 --- a/test/src/test/java/com/revo/deployr/client/RProjectTempClose.java +++ b/test/src/test/java/com/revo/deployr/client/RProjectTempClose.java @@ -40,11 +40,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); } catch (Exception ex) { if (rClient != null) { rClient.release(); diff --git a/test/src/test/java/com/revo/deployr/client/RProjectTest.java b/test/src/test/java/com/revo/deployr/client/RProjectTest.java index afa86e9..181d1bc 100644 --- a/test/src/test/java/com/revo/deployr/client/RProjectTest.java +++ b/test/src/test/java/com/revo/deployr/client/RProjectTest.java @@ -22,6 +22,7 @@ import java.io.DataInputStream; import java.io.File; +import java.io.InputStream; import java.io.FileInputStream; import java.io.FileOutputStream; import java.net.URL; @@ -52,11 +53,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); rUser = rClient.login(rAuthentication); rProject = DeployrUtil.createPersistentProject(rUser, projectName, projectDesc); @@ -667,10 +671,9 @@ public void testProjectTestImportExport() { RProjectExecution projectExecution = null; List listProjectExecution = null; List listImportProjectExecution = null; - URL url = null; + InputStream exportStream = null; RProject importProject = null; File importFile = null; - URLConnection urlConnection = null; DataInputStream dis = null; FileOutputStream fos = null; String importProjectName = ""; @@ -700,7 +703,7 @@ public void testProjectTestImportExport() { if (exception == null) { try { - url = rProject.export(); + exportStream = rProject.export(); } catch (Exception ex) { exception = ex; exceptionMsg = "rProject.export failed: "; @@ -709,16 +712,7 @@ public void testProjectTestImportExport() { if (exception == null) { try { - urlConnection = url.openConnection(); - } catch (Exception ex) { - exception = ex; - exceptionMsg = "url.openConnection failed: "; - } - } - - if (exception == null) { - try { - dis = new DataInputStream(urlConnection.getInputStream()); + dis = new DataInputStream(exportStream); } catch (Exception ex) { exception = ex; exceptionMsg = "urlConnection.getInputStream failed: "; diff --git a/test/src/test/java/com/revo/deployr/client/api/RProjectDirectoryCallsTest.java b/test/src/test/java/com/revo/deployr/client/api/RProjectDirectoryCallsTest.java index 1759131..38956a7 100644 --- a/test/src/test/java/com/revo/deployr/client/api/RProjectDirectoryCallsTest.java +++ b/test/src/test/java/com/revo/deployr/client/api/RProjectDirectoryCallsTest.java @@ -21,6 +21,7 @@ import org.junit.*; import java.io.File; +import java.io.InputStream; import java.io.FileInputStream; import java.net.URL; import java.util.ArrayList; @@ -47,13 +48,18 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { + try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); - RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); + RBasicAuthentication rAuthentication = + new RBasicAuthentication("testuser", "changeme"); rUser = rClient.login(rAuthentication); rProject = DeployrUtil.createTemporaryProject(rUser); assert (rProject != null); @@ -129,7 +135,7 @@ public void testProjectDirectoryUploadFile() { String expProjectFileName = ""; String expProjectFileDesc = ""; String urlData = ""; - URL url = null; + InputStream downStream = null; File file = null; // Test error handling. @@ -155,7 +161,6 @@ public void testProjectDirectoryUploadFile() { try { actualProjectFileName = actualProjectFile.about().filename; actualProjectFileDesc = actualProjectFile.about().descr; - url = actualProjectFile.download(); } catch (Exception ex) { exception = ex; exceptionMsg = "actualProjectFile.about failed: "; @@ -164,15 +169,15 @@ public void testProjectDirectoryUploadFile() { if (exception == null) { try { - url = actualProjectFile.download(); + downStream = actualProjectFile.download(); } catch (Exception ex) { exception = ex; - exceptionMsg = "actualProjectFile.about failed: "; + exceptionMsg = "actualProjectFile.download failed: "; } } if (exception == null) { - urlData = DeployrUtil.getDataFromURL(url); + urlData = DeployrUtil.getDataFromStream(downStream); } if (exception == null) { @@ -204,6 +209,8 @@ public void testProjectDirectoryTransferFile() { File file = null; RProjectFile upLoadFile = null; URL urlUpLoadFile = null; + InputStream uploadStream = null; + InputStream downloadStream = null; String urlUploadData = ""; URL urlTransferFile = null; String urlTransferData = ""; @@ -230,7 +237,8 @@ public void testProjectDirectoryTransferFile() { if (exception == null) { try { - urlUpLoadFile = upLoadFile.download(); + urlUpLoadFile = upLoadFile.about().url; + uploadStream = upLoadFile.download(); } catch (Exception ex) { exception = ex; exceptionMsg = "upLoadFile.about failed: "; @@ -250,7 +258,7 @@ public void testProjectDirectoryTransferFile() { try { actualProjectFileName = actualProjectFile.about().filename; actualProjectFileDesc = actualProjectFile.about().descr; - urlTransferFile = actualProjectFile.download(); + downloadStream = actualProjectFile.download(); } catch (Exception ex) { exception = ex; exceptionMsg = "actualProjectFile.about failed: "; @@ -258,14 +266,15 @@ public void testProjectDirectoryTransferFile() { } if (exception == null) { - urlUploadData = DeployrUtil.getDataFromURL(urlUpLoadFile); - urlTransferData = DeployrUtil.getDataFromURL(urlTransferFile); + urlUploadData = DeployrUtil.getDataFromStream(uploadStream); + urlTransferData = DeployrUtil.getDataFromStream(downloadStream); } if (exception == null) { assertEquals(expProjectFileName, actualProjectFileName); assertEquals(expProjectFileDesc, actualProjectFileDesc); - assertEquals(DeployrUtil.encodeString(urlUploadData), DeployrUtil.encodeString(urlTransferData)); + assertEquals(DeployrUtil.encodeString(urlUploadData), + DeployrUtil.encodeString(urlTransferData)); } else { fail(exceptionMsg + exception.getMessage()); } @@ -286,7 +295,7 @@ public void testProjectDirectoryWriteFile() { String expProjectFileDesc = ""; DirectoryUploadOptions options = null; RProjectFile actualProjectFile = null; - URL url = null; + InputStream downStream = null; String urlData = ""; // Test error handling. @@ -319,7 +328,7 @@ public void testProjectDirectoryWriteFile() { if (exception == null) { try { - url = actualProjectFile.download(); + downStream = actualProjectFile.download(); } catch (Exception ex) { exception = ex; exceptionMsg = "actualProjectFile.download failed: "; @@ -327,14 +336,15 @@ public void testProjectDirectoryWriteFile() { } if (exception == null) { - urlData = DeployrUtil.getDataFromURL(url); + urlData = DeployrUtil.getDataFromStream(downStream); } if (exception == null) { // Test asserts. assertEquals(expProjectFileName, actualProjectFileName); assertEquals(expProjectFileDesc, actualProjectFileDesc); - assertEquals(DeployrUtil.encodeString(expContents), DeployrUtil.encodeString(urlData)); + assertEquals(DeployrUtil.encodeString(expContents), + DeployrUtil.encodeString(urlData)); } else { fail(exceptionMsg + exception.getMessage()); } @@ -355,7 +365,7 @@ public void testProjectDirectoryLoadFile() { RepoUploadOptions uploadOptions = null; RRepositoryFile repoFile = null; RProjectFile actualProjectFile = null; - URL url = null; + InputStream downStream = null; String urlData = ""; long actualSize = 0; long expSize = 0; @@ -395,7 +405,7 @@ public void testProjectDirectoryLoadFile() { try { actualProjectFileName = actualProjectFile.about().filename; actualProjectFileDesc = actualProjectFile.about().descr; - url = actualProjectFile.download(); + downStream = actualProjectFile.download(); actualSize = actualProjectFile.about().size; } catch (Exception ex) { exception = ex; @@ -404,7 +414,7 @@ public void testProjectDirectoryLoadFile() { } if (exception == null) { - urlData = DeployrUtil.getDataFromURL(url); + urlData = DeployrUtil.getDataFromStream(downStream); } // Test cleanup. @@ -448,7 +458,7 @@ public void testProjectDirectoryDownloadFiles() { String expProjectFileDesc = ""; RProjectFile actualProjectFile = null; DirectoryUploadOptions options = null; - URL url = null; + InputStream downStream = null; String urlData = ""; // Test error handling. @@ -482,7 +492,7 @@ public void testProjectDirectoryDownloadFiles() { if (exception == null) { try { - url = rProject.downloadFiles(); + downStream = rProject.downloadFiles(); } catch (Exception ex) { exception = ex; exceptionMsg = "rProject.downloadFiles failed: "; @@ -490,7 +500,7 @@ public void testProjectDirectoryDownloadFiles() { } if (exception == null) { - urlData = DeployrUtil.getDataFromURL(url); + urlData = DeployrUtil.getDataFromStream(downStream); } if (exception == null) { @@ -514,7 +524,7 @@ public void testProjectDirectoryDownloadFilesAsList() { DirectoryUploadOptions options = null; String expectedResults = "PK"; String text = "this is a line"; - URL url = null; + InputStream downStream = null; String urlData = ""; RProjectFile projectFile = null; @@ -556,7 +566,7 @@ public void testProjectDirectoryDownloadFilesAsList() { if (exception == null) { try { - url = rProject.downloadFiles(listFiles); + downStream = rProject.downloadFiles(listFiles); } catch (Exception ex) { exception = ex; exceptionMsg = "rProject.downloadFiles failed: "; @@ -564,7 +574,7 @@ public void testProjectDirectoryDownloadFilesAsList() { } if (exception == null) { - urlData = DeployrUtil.getDataFromURL(url); + urlData = DeployrUtil.getDataFromStream(downStream); } if (exception == null) { diff --git a/test/src/test/java/com/revo/deployr/client/api/RProjectExecuteCallsLocalPathTest.java b/test/src/test/java/com/revo/deployr/client/api/RProjectExecuteCallsLocalPathTest.java index df455c9..ba7a0aa 100644 --- a/test/src/test/java/com/revo/deployr/client/api/RProjectExecuteCallsLocalPathTest.java +++ b/test/src/test/java/com/revo/deployr/client/api/RProjectExecuteCallsLocalPathTest.java @@ -59,16 +59,16 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - - url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); - rUser = rClient.login(rAuthentication); - } catch (Exception ex) { if (rClient != null) { rClient.release(); diff --git a/test/src/test/java/com/revo/deployr/client/api/RProjectPackageCallsTest.java b/test/src/test/java/com/revo/deployr/client/api/RProjectPackageCallsTest.java index 3227104..eb2bb83 100644 --- a/test/src/test/java/com/revo/deployr/client/api/RProjectPackageCallsTest.java +++ b/test/src/test/java/com/revo/deployr/client/api/RProjectPackageCallsTest.java @@ -46,11 +46,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); rUser = rClient.login(rAuthentication); rProject = DeployrUtil.createTemporaryProject(rUser); diff --git a/test/src/test/java/com/revo/deployr/client/api/RProjectStandardExecutionModelCallsTest.java b/test/src/test/java/com/revo/deployr/client/api/RProjectStandardExecutionModelCallsTest.java index d1ad3a3..fc02cb6 100644 --- a/test/src/test/java/com/revo/deployr/client/api/RProjectStandardExecutionModelCallsTest.java +++ b/test/src/test/java/com/revo/deployr/client/api/RProjectStandardExecutionModelCallsTest.java @@ -60,16 +60,16 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - - url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); - rUser = rClient.login(rAuthentication); - } catch (Exception ex) { if (rClient != null) { rClient.release(); @@ -332,7 +332,7 @@ public void testRProjectExecuteExternal() { try { temporaryProject = rUser.createProject(); repositoryFile = DeployrUtil.createTemporaryRScript(rUser, true); - projectExecution = temporaryProject.executeExternal(repositoryFile.download().toString(), + projectExecution = temporaryProject.executeExternal(repositoryFile.about().url.toString(), executionOptions); console = projectExecution.about().console; routputs = projectExecution.about().workspaceObjects; diff --git a/test/src/test/java/com/revo/deployr/client/api/RProjectWorkspaceCallsTest.java b/test/src/test/java/com/revo/deployr/client/api/RProjectWorkspaceCallsTest.java index 32d7f02..565ad24 100644 --- a/test/src/test/java/com/revo/deployr/client/api/RProjectWorkspaceCallsTest.java +++ b/test/src/test/java/com/revo/deployr/client/api/RProjectWorkspaceCallsTest.java @@ -49,14 +49,16 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); rUser = rClient.login(rAuthentication); - // create Temp project with x and y numerics rProject = DeployrUtil.createTemporaryProject(rUser); assert (rProject != null); @@ -301,7 +303,7 @@ public void testProjectWorkspaceSaveAndTransferObject() { if (exception == null) { try { - url = projectFile.download(); + url = projectFile.about().url; } catch (Exception ex) { exception = ex; exceptionMsg = "projectFile.about failed: "; @@ -439,7 +441,7 @@ public void testProjectWorkspaceStoreObject() { if (exception == null) { try { - url = repoFile.download(); + url = repoFile.about().url; } catch (Exception ex) { exception = ex; exceptionMsg = "repoFile.about failed: "; diff --git a/test/src/test/java/com/revo/deployr/client/api/RUserDefaultRepositoryDirectoryCallsTest.java b/test/src/test/java/com/revo/deployr/client/api/RUserDefaultRepositoryDirectoryCallsTest.java index 0810a45..aace9d5 100644 --- a/test/src/test/java/com/revo/deployr/client/api/RUserDefaultRepositoryDirectoryCallsTest.java +++ b/test/src/test/java/com/revo/deployr/client/api/RUserDefaultRepositoryDirectoryCallsTest.java @@ -49,11 +49,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); String expResultName = "testuser"; rUser = rClient.login(rAuthentication); @@ -1780,87 +1783,4 @@ public void testUserRepositoryMoveFiles() { * Test of uploadFile method, of class RUserRepositoryFileCalls. */ -/* - @Test - public void testUserRepositoryUploadFile() { - - // Test variables. - String actualRepoFileName = ""; - String actualRepoFileDesc = ""; - String expRepoFileName = ""; - String expRepoFileDesc = ""; - File file = new File("/etc/hosts"); - RepoUploadOptions options = null; - RRepositoryFile repoFile = null; - URL url = null; - String urlData = ""; - - // Test error handling. - Exception exception = null; - String exceptionMsg = ""; - Exception cleanupException = null; - String cleanupExceptionMsg = ""; - - //Test. - expRepoFileName = DeployrUtil.getUniqueFileName("txt"); - expRepoFileDesc = "hosts file"; - options = new RepoUploadOptions(); - options.descr = expRepoFileDesc; - options.filename = expRepoFileName; - - try { - repoFile = rUser.uploadFile(new FileInputStream(file), options); - } catch (Exception ex) { - exception = ex; - exceptionMsg = "rUser.uploadFile failed: "; - } - - if (exception == null) { - try { - actualRepoFileName = repoFile.about().filename; - actualRepoFileDesc = repoFile.about().descr; - } catch (Exception ex) { - exception = ex; - exceptionMsg = "repoFile.about failed: "; - } - } - - if (exception == null) { - try { - url = repoFile.download(); - } catch (Exception ex) { - exception = ex; - exceptionMsg = "repoFile.download failed: "; - } - } - - if (exception == null) { - urlData = DeployrUtil.getDataFromURL(url); - } - - // Test cleanup. - try { - if (repoFile != null) { - repoFile.delete(); - } - } catch (Exception ex) { - cleanupException = ex; - cleanupExceptionMsg = "repoFile.delete failed: "; - } - - if (exception == null) { - // Test assertions. - assertEquals(expRepoFileName, actualRepoFileName); - assertEquals(expRepoFileDesc, actualRepoFileDesc); - assertNotNull(urlData); - } else { - fail(exceptionMsg + exception.getMessage()); - } - - // Test cleanup errors. - if (cleanupException != null) { - fail(cleanupExceptionMsg + cleanupException.getMessage()); - } - } -*/ } diff --git a/test/src/test/java/com/revo/deployr/client/api/RUserDefaultRepositoryFileCallsTest.java b/test/src/test/java/com/revo/deployr/client/api/RUserDefaultRepositoryFileCallsTest.java index d0a35e1..fc7ec6e 100644 --- a/test/src/test/java/com/revo/deployr/client/api/RUserDefaultRepositoryFileCallsTest.java +++ b/test/src/test/java/com/revo/deployr/client/api/RUserDefaultRepositoryFileCallsTest.java @@ -23,6 +23,7 @@ import org.junit.*; import java.io.File; +import java.io.InputStream; import java.io.FileInputStream; import java.net.URL; import java.util.List; @@ -48,11 +49,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); String expResultName = "testuser"; rUser = rClient.login(rAuthentication); @@ -88,7 +92,7 @@ public void testUserRepositoryAboutFile() { String expRepoFileDesc = ""; RepoUploadOptions options = null; RRepositoryFile repoFile = null; - URL url = null; + InputStream downStream = null; String urlData = ""; // Test error handling. @@ -123,7 +127,7 @@ public void testUserRepositoryAboutFile() { if (exception == null) { try { - url = repoFile.download(); + downStream = repoFile.download(); } catch (Exception ex) { exception = ex; exceptionMsg = "repoFile.download failed: "; @@ -131,7 +135,7 @@ public void testUserRepositoryAboutFile() { } if (exception == null) { - urlData = DeployrUtil.getDataFromURL(url); + urlData = DeployrUtil.getDataFromStream(downStream); } // Test cleanup. @@ -148,7 +152,8 @@ public void testUserRepositoryAboutFile() { // Test assertions. assertEquals(expRepoFileName, actualRepoFileName); assertEquals(expRepoFileDesc, actualRepoFileDesc); - assertEquals(DeployrUtil.encodeString(text), DeployrUtil.encodeString(urlData)); + assertEquals(DeployrUtil.encodeString(text), + DeployrUtil.encodeString(urlData)); } else { fail(exceptionMsg + exception.getMessage()); } @@ -173,7 +178,7 @@ public void testUserRepositoryListFiles() { String expRepoFileDesc = ""; RepoUploadOptions options = null; RRepositoryFile repoFile = null; - URL url = null; + InputStream downStream = null; String urlData = ""; List listFiles = null; boolean repoFileFound = false; @@ -210,7 +215,7 @@ public void testUserRepositoryListFiles() { if (exception == null) { try { - url = repoFile.download(); + downStream = repoFile.download(); } catch (Exception ex) { exception = ex; exceptionMsg = "repoFile.download failed: "; @@ -234,7 +239,7 @@ public void testUserRepositoryListFiles() { } if (exception == null) { - urlData = DeployrUtil.getDataFromURL(url); + urlData = DeployrUtil.getDataFromStream(downStream); } // Test cleanup. @@ -499,7 +504,7 @@ public void testUserRepositoryUploadFile() { File file = new File("/etc/hosts"); RepoUploadOptions options = null; RRepositoryFile repoFile = null; - URL url = null; + InputStream downStream = null; String urlData = ""; // Test error handling. @@ -534,7 +539,7 @@ public void testUserRepositoryUploadFile() { if (exception == null) { try { - url = repoFile.download(); + downStream = repoFile.download(); } catch (Exception ex) { exception = ex; exceptionMsg = "repoFile.download failed: "; @@ -542,7 +547,7 @@ public void testUserRepositoryUploadFile() { } if (exception == null) { - urlData = DeployrUtil.getDataFromURL(url); + urlData = DeployrUtil.getDataFromStream(downStream); } // Test cleanup. @@ -584,7 +589,7 @@ public void testUserRepositoryWriteFile() { String expRepoFileDesc = ""; RepoUploadOptions options = null; RRepositoryFile repoFile = null; - URL url = null; + InputStream downStream = null; String urlData = ""; // Test error handling. @@ -619,7 +624,7 @@ public void testUserRepositoryWriteFile() { if (exception == null) { try { - url = repoFile.download(); + downStream = repoFile.download(); } catch (Exception ex) { exception = ex; exceptionMsg = "repoFile.download failed: "; @@ -627,7 +632,7 @@ public void testUserRepositoryWriteFile() { } if (exception == null) { - urlData = DeployrUtil.getDataFromURL(url); + urlData = DeployrUtil.getDataFromStream(downStream); } // Test cleanup. @@ -669,7 +674,7 @@ public void testUserRepositoryDownloadFile() { String expRepoFileDesc = ""; RepoUploadOptions options = null; RRepositoryFile repoFile = null; - URL url = null; + InputStream downStream = null; String urlData = ""; // Test error handling. @@ -704,7 +709,7 @@ public void testUserRepositoryDownloadFile() { if (exception == null) { try { - url = repoFile.download(); + downStream = repoFile.download(); } catch (Exception ex) { exception = ex; exceptionMsg = "repoFile.download failed: "; @@ -712,7 +717,7 @@ public void testUserRepositoryDownloadFile() { } if (exception == null) { - urlData = DeployrUtil.getDataFromURL(url); + urlData = DeployrUtil.getDataFromStream(downStream); } // Test cleanup. @@ -799,7 +804,7 @@ public void testUserRepositoryTransferFile() { if (exception == null) { try { - repoURL = repoFile.download(); + repoURL = repoFile.about().url; } catch (Exception ex) { exception = ex; exceptionMsg = "repoFile.download failed: "; @@ -833,7 +838,7 @@ public void testUserRepositoryTransferFile() { if (exception == null) { try { - repoTransURL = repoTransFile.download(); + repoTransURL = repoTransFile.about().url; } catch (Exception ex) { exception = ex; exceptionMsg = "repoTransFile.download failed: "; @@ -864,7 +869,8 @@ public void testUserRepositoryTransferFile() { assertEquals(expRepoFileName, actualRepoFileName); assertEquals(expRepoFileDesc, actualRepoFileDesc); assertEquals(repoTransFileSize, repoFileSize); - assertEquals(DeployrUtil.encodeString(urlTransData), DeployrUtil.encodeString(urlData)); + assertEquals(DeployrUtil.encodeString(urlTransData), + DeployrUtil.encodeString(urlData)); } else { fail(exceptionMsg + exception.getMessage()); } diff --git a/test/src/test/java/com/revo/deployr/client/api/RUserDefaultRepositoryScriptCallsTest.java b/test/src/test/java/com/revo/deployr/client/api/RUserDefaultRepositoryScriptCallsTest.java index 3bdae39..22c1bd1 100644 --- a/test/src/test/java/com/revo/deployr/client/api/RUserDefaultRepositoryScriptCallsTest.java +++ b/test/src/test/java/com/revo/deployr/client/api/RUserDefaultRepositoryScriptCallsTest.java @@ -44,11 +44,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); String expResultName = "testuser"; rUser = rClient.login(rAuthentication); diff --git a/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryDirectoryCallsTest.java b/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryDirectoryCallsTest.java index 77d81b0..c19e391 100644 --- a/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryDirectoryCallsTest.java +++ b/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryDirectoryCallsTest.java @@ -49,11 +49,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); String expResultName = "testuser"; rUser = rClient.login(rAuthentication); diff --git a/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryFileCallsTest.java b/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryFileCallsTest.java index 1a9eb71..9d0968c 100644 --- a/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryFileCallsTest.java +++ b/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryFileCallsTest.java @@ -48,11 +48,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); String expResultName = "testuser"; rUser = rClient.login(rAuthentication); diff --git a/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryScriptCallsTest.java b/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryScriptCallsTest.java index bcdec73..5d5e39a 100644 --- a/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryScriptCallsTest.java +++ b/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryScriptCallsTest.java @@ -43,11 +43,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); String expResultName = "testuser"; rUser = rClient.login(rAuthentication); diff --git a/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryShellCallsTest.java b/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryShellCallsTest.java index 7bd4a90..9c9ceb9 100644 --- a/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryShellCallsTest.java +++ b/test/src/test/java/com/revo/deployr/client/api/RUserExternalRepositoryShellCallsTest.java @@ -44,11 +44,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); String expResultName = "testuser"; rUser = rClient.login(rAuthentication); diff --git a/test/src/test/java/com/revo/deployr/client/api/RUserJobStandardExecutionModelCallsTest.java b/test/src/test/java/com/revo/deployr/client/api/RUserJobStandardExecutionModelCallsTest.java index e3aa6be..a4f258a 100644 --- a/test/src/test/java/com/revo/deployr/client/api/RUserJobStandardExecutionModelCallsTest.java +++ b/test/src/test/java/com/revo/deployr/client/api/RUserJobStandardExecutionModelCallsTest.java @@ -64,11 +64,14 @@ public static void tearDownClass() throws Exception { public void setUp() { try { - url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); rUser = rClient.login(rAuthentication); @@ -403,7 +406,7 @@ public void testRUserSubmitJobExternal() { repositoryFile = DeployrUtil.createTemporaryRScript(rUser, true); rJob = rUser.submitJobExternal(jobName, jobDescr, - repositoryFile.download().toString(), + repositoryFile.about().url.toString(), jobExecutionOptions); // wait for job to complete @@ -548,7 +551,7 @@ public void testRUserSubmitJobStoreNoProject() { repositoryFile = DeployrUtil.createTemporaryRScript(rUser, true); rJob = rUser.submitJobExternal(jobName, jobDescr, - repositoryFile.download().toString(), + repositoryFile.about().url.toString(), jobExecutionOptions); // wait for job to complete diff --git a/test/src/test/java/com/revo/deployr/client/api/RUserProjectCallsTest.java b/test/src/test/java/com/revo/deployr/client/api/RUserProjectCallsTest.java index 296bb80..a66d5f4 100644 --- a/test/src/test/java/com/revo/deployr/client/api/RUserProjectCallsTest.java +++ b/test/src/test/java/com/revo/deployr/client/api/RUserProjectCallsTest.java @@ -58,11 +58,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); rAuthentication = new RBasicAuthentication("testuser", "changeme"); rUser = rClient.login(rAuthentication); } catch (Exception ex) { diff --git a/test/src/test/java/com/revo/deployr/client/factory/RDataFactoryTest.java b/test/src/test/java/com/revo/deployr/client/factory/RDataFactoryTest.java index 86be67d..c9df881 100644 --- a/test/src/test/java/com/revo/deployr/client/factory/RDataFactoryTest.java +++ b/test/src/test/java/com/revo/deployr/client/factory/RDataFactoryTest.java @@ -48,11 +48,14 @@ public static void tearDownClass() throws Exception { @Before public void setUp() { try { - String url = System.getProperty("url.property"); + String url = System.getProperty("connection.protocol") + + System.getProperty("connection.endpoint"); if (url == null) { - url = "localhost:" + DeployrUtil.DEFAULT_PORT; + fail("setUp: connection.[protocol|endpoint] null."); } - rClient = RClientFactory.createClient("http://" + url + "/deployr"); + boolean allowSelfSigned = + Boolean.valueOf(System.getProperty("allow.SelfSignedSSLCert")); + rClient =RClientFactory.createClient(url, allowSelfSigned); RBasicAuthentication rAuthentication = new RBasicAuthentication("testuser", "changeme"); rUser = rClient.login(rAuthentication); rProject = DeployrUtil.createTemporaryProject(rUser); diff --git a/test/src/test/resources/log4j.properties b/test/src/test/resources/log4j.properties index d58eb1e..a22734c 100644 --- a/test/src/test/resources/log4j.properties +++ b/test/src/test/resources/log4j.properties @@ -2,7 +2,7 @@ log4j.rootLogger=INFO, stdout # DeployR Client Library & Tests -log4j.category.com.revo.deployr.client=INFO +log4j.category.com.revo.deployr.client=DEBUG # Direct log messages to stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender diff --git a/test/test-4c4d0308-579f-4826-a37f-cc80a18e4a2a.zip b/test/test-4c4d0308-579f-4826-a37f-cc80a18e4a2a.zip new file mode 100644 index 0000000000000000000000000000000000000000..7a804d89e5350c0b41bb772e67c0646328610390 GIT binary patch literal 10151 zcmb_?bxd8|w*5hiyVK(CdVu2Y?q0m;!QH)RaVzd_#hv2ra&Rf`QXC%NP44f0@4md7 z-yd)8tYl>;Yh>;*=G<8`8A`HH&{zOCI5>cZrJn@gZ$b0EH#M`j0eLtwn_4=WnK*+S zJ(!goL00cuO^~Ctlf99N8Iz-!k+V_4`Q8@*l=)enLXf0BYCHx8Mm)xhN<2pVQWTj5 zM-2_T6MMO$yK7Qg_}%sGw#Ygv@smfY0s+s*aLxNc-`(#)C~kCuLAtpyk8#lvF_;;X z%)1YhHCLm9lr2$6NB||-4{*EX{u74pDH*&krT;Z)&A%mW=5A)<;%o`Bb7B_P5*KA; z=U_82Gcf@&a+tFiF>-L3vNG}*ahWj!O*y!M+}zy8oa`pdj%H3SHqK7WE_QZCwq~a9 zpYP1V!pdZCXL0K3rle}P$fT|WEmlA?FM^APUP`L0CR9cy4@UzReq$igKsqC4ITI*@ zt{kCuD5I+LeH}`y0F&hVRQ#$F#=6JGdF<0iPp;)FE{5!L`5@nUS>YdcuGCVPxQ{KZnTC{*84p)XR#5q>P_z( zNA=CNd|E3)eHx*-A9*_}%^$z7rvGUMme6d5oiGz^mo!4%*d+FIWM*J13uw~l#|@#I zd?+>XqwfaGsj||7sn6x@y0O1sIt(RJs3**ZDQortjXYZ5UaVyCKc_8NqzB0_6n81o zu|+e*b$H8NT^~%E8MpvLpb@KhLn(L5aq18i*O#;tgbeWwH8aq^qx%@SZV19VbxLO$ zhU*W1RbHi{rSmG$bCf7ZqhW5^@x~f_YksZ>xY;f}n&{T;q%Xbm8ZSde8m5718g*NQ zTEqpuMhuM4^&x9LG~5y+GCDsN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