Home
last modified time | relevance | path

Searched refs:mDatabase (Results 1 – 20 of 20) sorted by relevance

/cts/tests/tests/database/src/android/database/sqlite/cts/
DSQLiteSecurityTest.java36 private SQLiteDatabase mDatabase; field in SQLiteSecurityTest
43 mDatabase = getContext().openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, in setUp()
45 assertNotNull(mDatabase); in setUp()
50 mDatabase.close(); in tearDown()
57 mDatabase.beginTransaction(); in testScript1()
58 mDatabase.execSQL("CREATE VIRTUAL TABLE ft USING fts3;"); in testScript1()
59 mDatabase.execSQL("INSERT INTO ft_content VALUES(1,'aback');"); in testScript1()
60 mDatabase.execSQL("INSERT INTO ft_content VALUES(2,'abaft');"); in testScript1()
61 mDatabase.execSQL("INSERT INTO ft_content VALUES(3,'abandon');"); in testScript1()
62 mDatabase.execSQL("INSERT INTO ft_segdir VALUES(0,0,0,0,'0 29',X" in testScript1()
[all …]
DSQLiteDatabaseTest.java55 private SQLiteDatabase mDatabase; field in SQLiteDatabaseTest
87 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile, null); in setUp()
88 assertNotNull(mDatabase); in setUp()
102 mDatabase.close(); in closeAndDeleteDatabase()
174 mDatabase.execSQL("CREATE TABLE test (num INTEGER);"); in testTransaction()
175 mDatabase.execSQL("INSERT INTO test (num) VALUES (0)"); in testTransaction()
183 assertFalse(mDatabase.inTransaction()); in testTransaction()
184 mDatabase.beginTransaction(); in testTransaction()
185 assertTrue(mDatabase.inTransaction()); in testTransaction()
187 mDatabase.setTransactionSuccessful(); in testTransaction()
[all …]
DDatabaseStatementTest.java44 private SQLiteDatabase mDatabase; field in DatabaseStatementTest
51 mDatabase = getContext().openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null); in setUp()
52 assertNotNull(mDatabase); in setUp()
53 mDatabase.setVersion(CURRENT_DATABASE_VERSION); in setUp()
58 mDatabase.close(); in tearDown()
73 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); in populateDefaultTable()
75 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString1 + "');"); in populateDefaultTable()
76 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString2 + "');"); in populateDefaultTable()
77 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');"); in populateDefaultTable()
83 SQLiteStatement statement = mDatabase.compileStatement("DELETE FROM test"); in testExecuteStatement()
[all …]
DSQLiteStatementTest.java51 private SQLiteDatabase mDatabase; field in SQLiteStatementTest
58 mDatabase = getContext().openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null); in setUp()
59 assertNotNull(mDatabase); in setUp()
60 mDatabase.setVersion(CURRENT_DATABASE_VERSION); in setUp()
65 mDatabase.close(); in tearDown()
71 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); in populateDefaultTable()
75 mDatabase.execSQL("CREATE TABLE blob_test (_id INTEGER PRIMARY KEY, data BLOB)"); in populateBlobTable()
80 mDatabase.insert("blob_test", null, values); in populateBlobTable()
85 mDatabase.disableWriteAheadLogging(); in testExecute()
88 assertEquals(0, DatabaseUtils.longForQuery(mDatabase, "select count(*) from test", null)); in testExecute()
[all …]
DSQLiteProgramTest.java33 private SQLiteDatabase mDatabase; field in SQLiteProgramTest
40 mDatabase = getContext().openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null); in setUp()
41 assertNotNull(mDatabase); in setUp()
46 mDatabase.close(); in tearDown()
53 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, text1 TEXT, text2 TEXT, " + in testBind()
55 mDatabase.execSQL("INSERT INTO test (text1, text2, num1, num2, image) " + in testBind()
57 mDatabase.execSQL("INSERT INTO test (text1, text2, num1, num2, image) " + in testBind()
61 statement = mDatabase.compileStatement("SELECT num1 FROM test WHERE num2 = ?;"); in testBind()
70 statement = mDatabase.compileStatement("SELECT text1 FROM test WHERE text2 = ?;"); in testBind()
92 cursor = mDatabase.query("test", new String[]{"text1"}, "where text1='a'", in testBind()
[all …]
DSQLiteQueryBuilderTest.java50 private SQLiteDatabase mDatabase; field in SQLiteQueryBuilderTest
60 mDatabase = Objects.requireNonNull( in setUp()
68 mDatabase.close(); in tearDown()
147 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, " + in testSetCursorFactory()
149 mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');"); in testSetCursorFactory()
150 mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('jack', '40', 'LA');"); in testSetCursorFactory()
154 Cursor cursor = sqliteQueryBuilder.query(mDatabase, new String[] { "name", "age" }, in testSetCursorFactory()
168 cursor = sqliteQueryBuilder.query(mDatabase, new String[] { "name", "age" }, in testSetCursorFactory()
245 Cursor cursor = sqliteQueryBuilder.query(mDatabase, in testQuery()
265 cursor = sqliteQueryBuilder.query(mDatabase, in testQuery()
[all …]
DSQLiteCursorTest.java40 private SQLiteDatabase mDatabase; field in SQLiteCursorTest
53 mDatabase = getContext().openOrCreateDatabase(DATABASE_FILE, Context.MODE_PRIVATE, null); in setUp()
60 mDatabase.close(); in tearDown()
66 SQLiteDirectCursorDriver cursorDriver = new SQLiteDirectCursorDriver(mDatabase, in testConstructor()
69 new SQLiteCursor(mDatabase, cursorDriver, TABLE_NAME, null); in testConstructor()
150 mDatabase.execSQL(DELETE_1); in testRequery()
158 mDatabase.execSQL(DELETE_2); in testRequery()
169 mDatabase.disableWriteAheadLogging(); in testRequery2()
170 mDatabase.execSQL("create table testRequery2 (i int);"); in testRequery2()
171 mDatabase.execSQL("insert into testRequery2 values(1);"); in testRequery2()
[all …]
DSQLiteFtsTest.java41 private SQLiteDatabase mDatabase; field in SQLiteFtsTest
46 mDatabase = getContext().openOrCreateDatabase("CTS_FTS", Context.MODE_PRIVATE, null); in setUp()
52 final String path = mDatabase.getPath(); in tearDown()
53 mDatabase.close(); in tearDown()
106 mDatabase.execSQL( in prepareFtsTable()
115 mDatabase.insert(table, null, values); in prepareFtsTable()
120 return mDatabase.query(table, new String[] { "snippet(" + table + ")" }, in queryFtsTable()
/cts/tests/tests/database/src/android/database/cts/
DDatabaseUtilsTest.java43 private SQLiteDatabase mDatabase; field in DatabaseUtilsTest
61 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setUp()
62 assertNotNull(mDatabase); in setUp()
63 mDatabase.execSQL("CREATE TABLE " + TABLE_NAME + " (_id INTEGER PRIMARY KEY, " + in setUp()
65 mDatabase.execSQL( in setUp()
67 mDatabase.execSQL( in setUp()
73 mDatabase.close(); in tearDown()
118 Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, in testBindObjectToProgram()
124 SQLiteStatement statement = mDatabase.compileStatement(sql); in testBindObjectToProgram()
131 cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null); in testBindObjectToProgram()
[all …]
DDatabaseCursorTest.java48 private SQLiteDatabase mDatabase; field in DatabaseCursorTest
62 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setUp()
63 assertNotNull(mDatabase); in setUp()
64 mDatabase.setVersion(CURRENT_DATABASE_VERSION); in setUp()
69 mDatabase.close(); in tearDown()
98 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); in populateDefaultTable()
100 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString1 + "');"); in populateDefaultTable()
101 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString2 + "');"); in populateDefaultTable()
102 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');"); in populateDefaultTable()
108 mDatabase.execSQL( in testBlob()
[all …]
DDatabaseUtils_InsertHelperTest.java32 private SQLiteDatabase mDatabase; field in DatabaseUtils_InsertHelperTest
39 mDatabase = getContext().openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null); in setUp()
40 assertNotNull(mDatabase); in setUp()
41 mInsertHelper = new InsertHelper(mDatabase, TEST_TABLE_NAME); in setUp()
47 mDatabase.close(); in tearDown()
53 new InsertHelper(mDatabase, TEST_TABLE_NAME); in testConstructor()
61 mDatabase.execSQL("CREATE TABLE " + TEST_TABLE_NAME + " (_id INTEGER PRIMARY KEY, " + in testGetColumnIndex()
76 mDatabase.execSQL("CREATE TABLE " + TEST_TABLE_NAME + "(_id INTEGER PRIMARY KEY," + in testInsert()
100 Cursor cursor = mDatabase.query(TEST_TABLE_NAME, projection, null, null, null, null, null); in testInsert()
125 cursor = mDatabase.query(TEST_TABLE_NAME, projection, null, null, null, null, null); in testInsert()
[all …]
DCursorWrapperTest.java48 private SQLiteDatabase mDatabase; field in CursorWrapperTest
82 Cursor cursor = mDatabase.query("test1", NUMBER_PROJECTION, null, null, null, null, null); in getCursor()
91 addWithValue(mDatabase, TESTVALUE1); in testGetCount()
95 addWithValue(mDatabase, TESTVALUE2); in testGetCount()
101 deleteWithValue(mDatabase, TESTVALUE1); in testGetCount()
104 deleteWithValue(mDatabase, TESTVALUE2); in testGetCount()
109 deleteAllRecords(mDatabase); in testGetCount()
299 mDatabase.execSQL("CREATE TABLE test2 (_id INTEGER PRIMARY KEY, string_text TEXT," in testGettingValues()
313 mDatabase.execSQL(sql, args); in testGettingValues()
315 Cursor cursor = mDatabase.query("test2", null, null, null, null, null, null); in testGettingValues()
[all …]
DMergeCursorTest.java41 private SQLiteDatabase mDatabase; field in MergeCursorTest
71 mDatabase.close(); in tearDown()
100 mDatabase.execSQL("CREATE TABLE " + TABLE5_NAME + " (_id INTEGER PRIMARY KEY," in testCursorSwiching()
103 mDatabase.execSQL(sql); in testCursorSwiching()
106 cursors[0] = mDatabase.query(TABLE5_NAME, null, null, null, null, null, null); in testCursorSwiching()
146 mCursors[i] = mDatabase.query(tableNames[i], null, null, null, null, null, null); in testGetValues()
291 mDatabase.execSQL("INSERT INTO " + TABLE1_NAME + " (number_1) VALUES ('" + TEST_VALUE1 in testRequery()
297 mDatabase.execSQL("INSERT INTO " + TABLE2_NAME + " (number_1) VALUES ('" + TEST_VALUE2 in testRequery()
314 mDatabase.execSQL("CREATE TABLE " + tablename + " (_id INTEGER PRIMARY KEY," in buildDatabaseWithTestValues()
320 mDatabase.execSQL(sql, args); in buildDatabaseWithTestValues()
[all …]
DCursorJoinerTest.java44 private SQLiteDatabase mDatabase; field in CursorJoinerTest
55 mDatabase.close(); in tearDown()
212 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setupDatabase()
229 mDatabase.execSQL(sql); in createTable()
234 mDatabase.execSQL("INSERT INTO " + tableName + "(number) VALUES ('" in addValuesIntoTable()
240 mDatabase.execSQL("INSERT INTO " + tableName + "(number) VALUES ('" + value + "');"); in addValueIntoTable()
244 mDatabase.execSQL("DELETE FROM " + tableName + " WHERE number = '" + value + "';"); in deleteValueFromTable()
248 return mDatabase.query(tableName, columnNames, selection, null, null, null, "number"); in getCursor()
DAbstractCursorTest.java60 private SQLiteDatabase mDatabase; field in AbstractCursorTest
81 mDatabase.close(); in tearDown()
472 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setupDatabase()
474 mDatabase.execSQL("CREATE TABLE test1 (_id INTEGER PRIMARY KEY, number TEXT);"); in setupDatabase()
476 mDatabaseCursor = (AbstractCursor) mDatabase.query("test1", null, null, null, null, null, in setupDatabase()
482 mDatabase.execSQL("INSERT INTO test1 (number) VALUES ('" + i + "');"); in generateData()
/cts/tests/app/src/android/app/cts/
DAlertDialog_BuilderCursorTest.java62 private SQLiteDatabase mDatabase; field in AlertDialog_BuilderCursorTest
88 mDatabase.update("test", valuesToUpdate, in onClick()
132 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setUp()
133 assertNotNull(mDatabase); in setUp()
135 mDatabase.execSQL( in setUp()
139 mDatabase.execSQL("INSERT INTO test (" + TEXT_COLUMN_NAME + ", " + in setUp()
156 if (mDatabase != null) { in tearDown()
157 mDatabase.close(); in tearDown()
168 mCursor = mDatabase.query("test", mProjectionWithoutChecked, in testSetCursor()
189 mCursor = mDatabase.query("test", mProjectionWithoutChecked, in testSetSingleChoiceItemsWithParamCursor()
[all …]
/cts/hostsidetests/inputmethodservice/deviceside/provider/src/android/inputmethodservice/cts/provider/
DEventProvider.java51 private Database mDatabase; field in EventProvider
59 mDatabase = new Database(getContext(), DB_NAME, DB_VERSION) { in onCreate()
82 final Cursor cursor = mDatabase.query( in query()
98 final long rowId = mDatabase.insert(uriHelper.mTable, values); in insert()
118 final int count = mDatabase.delete(uriHelper.mTable, uriHelper.buildSelection(selection), in delete()
139 final int count = mDatabase.update(uriHelper.mTable, values, in update()
157 mDatabase.close(); in shutdown()
158 mDatabase = null; in shutdown()
/cts/tests/tests/widget/src/android/widget/cts/
DCursorTreeAdapterTest.java79 private SQLiteDatabase mDatabase; field in CursorTreeAdapterTest
88 mDatabase.execSQL("CREATE TABLE group_table (_id INTEGER PRIMARY KEY, name TEXT);"); in createGroupCursor()
89 mDatabase.execSQL("INSERT INTO group_table (name) VALUES ('" + GROUP_ONE + "');"); in createGroupCursor()
90 mDatabase.execSQL("INSERT INTO group_table (name) VALUES ('" + GROUP_TWO + "');"); in createGroupCursor()
91 return mDatabase.query("group_table", NAME_PROJECTION, null, null, null, null, null); in createGroupCursor()
95 mDatabase.execSQL("CREATE TABLE child1 (_id INTEGER PRIMARY KEY, value TEXT);"); in createChild1Cursor()
96 mDatabase.execSQL("INSERT INTO child1 (value) VALUES ('" + CHILD_VALUE_ONE + "');"); in createChild1Cursor()
97 mDatabase.execSQL("INSERT INTO child1 (value) VALUES ('" + CHILD_VALUE_TWO + "');"); in createChild1Cursor()
102 return mDatabase.query("child1", VALUE_PROJECTION, null, null, null, null, null); in getChild1Cursor()
106 mDatabase.execSQL("CREATE TABLE child2 (_id INTEGER PRIMARY KEY, value TEXT);"); in createChild2Cursor()
[all …]
DCursorAdapterTest.java73 private SQLiteDatabase mDatabase; field in CursorAdapterTest
88 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); in setup()
89 assertNotNull(mDatabase); in setup()
90 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, number TEXT);"); in setup()
91 mDatabase.execSQL("INSERT INTO test (number) VALUES ('" + FIRST_NUMBER + "');"); in setup()
92 mDatabase.execSQL("INSERT INTO test (number) VALUES ('" + SECOND_NUMBER + "');"); in setup()
93 mCursor = mDatabase.query("test", NUMBER_PROJECTION, null, null, null, null, null); in setup()
107 mDatabase.close(); in teardown()
366 mDatabase.execSQL("INSERT INTO test (number) VALUES ('" + FIRST_NUMBER + "');"); in testOnContentChanged()
/cts/tests/tests/content/src/android/content/cts/
DContextTest.java671 SQLiteDatabase mDatabase; in testAccessDatabase() local
696 mDatabase = mContext.openOrCreateDatabase(DATABASE_NAME1, in testAccessDatabase()
698 assertNotNull(mDatabase); in testAccessDatabase()
699 mDatabase.close(); in testAccessDatabase()
700 mDatabase = mContext.openOrCreateDatabase(DATABASE_NAME2, in testAccessDatabase()
702 assertNotNull(mDatabase); in testAccessDatabase()
703 mDatabase.close(); in testAccessDatabase()