com.markcrocker.purifier
Class DebugStackMapGenTest

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--com.markcrocker.purifier.DebugStackMapGenTest
All Implemented Interfaces:
junit.framework.Test

public class DebugStackMapGenTest
extends junit.framework.TestCase

This is a test class that is designed for debugging, not testing. It typically is used to find perfectly normal conditions in the large pool of test cases in the TestCases directory. Consequently, failing any of these tests is not necessarily any indication of a real problem, just an indication of some case that the designer is searching for.


Field Summary
private static java.lang.String fileName
           
 
Fields inherited from class junit.framework.TestCase
fName
 
Constructor Summary
DebugStackMapGenTest(java.lang.String name)
           
 
Method Summary
private static void createTest(org.apache.bcel.classfile.Method method, int methodIndex, java.lang.String className, org.apache.bcel.generic.ConstantPoolGen cpg, junit.framework.TestSuite suite)
          Creates a new anonymous inner TestCase for the specified method and adds it to the test suite.
static void main(java.lang.String[] args)
          Main method will automatically run the tests in the console.
static junit.framework.Test suite()
          A test suite that generates StackMapGen.generateStackMap TestCases for every method in every class File in the TestCases directory and subdirectories.
static junit.framework.Test suite(java.io.File testFile, int methodIndex)
          A test suite that generates StackMapGen.generateStackMap TestCases for methods in a class File.
private static junit.framework.Test suite(java.io.File testFile, int methodIndex, java.lang.String methodName)
          A test suite that generates StackMapGen.generateStackMap TestCases for methods in a class File.
static junit.framework.Test suite(java.io.File testFile, java.lang.String methodName)
          A test suite that generates a StackMapGen.generateStackMap TestCase for a method matching methodName in a class File.
 void testLegitBogusInStackMap(org.apache.bcel.generic.MethodGen mg, org.apache.bcel.generic.ConstantPoolGen cpg)
          Finds methods that legitimately have an entry of type ITEM_Bogus.
 
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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

fileName

private static final java.lang.String fileName
Constructor Detail

DebugStackMapGenTest

public DebugStackMapGenTest(java.lang.String name)
Method Detail

testLegitBogusInStackMap

public void testLegitBogusInStackMap(org.apache.bcel.generic.MethodGen mg,
                                     org.apache.bcel.generic.ConstantPoolGen cpg)
Finds methods that legitimately have an entry of type ITEM_Bogus.

suite

public static junit.framework.Test suite()
A test suite that generates StackMapGen.generateStackMap TestCases for every method in every class File in the TestCases directory and subdirectories.

suite

public static junit.framework.Test suite(java.io.File testFile,
                                         java.lang.String methodName)
A test suite that generates a StackMapGen.generateStackMap TestCase for a method matching methodName in a class File.

suite

public static junit.framework.Test suite(java.io.File testFile,
                                         int methodIndex)
A test suite that generates StackMapGen.generateStackMap TestCases for methods in a class File. If a methodIndex is specified, then only the indicated method will generate a TestCase. If methodIndex is set to -1, then the suite will automatically discover how many methods there are in a class to be tested and generate a TestCase for each method.

suite

private static junit.framework.Test suite(java.io.File testFile,
                                          int methodIndex,
                                          java.lang.String methodName)
A test suite that generates StackMapGen.generateStackMap TestCases for methods in a class File. If a methodIndex is specified and the methodName is null, then only the indicated method will generate a TestCase. If methodName non null then a TestCase for the method that matches the name will be generated. If the methodIndex is -1 and the methodName is null, then the suite will automatically discover how many methods there are in a class to be tested and generate a TestCase for each method.

createTest

private static void createTest(org.apache.bcel.classfile.Method method,
                               int methodIndex,
                               java.lang.String className,
                               org.apache.bcel.generic.ConstantPoolGen cpg,
                               junit.framework.TestSuite suite)
Creates a new anonymous inner TestCase for the specified method and adds it to the test suite. Modify the actual test in this method to change what particular test you want the entire suite to run.

main

public static void main(java.lang.String[] args)
Main method will automatically run the tests in the console. With no arguments, it will automatically test ALL of the methods in all of the classes in the TestCases directory. With directory name, it will test all of the classes in the supplied directory. With a file name, it will test all of the methods in that file. Adding a method number to the file name will test just the specified method.