org.netbeans.modules.nbjunit/1 1.29

org.netbeans.junit
Class NbTestSuite

java.lang.Object
  extended byjunit.framework.TestSuite
      extended byorg.netbeans.junit.NbTestSuite
All Implemented Interfaces:
NbTest, junit.framework.Test

public class NbTestSuite
extends junit.framework.TestSuite
implements NbTest

NetBeans extension to JUnit's TestSuite class.


Constructor Summary
NbTestSuite()
          Constructs an empty TestSuite.
NbTestSuite(Class theClass)
          Constructs a TestSuite from the given class.
NbTestSuite(String name)
          Constructs an empty TestSuite.
 
Method Summary
 void addTest(junit.framework.Test test)
          Adds a test to the suite.
 void addTestSuite(Class testClass)
          adds a test suite to this test suite
 boolean canRun()
          Checks if a test isn't filtered out by the active filter.
 String getExpectedFail()
          Returns expected fail message.
static NbTestSuite linearSpeedSuite(Class clazz, int slowness, int repeat)
          Factory method to create a special execution suite that not only executes the tests but also measures the times each execution took.
 void setFilter(Filter filter)
          Sets active filter.
static NbTestSuite speedSuite(Class clazz, int slowness, int repeat)
          Factory method to create a special execution suite that not only executes the tests but also measures the times each execution took.
 
Methods inherited from class junit.framework.TestSuite
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
 
Methods inherited from interface junit.framework.Test
countTestCases, run
 

Constructor Detail

NbTestSuite

public NbTestSuite()
Constructs an empty TestSuite.


NbTestSuite

public NbTestSuite(Class theClass)
Constructs a TestSuite from the given class. Adds all the methods starting with "test" as test cases to the suite.


NbTestSuite

public NbTestSuite(String name)
Constructs an empty TestSuite.

Method Detail

addTest

public void addTest(junit.framework.Test test)
Adds a test to the suite.


addTestSuite

public void addTestSuite(Class testClass)
adds a test suite to this test suite


setFilter

public void setFilter(Filter filter)
Sets active filter.

Specified by:
setFilter in interface NbTest
Parameters:
filter - Filter to be set as active for current test, null will reset filtering.

canRun

public boolean canRun()
Checks if a test isn't filtered out by the active filter.

Specified by:
canRun in interface NbTest
Returns:
true if the test can run

getExpectedFail

public String getExpectedFail()
Description copied from interface: NbTest
Returns expected fail message.

Specified by:
getExpectedFail in interface NbTest
Returns:
expected fail message if it's expected this test fail, null otherwise.

speedSuite

public static NbTestSuite speedSuite(Class clazz,
                                     int slowness,
                                     int repeat)
Factory method to create a special execution suite that not only executes the tests but also measures the times each execution took. It then compares the times and files if the difference is too big. Test tests can be executed more times to eliminate the effect of GC and hotspot compiler.

Parameters:
clazz - the class to create tests for (from methods starting with test)
slowness - this must be true: slowness * min < max
repeat - number of times to repeat the test

linearSpeedSuite

public static NbTestSuite linearSpeedSuite(Class clazz,
                                           int slowness,
                                           int repeat)
Factory method to create a special execution suite that not only executes the tests but also measures the times each execution took. It then compares the times devided by the size of query and files if the difference is too big. Test tests can be executed more times to eliminate the effect of GC and hotspot compiler.

Parameters:
clazz - the class to create tests for (from methods starting with test)
slowness - this must be true: slowness * min < max
repeat - number of times to repeat the test

org.netbeans.modules.nbjunit/1 1.29

Built on May 12 2006.  |  Portions Copyright 1997-2006 Sun Microsystems, Inc. All rights reserved.