SpinnerActivityTest

SpinnerActivityTest - /* * Copyright (C) 2010 The Android...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * Copyright (C) 2010 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.android.example.spinner.test; import com.android.example.spinner.SpinnerActivity; import android.app.Instrumentation; import android.test.ActivityInstrumentationTestCase2; import android.test.UiThreadTest; import android.view.KeyEvent; import android.widget.Spinner; import android.widget.SpinnerAdapter; import android.widget.TextView; /* * Tests the example application Spinner. Uses the instrumentation test class * ActivityInstrumentationTestCase2 as its base class. The tests include * - test initial conditions * - test the UI * - state management - preserving state after the app is shut down and restarted, preserving * state after the app is hidden (paused) and re-displayed (resumed) * * Demonstrates the use of JUnit setUp() and assert() methods. */ public class SpinnerActivityTest extends ActivityInstrumentationTestCase2<SpinnerActivity> { // Number of items in the spinner's backing mLocalAdapter public static final int ADAPTER_COUNT = 9; // The location of Saturn in the backing mLocalAdapter array (0-based) public static final int TEST_POSITION = 5; // Set the initial position of the spinner to zero public static final int INITIAL_POSITION = 0; // The initial position corresponds to Mercury public static final String INITIAL_SELECTION = "Mercury"; // Test values of position and selection for the testStateDestroy test
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
public static final int TEST_STATE_DESTROY_POSITION = 2; public static final String TEST_STATE_DESTROY_SELECTION = "Earth"; // Test values of position and selection for the testStatePause test public static final int TEST_STATE_PAUSE_POSITION = 4; public static final String TEST_STATE_PAUSE_SELECTION = "Jupiter"; // The Application object for the application under test
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/06/2010 for the course CSC 216 taught by Professor Miller during the Spring '08 term at N.C. State.

Page1 / 7

SpinnerActivityTest - /* * Copyright (C) 2010 The Android...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online