MethodSourcerTestpublic class MethodSourcerTest extends TestHelper
Fields Summary |
---|
private StringWriter | mWriter | private Output | mOutput |
Methods Summary |
---|
public void | setUp()
mWriter = new StringWriter();
mOutput = new Output(mWriter);
| public void | tearDown()
mWriter = null;
| public void | testReturnMap()
MethodSourcer m = new MethodSourcer(mOutput,
"foo", //classname
Opcodes.ACC_PUBLIC, //access
"getMap_T_U", //name
"()Ljava/util/Map;", //desc
"()Ljava/util/Map<TT;TU;>;", //signature
null); //exception
m.visitEnd();
assertSourceEquals(
"public java.util.Map<T, U> getMap_T_U() { }",
mWriter.toString());
| public void | testVoid()
MethodSourcer m = new MethodSourcer(mOutput,
"foo", //classname
Opcodes.ACC_PUBLIC, //access
"testVoid", //name
"()V", //desc
null, //signature
null); //exception
m.visitEnd();
assertSourceEquals(
"public void testVoid() { }",
mWriter.toString());
| public void | testVoidThrow()
MethodSourcer m = new MethodSourcer(mOutput,
"foo", //classname
Opcodes.ACC_PUBLIC, //access
"testVoid", //name
"()V", //desc
null, //signature
new String[] { "java/lang/Exception" }); //exception
m.visitEnd();
assertSourceEquals(
"public void testVoid() throws java.lang.Exception { }",
mWriter.toString());
|
|