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.result;
17 
18 import com.android.tradefed.invoker.IInvocationContext;
19 
20 import java.util.List;
21 
22 /**
23  * Interface that allows {@link ITestInvocationListener} to exchange some limited information via
24  * summaries.
25  */
26 public interface ITestSummaryListener extends ITestInvocationListener {
27 
28     /**
29      * Passes a {@link List} of non-null {@link TestSummary}s which may have been returned from any
30      * {@link ITestInvocationListener}s instantiated as part of the configuration. The early
31      * summaries are generated after {@link #invocationStarted(IInvocationContext)} and can be
32      * completed at the end of the invocation via {@link #putSummary(List)}.
33      *
34      * <p>This is called before {@link #invocationStarted(IInvocationContext)} and contains all the
35      * summaries from the listeners configured before it.
36      *
37      * @param summaries A {@link List} of non-null {@link TestSummary}s from {@link
38      *     ITestInvocationListener}s that are part of the current configuration.
39      */
putEarlySummary(List<TestSummary> summaries)40     public default void putEarlySummary(List<TestSummary> summaries) {
41         // Empty default implementation
42     }
43 
44     /**
45      * Passes a {@link List} of non-null {@link TestSummary}s which may have been returned from any
46      * {@link ITestInvocationListener}s instantiated as part of the configuration.
47      *
48      * @param summaries A {@link List} of non-null {@link TestSummary}s from {@link
49      *     ITestInvocationListener}s that are part of the current configuration.
50      */
putSummary(List<TestSummary> summaries)51     public default void putSummary(List<TestSummary> summaries) {
52         // Empty default implementation
53     }
54 
55 }
56