Android
junit.extensions
public class

junit.extensions.ExceptionTestCase

java.lang.Object
junit.framework.Assert
junit.framework.TestCase Test
junit.extensions.ExceptionTestCase

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);
 

Summary

Public Constructors

            ExceptionTestCase(String name, Class exception)

Protected Methods

          void  runTest()
Execute the test method expecting that an Exception of class fExpected or one of its subclasses will be thrown
Methods inherited from class junit.framework.TestCase
Methods inherited from class junit.framework.Assert
Methods inherited from class java.lang.Object
Methods inherited from interface junit.framework.Test

Details

Public Constructors

public ExceptionTestCase(String name, Class exception)

Protected Methods

protected void runTest()

Execute the test method expecting that an Exception of class fExpected or one of its subclasses will be thrown

Throws

Throwable
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56