junit.extensions
クラス ExceptionTestCase

java.lang.Object
  拡張junit.framework.Assert
      拡張junit.framework.TestCase
          拡張junit.extensions.ExceptionTestCase
すべての実装インタフェース:
Test

public class ExceptionTestCase
extends TestCase

A TestCase that expects an Exception of class fExpected to be thrown. The other way to check that an expected exception is thrown is:

 try {
   shouldThrow();
 }
 catch (SpecialException e) {
   return;
 }
 fail("Expected SpecialException");
 
To use ExceptionTestCase, create a TestCase like:
 new ExceptionTestCase("testShouldThrow", SpecialException.class);
 


コンストラクタの概要
ExceptionTestCase(java.lang.String name, java.lang.Class exception)
           
 
メソッドの概要
protected  void runTest()
          Execute the test method expecting that an Exception of class fExpected or one of its subclasses will be thrown
 
クラス junit.framework.TestCase から継承したメソッド
countTestCases, createResult, getName, run, run, runBare, setName, setUp, tearDown, toString
 
クラス junit.framework.Assert から継承したメソッド
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

ExceptionTestCase

public ExceptionTestCase(java.lang.String name,
                         java.lang.Class exception)
メソッドの詳細

runTest

protected void runTest()
                throws java.lang.Throwable
Execute the test method expecting that an Exception of class fExpected or one of its subclasses will be thrown

オーバーライド:
クラス TestCase 内の runTest
例外:
java.lang.Throwable - if any exception is thrown


Copyright © 2001-2004 JUnit.org. All Rights Reserved.