summaryrefslogtreecommitdiff
path: root/samples/NotePad/tests/src/com/example/android/notepad/NotePadActivityTest.java
diff options
context:
space:
mode:
authorJoe Malin <jmalin@google.com>2010-06-07 16:26:25 -0700
committerJoe Malin <jmalin@google.com>2010-08-09 15:30:01 -0700
commit4124e0a1f07e4e54c37b0cfbb1b7438806ff02a6 (patch)
tree044d57a235802491100ea89ace9c8f56c9471e30 /samples/NotePad/tests/src/com/example/android/notepad/NotePadActivityTest.java
parent4779ab6f9aa4d6b691f051e069ffac31475f850a (diff)
Revised Note Pad sample, new test app for Note Pad
Change-Id: Ia41a33d935ead704c1de439a0cfb0a55806cfe12
Diffstat (limited to 'samples/NotePad/tests/src/com/example/android/notepad/NotePadActivityTest.java')
-rw-r--r--samples/NotePad/tests/src/com/example/android/notepad/NotePadActivityTest.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/samples/NotePad/tests/src/com/example/android/notepad/NotePadActivityTest.java b/samples/NotePad/tests/src/com/example/android/notepad/NotePadActivityTest.java
new file mode 100644
index 000000000..c29da4432
--- /dev/null
+++ b/samples/NotePad/tests/src/com/example/android/notepad/NotePadActivityTest.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.notepad;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+import com.example.android.notepad.NotesList;
+/**
+ * Make sure that the main launcher activity opens up properly, which will be
+ * verified by {@link #testActivityTestCaseSetUpProperly}.
+ *
+ * To learn how to run an entire test package or one of its classes, please see
+ * "Testing in Eclipse, with ADT" or "Testing in Other IDEs" in the Developer Guide.
+ */
+public class NotePadActivityTest extends ActivityInstrumentationTestCase2<NotesList> {
+
+ /**
+ * Creates an {@link ActivityInstrumentationTestCase2} for the {@link NotesList} activity.
+ */
+ public NotePadActivityTest() {
+ // This constructor was deprecated in API level 8 (SDK 2.2) but is
+ // used here so that the package remains compatible with API level 3 (SDK 1.5)
+ super("com.example.android.notepad", NotesList.class);
+ }
+
+ /**
+ * Verifies that the activity under test can be launched.
+ */
+ public void testActivityTestCaseSetUpProperly() {
+ assertNotNull("activity should be launched successfully", getActivity());
+ }
+}