1 /*
2  * Copyright (C) 2018 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.testtype.suite.retry;
17 
18 import com.android.tradefed.config.IConfiguration;
19 import com.android.tradefed.result.CollectingTestListener;
20 
21 /** Interface describing an helper to load previous results in a way that can be re-run. */
22 public interface ITestSuiteResultLoader {
23 
24     /** Initialization of the loader. */
init()25     public void init();
26 
27     /** Retrieve the original command line from the previous run. */
getCommandLine()28     public String getCommandLine();
29 
30     /** Load the previous results in a {@link CollectingTestListener} format. */
loadPreviousResults()31     public CollectingTestListener loadPreviousResults();
32 
33     /**
34      * Allow the specialized loader to customize the configuration before it is re-run.
35      * Customization usually involves adding some objects to the original configuration in order to
36      * make it do some extra things.
37      *
38      * @param config The {@link IConfiguration} that will be re-run.
39      */
customizeConfiguration(IConfiguration config)40     public default void customizeConfiguration(IConfiguration config) {}
41 
42     /** Clean up any internal states. */
cleanUp()43     public default void cleanUp() {}
44 }
45