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