SQLite学习笔记20150714-2

来源:互联网 发布:百度指数 数据抓取 编辑:程序博客网 时间:2024/04/27 23:42

【搭建Android Junit Test】


public class TESTPerson extends AndroidTestCase {

public void testCreateDB()
{
DBOpenHelper dbOpenHelper = new DBOpenHelper(getContext());
dbOpenHelper.getWritableDatabase();
Person person = new Person();
new PersonService(getContext()).save(person);
System.out.println("-----------dsdfsdfsdfsd");
}
}

--------------------------------------------------------------------------------------------------------------------------------------------

//AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.ws.person"
    android:versionCode="1"
    android:versionName="1.0" >
    
    <instrumentation 
        android:name="android.test.InstrumentationTestRunner"
        android:targetPackage="com.ws.person"></instrumentation>

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="14" />


    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <uses-library android:name="android.test.runner" />
        <activity
            android:name="com.ws.person.AndroidClientActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        
    </application>  
    
</manifest>
0 0