com.markcrocker.purifier
Class StackMapGenTest

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

public class StackMapGenTest
extends junit.framework.TestCase


Field Summary
private static java.lang.String fileName
           
 
Fields inherited from class junit.framework.TestCase
fName
 
Constructor Summary
StackMapGenTest(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 StackMapGenTest 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 testGenerateStackMap(org.apache.bcel.generic.MethodGen mg, org.apache.bcel.generic.ConstantPoolGen cpg)
          Tests StackMapGen.generateStackMap method by comparing it against the pre- existing StackMap.
 
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

StackMapGenTest

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

testGenerateStackMap

public void testGenerateStackMap(org.apache.bcel.generic.MethodGen mg,
                                 org.apache.bcel.generic.ConstantPoolGen cpg)
Tests StackMapGen.generateStackMap method by comparing it against the pre- existing StackMap. Naturally, this requires that the method come from a class that has already been preverified by Sun's preverifier.

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 StackMapGenTest for the specified method and adds it to the test suite.

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.