Android-Junit-TestCase-ClassLoader 讨论下Android的单元测试
2010-08-21 06:18:00 来源:WEB开发网import android.net.Uri;
import android.os.Bundle;
public class MockCursor implements Cursor {
private String [][] dump = new String [][] {
{"kkkk", "2222"},
{"aaaa", "3333"}
};
……………………
…………
……
}
import android.content.ContentResolver;
import android.database.CharArrayBuffer;
import android.database.ContentObserver;
import android.database.Cursor;
import android.database.DataSetObserver;
import android.net.Uri;
import android.os.Bundle;
public class MockCursor implements Cursor {
private String [][] dump = new String [][] {
{"kkkk", "2222"},
{"aaaa", "3333"}
};
……………………
…………
……
}
Manifest.xml
Java代码
< ?xml version="1.0" encoding="utf-8"?>
< manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.demo.contact.test" android:versionCode="1"
android:versionName="1.0">
< application android:icon="@drawable/icon" android:label="@string/app_name">
< uses-library android:name="android.test.runner" />
< /application>
< uses-sdk android:minSdkVersion="7" />
< instrumentation android:targetPackage="com.demo.contact"
android:name="android.test.InstrumentationTestRunner" />
< /manifest>
< ?xml version="1.0" encoding="utf-8"?>
< manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.demo.contact.test" android:versionCode="1"
android:versionName="1.0">
< application android:icon="@drawable/icon" android:label="@string/app_name">
更多精彩
赞助商链接