FileDocCategorySizeDatePackage
FieldSourcerTest.javaAPI DocAndroid 1.5 API2099Wed May 06 22:41:10 BST 2009com.android.mkstubs.sourcer

FieldSourcerTest

public class FieldSourcerTest extends Object

Fields Summary
private StringWriter
mWriter
Constructors Summary
Methods Summary
public voidsetUp()

        mWriter = new StringWriter();
    
public voidtearDown()

        mWriter = null;
    
public voidtestStringField()

        
        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 voidtestTemplateTypeField()

        
        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);