|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.bcel.AbstractTestCase
org.apache.bcel.GeneratingAnnotatedClassesTestCase
public class GeneratingAnnotatedClassesTestCase
The program that some of the tests generate looks like this:
public class HelloWorld
{
public static void main(String[] argv)
{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String name = null;
try
{
name = "Andy";
}
catch (IOException e)
{
return;
}
System.out.println("Hello, " + name);
}
}
| Constructor Summary | |
|---|---|
GeneratingAnnotatedClassesTestCase()
|
|
| Method Summary | |
|---|---|
AnnotationEntryGen |
createCombinedAnnotation(ConstantPoolGen cp)
|
AnnotationEntryGen |
createFruitAnnotation(ConstantPoolGen cp,
String aFruit)
|
AnnotationEntryGen |
createSimpleInvisibleAnnotation(ConstantPoolGen cp)
|
AnnotationEntryGen |
createSimpleVisibleAnnotation(ConstantPoolGen cp)
|
void |
testGenerateClassLevelAnnotations()
Steps in the test: Programmatically construct the HelloWorld program Add two simple annotations at the class level Save the class to disk Reload the class using the 'static' variant of the BCEL classes Check the attributes are OK |
void |
testGenerateMethodLevelAnnotations1()
Just check that we can dump a class that has a method annotation on it and it is still there when we read it back in |
void |
testGenerateMethodLevelAnnotations2()
Going further than the last test - when we reload the method back in, let's change it (adding a new annotation) and then store that, read it back in and verify both annotations are there ! |
void |
testModifyingClasses1()
Load a class in and modify it with a new attribute - A SimpleAnnotation annotation |
void |
testModifyingClasses2()
Load a class in and modify it with a new attribute - A ComplexAnnotation annotation |
void |
testTransformClassToClassGen_ArrayAndAnnotationTypes()
Transform simple class from an immutable to a mutable object. |
void |
testTransformClassToClassGen_EnumType()
Transform simple class from an immutable to a mutable object. |
void |
testTransformClassToClassGen_SimpleTypes()
Transform simple class from an immutable to a mutable object. |
void |
testTransformComplexClassToClassGen()
Transform complex class from an immutable to a mutable object. |
| Methods inherited from class org.apache.bcel.AbstractTestCase |
|---|
createFruitAnnotationEntry, createRepos, createTestdataFile, dumpAnnotationEntries, dumpAnnotationEntries, dumpAttributes, findAttribute, findAttribute, getMethod, getTestClass, wipe, wipe |
| 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GeneratingAnnotatedClassesTestCase()
| Method Detail |
|---|
public void testGenerateClassLevelAnnotations()
throws ClassNotFoundException
ClassNotFoundException
public void testGenerateMethodLevelAnnotations1()
throws ClassNotFoundException
ClassNotFoundException
public void testGenerateMethodLevelAnnotations2()
throws ClassNotFoundException
ClassNotFoundException
public void testTransformClassToClassGen_SimpleTypes()
throws ClassNotFoundException
ClassNotFoundException
public void testTransformClassToClassGen_EnumType()
throws ClassNotFoundException
ClassNotFoundException
public void testTransformClassToClassGen_ArrayAndAnnotationTypes()
throws ClassNotFoundException
ClassNotFoundException
public void testTransformComplexClassToClassGen()
throws ClassNotFoundException
ClassNotFoundException
public void testModifyingClasses1()
throws ClassNotFoundException
ClassNotFoundException
public void testModifyingClasses2()
throws ClassNotFoundException
ClassNotFoundExceptionpublic AnnotationEntryGen createSimpleVisibleAnnotation(ConstantPoolGen cp)
public AnnotationEntryGen createFruitAnnotation(ConstantPoolGen cp,
String aFruit)
public AnnotationEntryGen createCombinedAnnotation(ConstantPoolGen cp)
public AnnotationEntryGen createSimpleInvisibleAnnotation(ConstantPoolGen cp)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||