From b7926325a1c1a370c84c81db80372f59af240a53 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Tue, 10 Feb 2009 15:43:57 -0800 Subject: auto import from //branches/cupcake/...@130745 --- sql/src/test/java/tests/SQLite/ExceptionTest.java | 27 ++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'sql/src/test/java/tests/SQLite/ExceptionTest.java') diff --git a/sql/src/test/java/tests/SQLite/ExceptionTest.java b/sql/src/test/java/tests/SQLite/ExceptionTest.java index cc37c2a..fe86e8f 100644 --- a/sql/src/test/java/tests/SQLite/ExceptionTest.java +++ b/sql/src/test/java/tests/SQLite/ExceptionTest.java @@ -16,24 +16,26 @@ package tests.SQLite; +import SQLite.Database; import SQLite.Exception; +import dalvik.annotation.TestTargetClass; import dalvik.annotation.TestTargets; import dalvik.annotation.TestLevel; import dalvik.annotation.TestTargetNew; import junit.framework.TestCase; -public class ExceptionTest extends TestCase { - - public ExceptionTest(String name) { - super(name); - } +@TestTargetClass(SQLite.Exception.class) +public class ExceptionTest extends SQLiteTest { + + private Database db = null; - protected void setUp() throws java.lang.Exception { + public void setUp() throws java.lang.Exception { super.setUp(); + db = new Database(); } - - protected void tearDown() throws java.lang.Exception { + + public void tearDown() { super.tearDown(); } @@ -41,13 +43,18 @@ public class ExceptionTest extends TestCase { * @tests {@link Exception#Exception(String)} */ @TestTargetNew( - level = TestLevel.TODO, + level = TestLevel.COMPLETE, notes = "constructor test", method = "Exception", args = {java.lang.String.class} ) public void testException() { - fail("not yet implemented"); + try { + db.open(dbFile.getName(), 0); + } catch (Exception e) { + assertNotNull(e); + assertNotNull(e.getMessage()); + } } } -- cgit v1.1