JML

org.jmlspecs.jmlunit.strategies
Class LimitedTestSuite

java.lang.Object
  extended byjunit.framework.TestSuite
      extended byorg.jmlspecs.jmlunit.strategies.LimitedTestSuite
All Implemented Interfaces:
junit.framework.Test

public class LimitedTestSuite
extends junit.framework.TestSuite

A kind of test suite that only allows the first n tests to be added, and ignores the rest.

Author:
Gary T. Leavens
See Also:
TestSuite

Class Specifications

Specifications inherited from class Object
represents objectState <- org.jmlspecs.lang.JMLDataGroup.IT;
public represents _getClass <- \typeof(this);

Model Field Summary
 
Model fields inherited from class java.lang.Object
_getClass, objectState, theString
 
Ghost Field Summary
 
Ghost fields inherited from class java.lang.Object
objectTimesFinalized, owner
 
Field Summary
[spec_public] protected  int limit
           
 
Fields inherited from class junit.framework.TestSuite
 
Constructor Summary
LimitedTestSuite(int n)
          Initialize this LimitedTestSuite to have the given limit.
LimitedTestSuite(String name, int n)
          Initialize this LimitedTestSuite to have the given limit.
 
Model Method Summary
 
Model methods inherited from class java.lang.Object
hashValue
 
Method Summary
 void addTest(junit.framework.Test test)
          Add a test to this test suite, or throw a TestSuiteFullException if this test suite is already full.
 
Methods inherited from class junit.framework.TestSuite
addTestSuite, countTestCases, createTest, getName, getTestConstructor, run, runTest, setName, testAt, testCount, tests, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

limit

protected int limit
Specifications: spec_public
Constructor Detail

LimitedTestSuite

public LimitedTestSuite(int n)
Initialize this LimitedTestSuite to have the given limit.

Specifications:
requires n >= 0;
assignable limit;
ensures limit == n;

LimitedTestSuite

public LimitedTestSuite(String name,
                        int n)
Initialize this LimitedTestSuite to have the given limit.

Specifications:
requires n >= 0;
assignable limit, objectState;
ensures limit == n;
Method Detail

addTest

public void addTest(junit.framework.Test test)
Add a test to this test suite, or throw a TestSuiteFullException if this test suite is already full.

Overrides:
addTest in class junit.framework.TestSuite
Specifications:
     also
public behavior
assignable objectState;
signals_only TestSuiteFullException;
signals (TestSuiteFullException) testCount() >= limit;

JML

JML is Copyright (C) 1998-2002 by Iowa State University 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. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.