changeset 2363:f8ef157f2d73

fix unit tests given www.orthanc-server.com now mandatory uses HTTPS
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Aug 2017 15:04:20 +0200
parents f47fd47b3c91
children ae50eccd41b7
files UnitTestsSources/LuaTests.cpp UnitTestsSources/RestApiTests.cpp
diffstat 2 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/UnitTestsSources/LuaTests.cpp	Mon Aug 21 13:53:29 2017 +0200
+++ b/UnitTestsSources/LuaTests.cpp	Mon Aug 21 15:04:20 2017 +0200
@@ -287,9 +287,15 @@
 {
   Orthanc::LuaContext lua;
 
-#if UNIT_TESTS_WITH_HTTP_CONNEXIONS == 1  
-  lua.Execute("JSON = loadstring(HttpGet('http://www.orthanc-server.com/downloads/third-party/JSON.lua')) ()");
-  const std::string url("http://www.orthanc-server.com/downloads/third-party/Product.json");
+#if UNIT_TESTS_WITH_HTTP_CONNEXIONS == 1
+  // It is not guaranteed that the URL on server
+  // "www.montefiore.ulg.ac.be" will work forever. We switched to it,
+  // as the "www.orthanc-server.com" now mandatory uses HTTPS.
+  const std::string BASE = "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/";
+  //const std::string BASE = "http://www.orthanc-server.com/downloads/third-party/";
+
+  lua.Execute("JSON = loadstring(HttpGet('" + BASE + "JSON.lua')) ()");
+  const std::string url(BASE + "Product.json");
 #endif
 
   std::string s;
--- a/UnitTestsSources/RestApiTests.cpp	Mon Aug 21 13:53:29 2017 +0200
+++ b/UnitTestsSources/RestApiTests.cpp	Mon Aug 21 15:04:20 2017 +0200
@@ -66,8 +66,15 @@
   ASSERT_FALSE(c.IsVerbose());
 
 #if UNIT_TESTS_WITH_HTTP_CONNEXIONS == 1
+  // It is not guaranteed that the URL on server
+  // "www.montefiore.ulg.ac.be" will work forever. We switched to it,
+  // as the "www.orthanc-server.com" now mandatory uses HTTPS.
+  const std::string BASE = "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/";
+  //const std::string BASE = "http://www.orthanc-server.com/downloads/third-party/";
+
   Json::Value v;
-  c.SetUrl("http://www.orthanc-server.com/downloads/third-party/Product.json");
+  c.SetUrl(BASE + "Product.json");
+
   c.Apply(v);
   ASSERT_TRUE(v.type() == Json::objectValue);
   ASSERT_TRUE(v.isMember("Description"));