JET

edu.utep.cs.jet.rat
Class IncrementalRandomTestCaseGenerator

java.lang.Object
  extended by edu.utep.cs.jet.rat.TestCaseGenerator
      extended by edu.utep.cs.jet.rat.IncrementalRandomTestCaseGenerator

public class IncrementalRandomTestCaseGenerator
extends TestCaseGenerator

A class to generate test cases randomly. This class generates values of object types incrementally in that every method or constructor, selected randomly, is checked on-the-fly to ensure a successful invocation of the method or constructor, i.e., no exception and no assertion violation.

Version:
$Revision: 1.7 $
Author:
Yoonsik Cheon

Field Summary
protected  Context context
          The testing context.
 
Constructor Summary
IncrementalRandomTestCaseGenerator()
          Constructs an object for generating test cases.
 
Method Summary
 void generate()
          Generates test cases.
 void generate(Context context)
          Generates test cases under the given testing context.
protected  Denotable[] generateArguments()
          Generates and returns test arguments to generate a new test case.
protected  Denotable generateReceiver()
          Generates and returns a receiver to generate a new test case.
protected  TestCase generateTestCase()
          Generates and returns a new test case.
protected  void reset(Context context)
          Resets this object to generate test cases under the given testing context.
 Iterable<TestCase> testcases()
          Returns an iterator that iterates over the generated test cases.
protected  ValueGenerator valueGenerator()
          Returns the value generator.
 
Methods inherited from class edu.utep.cs.jet.rat.TestCaseGenerator
addTestCaseGenerationListener, getInstance, notifyFailure, notifyMeaningless, notifyRedundant, notifySuccess, removeTestCaseGenerationListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected Context context
The testing context.

Constructor Detail

IncrementalRandomTestCaseGenerator

public IncrementalRandomTestCaseGenerator()
Constructs an object for generating test cases.

Method Detail

valueGenerator

protected ValueGenerator valueGenerator()
Returns the value generator. This method is overridden here to return an incremental value generator.


generate

public void generate(Context context)
Generates test cases under the given testing context. Whenever a new test case is generated, this method notifies all the currenly registered listeners. The generated test cases can also be obtained by calling the iterator testcases().

Specified by:
generate in class TestCaseGenerator

generate

public void generate()
Generates test cases. Whenever a new test case is generated, this method notifies all the currenly registered listeners. The generated test cases can also be obtained by calling the iterator testcases().


testcases

public Iterable<TestCase> testcases()
Returns an iterator that iterates over the generated test cases.

Specified by:
testcases in class TestCaseGenerator

reset

protected void reset(Context context)
Resets this object to generate test cases under the given testing context.

Overrides:
reset in class TestCaseGenerator

generateTestCase

protected TestCase generateTestCase()
Generates and returns a new test case.


generateReceiver

protected Denotable generateReceiver()
Generates and returns a receiver to generate a new test case.


generateArguments

protected Denotable[] generateArguments()
Generates and returns test arguments to generate a new test case.


JET

JET is Copyright (C) 2005-2008 by The University of Texas at El Paso and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.