FieldSourcerTestpublic class FieldSourcerTest extends Object
Fields Summary |
---|
private StringWriter | mWriter |
Methods Summary |
---|
public void | setUp()
mWriter = new StringWriter();
| public void | tearDown()
mWriter = null;
| public void | testStringField()
FieldSourcer fs = new FieldSourcer(new Output(mWriter),
Opcodes.ACC_PUBLIC, // access
"mArg", // name
"Ljava/lang/String;", // desc
null // signature
);
fs.visitEnd();
String s = mWriter.toString();
Assert.assertEquals("public java.lang.String mArg;\n", s);
| public void | testTemplateTypeField()
FieldSourcer fs = new FieldSourcer(new Output(mWriter),
Opcodes.ACC_PRIVATE | Opcodes.ACC_FINAL, // access
"mList", // name
"Ljava/util/ArrayList;", // desc
"Ljava/util/ArrayList<Ljava/lang/String;>;" // signature
);
fs.visitEnd();
String s = mWriter.toString();
Assert.assertEquals("private final java.util.ArrayList<java.lang.String> mList;\n", s);
|
|