changeset 22156:50056a161d7f

Replacing time out associated warnings by UnsupportedOperationException. Meaning of exception is probably more straightforward than a soft hint attempted before. Shouldn't influence the way things are build, if tests are skipped.
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Tue, 15 Sep 2015 10:36:04 +0200
parents 48004d27086d
children dc83cc1f94f2
files truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java
diffstat 1 files changed, 6 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java	Tue Sep 15 09:30:22 2015 +0200
+++ b/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java	Tue Sep 15 10:36:04 2015 +0200
@@ -30,8 +30,6 @@
 import com.oracle.truffle.api.vm.TruffleVM;
 import java.io.IOException;
 import java.util.Random;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import static org.junit.Assert.*;
 import org.junit.Test;
 
@@ -41,7 +39,6 @@
  * include in your test suite.
  */
 public abstract class TruffleTCK {
-    private static final Logger LOG = Logger.getLogger(TruffleTCK.class.getName());
     private static final Random RANDOM = new Random();
     private TruffleVM tckVM;
 
@@ -134,18 +131,7 @@
      * @return name of globally exported symbol
      */
     protected String identity() {
-        final long introduced = 1441894042844L;
-        long wait = (System.currentTimeMillis() - introduced) / 36000;
-        if (wait < 100) {
-            wait = 100;
-        }
-        LOG.log(Level.SEVERE, "identity() method not overriden. Waiting for {0} ms", wait);
-        try {
-            Thread.sleep(wait);
-        } catch (InterruptedException ex) {
-            LOG.log(Level.SEVERE, null, ex);
-        }
-        return null;
+        throw new UnsupportedOperationException("identity() method not implemented");
     }
 
     /**
@@ -192,7 +178,7 @@
      * @return name of a function that returns such compound object
      */
     protected String compoundObject() {
-        return null;
+        throw new UnsupportedOperationException("compoundObject() method not implemented");
     }
 
     private TruffleVM vm() throws Exception {
@@ -221,7 +207,7 @@
 
     @Test
     public void testFortyTwoWithCompoundObject() throws Exception {
-        CompoundObject obj = findCompoundSymbol("testFortyTwoWithCompoundObject");
+        CompoundObject obj = findCompoundSymbol();
         if (obj == null) {
             return;
         }
@@ -240,7 +226,7 @@
 
     @Test
     public void testNullInCompoundObject() throws Exception {
-        CompoundObject obj = findCompoundSymbol("testNullInCompoundObject");
+        CompoundObject obj = findCompoundSymbol();
         if (obj == null) {
             return;
         }
@@ -319,7 +305,7 @@
         int a = RANDOM.nextInt(100);
         int b = RANDOM.nextInt(100);
 
-        CompoundObject obj = findCompoundSymbol("testPlusWithIntsOnCompoundObject");
+        CompoundObject obj = findCompoundSymbol();
         if (obj == null) {
             return;
         }
@@ -569,18 +555,8 @@
         return s;
     }
 
-    private CompoundObject findCompoundSymbol(String name) throws Exception {
+    private CompoundObject findCompoundSymbol() throws Exception {
         final String compoundObjectName = compoundObject();
-        if (compoundObjectName == null) {
-            final long introduced = 1441616302340L;
-            long wait = (System.currentTimeMillis() - introduced) / 36000;
-            if (wait < 100) {
-                wait = 100;
-            }
-            LOG.log(Level.SEVERE, "compoundObject() method not overriden! Skipping {1} test for now. But sleeping for {0} ms.", new Object[]{wait, name});
-            Thread.sleep(wait);
-            return null;
-        }
         TruffleVM.Symbol s = vm().findGlobalSymbol(compoundObjectName);
         assert s != null : "Symbol " + compoundObjectName + " is not found!";
         final TruffleVM.Symbol value = s.invoke(null);