com.thoughtworks.qdox.junit
Class APITestCase

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bycom.thoughtworks.qdox.junit.APITestCase
All Implemented Interfaces:
junit.framework.Test

public abstract class APITestCase
extends junit.framework.TestCase

APITestCase is a JUnit extension that will let you compare two sources (typically one kept as a static expected result and a generated one) on the API level.

This class has been ported from XJavaDoc's CodeTestCase, carrying over only the parts that compare on the API level. The original CodeTestCase also has comparison of Java source AST (Abstract Syntax Trees). This will probably be extracted into a ASTTestCase class and hosted as a separate project somewhere else. It should probably be based on JavaCC for ease of porting.

Author:
Aslak Hellesøy, Laurent Etiemble

Constructor Summary
APITestCase()
           
 
Method Summary
static void assertApiEquals(File expected, File actual)
          Compares API of both sources in the files.
static void assertApiEquals(Reader expected, Reader actual)
          Compares API of both sources in the readers.
static void assertEquals(File expected, File actual)
          Compares API of both sources in the files.
static void assertEquals(Reader expected, Reader actual)
          Compares API of both sources in the readers.
protected  File getDir()
           
protected  File getRootDir()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

APITestCase

public APITestCase()
Method Detail

assertEquals

public static void assertEquals(File expected,
                                File actual)
                         throws FileNotFoundException,
                                UnsupportedEncodingException
Compares API of both sources in the files.

Parameters:
expected - the expected source
actual - the actual source
Throws:
FileNotFoundException
UnsupportedEncodingException

assertEquals

public static void assertEquals(Reader expected,
                                Reader actual)
Compares API of both sources in the readers.

Parameters:
expected - the expected source
actual - the actual source

assertApiEquals

public static void assertApiEquals(File expected,
                                   File actual)
                            throws FileNotFoundException,
                                   UnsupportedEncodingException
Compares API of both sources in the files.

Note: This method is for backward naming compatiblity with xjavadoc.codeunit.CodeTestCase.

Parameters:
expected - the expected source
actual - the actual source
Throws:
FileNotFoundException
UnsupportedEncodingException

assertApiEquals

public static void assertApiEquals(Reader expected,
                                   Reader actual)
Compares API of both sources in the readers.

Note: This method is for backward naming compatiblity with xjavadoc.codeunit.CodeTestCase.

Parameters:
expected - the expected source
actual - the actual source

getDir

protected File getDir()

getRootDir

protected File getRootDir()


Copyright © 2002-2003 ThoughtWorks, Inc. All Rights Reserved.