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.targetprep; 17 18 import com.android.ddmlib.Log; 19 import com.android.tradefed.config.IConfiguration; 20 import com.android.tradefed.config.IConfigurationReceiver; 21 import com.android.tradefed.config.Option; 22 import com.android.tradefed.config.OptionClass; 23 import com.android.tradefed.invoker.TestInformation; 24 25 /** Placeholder empty implementation of a {@link ITargetPreparer}. */ 26 @OptionClass(alias = "stub-preparer") 27 public class StubTargetPreparer extends BaseTargetPreparer implements IConfigurationReceiver { 28 29 @Option(name = "test-boolean-option", description = "test option, keep default to true.") 30 private boolean mTestBooleanOption = true; 31 32 @Option(name = "test-boolean-option-false", description = "test option, keep default to true.") 33 private boolean mTestBooleanOptionFalse = false; 34 35 private IConfiguration mConfig; 36 37 /** {@inheritDoc} */ 38 @Override setUp(TestInformation testInfo)39 public void setUp(TestInformation testInfo) throws TargetSetupError { 40 Log.d("TargetPreparer", "skipping target prepare step"); 41 } 42 43 /** {@inheritDoc} */ 44 @Override setConfiguration(IConfiguration configuration)45 public void setConfiguration(IConfiguration configuration) { 46 mConfig = configuration; 47 } 48 49 /** Returns the configuration received through {@link #setConfiguration(IConfiguration)}. */ getConfiguration()50 public IConfiguration getConfiguration() { 51 return mConfig; 52 } 53 getTestBooleanOption()54 public boolean getTestBooleanOption() { 55 return mTestBooleanOption; 56 } 57 getTestBooleanOptionFalse()58 public boolean getTestBooleanOptionFalse() { 59 return mTestBooleanOptionFalse; 60 } 61 } 62