站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

NbTestSuite (NB JUnit) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.nbjunit/1 1.41

org.netbeans.junit
Class NbTestSuite

java.lang.Object
  extended by junit.framework.TestSuite
      extended by org.netbeans.junit.NbTestSuite
All Implemented Interfaces:
junit.framework.Test, NbTest
Direct Known Subclasses:
MultiTestSuite

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, warning
 
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.

Overrides:
addTest in class junit.framework.TestSuite

addTestSuite

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

Overrides:
addTestSuite in class junit.framework.TestSuite

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 fails 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 fails 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.41

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