roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [roller] branch roller-5.2.x updated: Skip feed fetcher tests on Java 1.7 which does not support TLS 1.2.
Date Sun, 09 Jun 2019 13:18:27 GMT
This is an automated email from the ASF dual-hosted git repository.

snoopdave pushed a commit to branch roller-5.2.x
in repository https://gitbox.apache.org/repos/asf/roller.git


The following commit(s) were added to refs/heads/roller-5.2.x by this push:
     new 41ba970  Skip feed fetcher tests on Java 1.7 which does not support TLS 1.2.
41ba970 is described below

commit 41ba970af6d7b932601dca39e279d33c707a2015
Author: snoopdave@gmail.com <snoopdave@gmail.com>
AuthorDate: Sun Jun 9 09:18:20 2019 -0400

    Skip feed fetcher tests on Java 1.7 which does not support TLS 1.2.
---
 .../planet/business/RomeFeedFetcherTest.java       | 27 ++++++++++++++++++----
 .../business/SingleThreadedFeedUpdaterTest.java    |  7 +++++-
 2 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/app/src/test/java/org/apache/roller/planet/business/RomeFeedFetcherTest.java
b/app/src/test/java/org/apache/roller/planet/business/RomeFeedFetcherTest.java
index 0f5e9e5..d01c4dc 100644
--- a/app/src/test/java/org/apache/roller/planet/business/RomeFeedFetcherTest.java
+++ b/app/src/test/java/org/apache/roller/planet/business/RomeFeedFetcherTest.java
@@ -16,15 +16,13 @@
 
 package org.apache.roller.planet.business;
 
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import junit.framework.TestCase;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.weblogger.TestUtils;
 import org.apache.roller.planet.business.fetcher.FeedFetcher;
 import org.apache.roller.planet.business.fetcher.FetcherException;
 import org.apache.roller.planet.pojos.Subscription;
+import org.apache.roller.weblogger.TestUtils;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 
 
@@ -46,9 +44,23 @@ public class RomeFeedFetcherTest extends TestCase {
     
     protected void tearDown() throws Exception {
     }
-    
-    
+
+    static boolean shouldSkip() {
+
+        if (System.getProperty("java.version").startsWith("1.7")) {
+            log.warn("Skipping testFetchFeed because free-of-charge versions of " +
+                "Java 1.7 do not support TLS 1.2 which is now in common usage.");
+            return true;
+        }
+        return false;
+    }
+
     public void testFetchFeed() throws FetcherException {
+
+        if (shouldSkip()) {
+            return;
+        }
+
         try {
             FeedFetcher feedFetcher = WebloggerFactory.getWeblogger().getFeedFetcher();
             
@@ -69,6 +81,11 @@ public class RomeFeedFetcherTest extends TestCase {
     
     
     public void testFetchFeedConditionally() throws FetcherException {
+
+        if (shouldSkip()) {
+            return;
+        }
+
         try {
             FeedFetcher feedFetcher = WebloggerFactory.getWeblogger().getFeedFetcher();
             
diff --git a/app/src/test/java/org/apache/roller/planet/business/SingleThreadedFeedUpdaterTest.java
b/app/src/test/java/org/apache/roller/planet/business/SingleThreadedFeedUpdaterTest.java
index 4c03c4b..860dafd 100644
--- a/app/src/test/java/org/apache/roller/planet/business/SingleThreadedFeedUpdaterTest.java
+++ b/app/src/test/java/org/apache/roller/planet/business/SingleThreadedFeedUpdaterTest.java
@@ -39,6 +39,7 @@ public class SingleThreadedFeedUpdaterTest extends TestCase {
     
     
     protected void setUp() throws Exception {
+
         // setup planet
         TestUtils.setupWeblogger();
         
@@ -58,7 +59,11 @@ public class SingleThreadedFeedUpdaterTest extends TestCase {
     
     
     public void testUpdateSubscription() throws Exception {
-        
+
+        if (RomeFeedFetcherTest.shouldSkip()) {
+            return;
+        }
+
         PlanetManager mgr = WebloggerFactory.getWeblogger().getPlanetManager();
         Subscription sub = mgr.getSubscriptionById(testSub.getId());
         


Mime
View raw message