[jruby-joni] 171/279: Add working non-interruptible test case to make sure it return Matcher::INTERRUPTED

Hideki Yamane henrich at moszumanska.debian.org
Mon Nov 16 11:27:25 UTC 2015


This is an automated email from the git hooks/post-receive script.

henrich pushed a commit to branch debian/sid
in repository jruby-joni.

commit b1119e11b4cffb3018e4ae3dc495e95196a64a3d
Author: Thomas E. Enebo <tom.enebo at gmail.com>
Date:   Fri May 10 16:17:39 2013 -0500

    Add working non-interruptible test case to make sure it return Matcher::INTERRUPTED
---
 test/org/joni/test/Test.java          |  4 ++--
 test/org/joni/test/TestInterrupt.java | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/test/org/joni/test/Test.java b/test/org/joni/test/Test.java
index 0887b60..b343f20 100644
--- a/test/org/joni/test/Test.java
+++ b/test/org/joni/test/Test.java
@@ -243,8 +243,8 @@ public abstract class Test {
         }
     }    
 
-    public void x2s(String pattern, String str, int from, int to) {
-        x2s(pattern, str, from, to, option());
+    public int x2s(String pattern, String str, int from, int to) {
+        return x2s(pattern, str, from, to, option());
     }
 
     public int x2s(String pattern, String str, int from, int to, int option) {
diff --git a/test/org/joni/test/TestInterrupt.java b/test/org/joni/test/TestInterrupt.java
index fab5b17..dd1547f 100644
--- a/test/org/joni/test/TestInterrupt.java
+++ b/test/org/joni/test/TestInterrupt.java
@@ -47,7 +47,6 @@ public class TestInterrupt extends Test {
             }
         }, 1000, 15000);
 
-        /*
         final int status[] = new int[1];
         
         interruptAfter(new InterruptibleRunnable() {
@@ -57,7 +56,7 @@ public class TestInterrupt extends Test {
             }
         }, 1000, 15000);
         
-        assertTrue(status[0] == Matcher.INTERRUPTED, "Status was not INTERRUPTED: " + status[0]);*/
+        assertTrue(status[0] == Matcher.INTERRUPTED, "Status was not INTERRUPTED: " + status[0]);
     }
     
     private void interruptAfter(InterruptibleRunnable block, int delayBeforeInterrupt, int acceptableMaximumTime) {
@@ -76,10 +75,11 @@ public class TestInterrupt extends Test {
         try {
             block.run();
         } catch (InterruptedException e) {
-            long total = System.currentTimeMillis() - start[0];
-            System.out.println("Time taken: " + total);
-            assertTrue(total < acceptableMaximumTime, "Took too long to interrupt: " + total + " > " + acceptableMaximumTime);
-        }        
+
+        }
+        long total = System.currentTimeMillis() - start[0];
+        System.out.println("Time taken: " + total);
+        assertTrue(total < acceptableMaximumTime, "Took too long to interrupt: " + total + " > " + acceptableMaximumTime);
     }
         
     public int option() {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jruby-joni.git



More information about the pkg-java-commits mailing list