Back to project page android-sqlite-helper.
The source code is released under:
Apache License
If you think the Android project android-sqlite-helper listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package net.ichigotake.sqlitehelper.ddl; //from w ww .j av a 2s . c o m import android.database.sqlite.SQLiteDatabase; import junit.framework.Assert; import net.ichigotake.sqlitehelper.DatabaseHelper; import net.ichigotake.sqlitehelper.MockConfiguration; import net.ichigotake.sqlitehelper.MockTable; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.Robolectric; import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; @Config(emulateSdk = 18) @RunWith(RobolectricTestRunner.class) public class AlterTableTest { @Test public void testBuildQuery() { SQLiteDatabase database = new DatabaseHelper(Robolectric.application, new MockConfiguration()) .getWritableDatabase(); AlterTable alterTable = new AlterTable(database, new MockTable()); String expected = "ALTER TABLE mock ADD COLUMN category_id INTEGER"; Assert.assertEquals(expected, alterTable.buildQuery(MockTable.Field.CATEGORY_ID)); } }