Brett Chabot | 74121d8 | 2010-01-28 20:14:27 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package com.android.tradefed.config; |
| 17 | |
Brett Chabot | 1b808f2 | 2010-03-16 11:17:12 -0700 | [diff] [blame] | 18 | import com.android.tradefed.device.WaitDeviceRecovery; |
Brett Chabot | 74121d8 | 2010-01-28 20:14:27 -0800 | [diff] [blame] | 19 | import com.android.tradefed.log.StdoutLogger; |
| 20 | import com.android.tradefed.result.TextResultReporter; |
| 21 | import com.android.tradefed.targetsetup.StubBuildProvider; |
| 22 | import com.android.tradefed.targetsetup.StubTargetPreparer; |
| 23 | import com.android.tradefed.testtype.InstrumentationTest; |
| 24 | |
| 25 | /** |
Brett Chabot | ccdf327 | 2010-02-27 18:59:03 -0800 | [diff] [blame] | 26 | * A configuration for simply running an Android instrumentation test. |
Brett Chabot | 74121d8 | 2010-01-28 20:14:27 -0800 | [diff] [blame] | 27 | * |
| 28 | * Returns stub no-op objects for most delegates, except |
| 29 | * - uses a stdout logger and result reporter |
| 30 | * - and a instrumentation test |
| 31 | */ |
Brett Chabot | ccdf327 | 2010-02-27 18:59:03 -0800 | [diff] [blame] | 32 | class InstrumentConfiguration extends AbstractConfiguration { |
Brett Chabot | 74121d8 | 2010-01-28 20:14:27 -0800 | [diff] [blame] | 33 | |
| 34 | /** |
Brett Chabot | ccdf327 | 2010-02-27 18:59:03 -0800 | [diff] [blame] | 35 | * Creates a {@link InstrumentConfiguration}, and all its associated delegate objects. |
Brett Chabot | 74121d8 | 2010-01-28 20:14:27 -0800 | [diff] [blame] | 36 | */ |
Brett Chabot | ccdf327 | 2010-02-27 18:59:03 -0800 | [diff] [blame] | 37 | InstrumentConfiguration() { |
Brett Chabot | 74121d8 | 2010-01-28 20:14:27 -0800 | [diff] [blame] | 38 | super(); |
| 39 | addObject(BUILD_PROVIDER_NAME, new StubBuildProvider()); |
Brett Chabot | 1b808f2 | 2010-03-16 11:17:12 -0700 | [diff] [blame] | 40 | addObject(DEVICE_RECOVERY_NAME, new WaitDeviceRecovery()); |
Brett Chabot | 74121d8 | 2010-01-28 20:14:27 -0800 | [diff] [blame] | 41 | addObject(TARGET_PREPARER_NAME, new StubTargetPreparer()); |
| 42 | addObject(TEST_NAME, new InstrumentationTest()); |
| 43 | addObject(LOGGER_NAME, new StdoutLogger()); |
| 44 | addObject(RESULT_REPORTER_NAME, new TextResultReporter()); |
| 45 | } |
Brett Chabot | 74121d8 | 2010-01-28 20:14:27 -0800 | [diff] [blame] | 46 | } |