randoop.util
Class ReflectionExecutor

Object
  extended by ReflectionExecutor

public final class ReflectionExecutor
extends Object

Executes the code of a ReflectionCode object. This class maintains an "executor" thread. Code is executed on that thread. If the code takes longer than the specified timeout, the thread is killed and a ReflectionExecutor.TimeoutExceeded exception is reported.


Nested Class Summary
Modifier and Type Class and Description
static class ReflectionExecutor.TimeoutExceeded
           
 
Field Summary
Modifier and Type Field and Description
static int timeout
          After this many milliseconds, a non-returning method call, and its associated test, are stopped forcefully.
static boolean usethreads
          Use if Randoop is exhibiting nonterminating behavior: this is usually due to execution of code under test that results in an infinite loop.
 
Constructor Summary
Constructor and Description
ReflectionExecutor()
           
 
Method Summary
Modifier and Type Method and Description
static double excepExecAvgMillis()
           
static int excepExecs()
           
static Throwable executeReflectionCode(ReflectionCode code, PrintStream out)
           
static double normalExecAvgMillis()
           
static int normalExecs()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

usethreads

public static boolean usethreads
Use if Randoop is exhibiting nonterminating behavior: this is usually due to execution of code under test that results in an infinite loop. With this option, Randoop executes each test in a separate thread and kills tests that take too long to finish. Tests killed in this manner are not reported to the user. The downside is a BIG (order-of-magnitude) decrease in generation speed.


timeout

public static int timeout
After this many milliseconds, a non-returning method call, and its associated test, are stopped forcefully. Only meaningful if --usethreads is also specified.

Constructor Detail

ReflectionExecutor

public ReflectionExecutor()
Method Detail

normalExecs

public static int normalExecs()

excepExecs

public static int excepExecs()

normalExecAvgMillis

public static double normalExecAvgMillis()

excepExecAvgMillis

public static double excepExecAvgMillis()

executeReflectionCode

public static Throwable executeReflectionCode(ReflectionCode code,
                                              PrintStream out)