Home | History | Annotate | Download | only in util
      1 /*
      2  * Copyright (C) 2015 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.compatibility.common.util;
     17 
     18 import java.io.File;
     19 import java.util.List;
     20 import java.util.Map;
     21 import java.util.Set;
     22 
     23 /**
     24  * Interface for a the result of a single Compatibility invocation.
     25  */
     26 public interface IInvocationResult {
     27 
     28     /**
     29      * @return the starting timestamp.
     30      */
     31     long getStartTime();
     32 
     33     /**
     34      * @param time the starting timestamp
     35      */
     36     void setStartTime(long time);
     37 
     38     /**
     39      * Count the number of results with given status.
     40      */
     41     int countResults(TestStatus result);
     42 
     43     /**
     44      * @return the number of tests that have not been executed in this moduleResult.
     45      */
     46     int getNotExecuted();
     47 
     48     /**
     49      * @param plan the plan associated with this result.
     50      */
     51     void setTestPlan(String plan);
     52 
     53     /**
     54      * @return the test plan associated with this result.
     55      */
     56     String getTestPlan();
     57 
     58     /**
     59      * Adds the given device serial to the result.
     60      */
     61     void addDeviceSerial(String serial);
     62 
     63     /**
     64      * @return the device serials associated with result.
     65      */
     66     Set<String> getDeviceSerials();
     67 
     68     /**
     69      * @return the {@link IModuleResult} for the given id, creating one if it doesn't exist
     70      */
     71     IModuleResult getOrCreateModule(String id);
     72 
     73     /**
     74      * @return the {@link IModuleResult}s sorted by id.
     75      */
     76     List<IModuleResult> getModules();
     77 
     78     /**
     79      * Merges a module result to the invocation result.
     80      */
     81     void mergeModuleResult(IModuleResult moduleResult);
     82 
     83     /**
     84      * Adds the given invocation info to the result.
     85      */
     86     void addInvocationInfo(String key, String value);
     87 
     88     /**
     89      * Gets the {@link Map} of invocation info collected.
     90      */
     91     Map<String, String> getInvocationInfo();
     92 
     93     /**
     94      *  Set the string containing the command line arguments to the run command.
     95      */
     96     void setCommandLineArgs(String setCommandLineArgs);
     97 
     98     /**
     99      * Retrieve the command line arguments to the run command.
    100      */
    101     String getCommandLineArgs();
    102 
    103     /**
    104      * @param buildFingerprint the build fingerprint associated with this result.
    105      */
    106     void setBuildFingerprint(String buildFingerprint);
    107 
    108     /**
    109      * @return the device build fingerprint associated with result.
    110      */
    111     String getBuildFingerprint();
    112 
    113     /**
    114      * Return the number of completed test modules for this invocation.
    115      */
    116     int getModuleCompleteCount();
    117 
    118     /**
    119      * Return status of checksum from previous session
    120      */
    121     RetryChecksumStatus getRetryChecksumStatus();
    122 
    123     /**
    124      * Set status of checksum from previous session
    125      */
    126     void setRetryChecksumStatus(RetryChecksumStatus retryStatus);
    127 
    128     /**
    129      * Return the directory of the previous sessions results
    130      */
    131     File getRetryDirectory();
    132 
    133     /**
    134      * Set the directory of the previous sessions results
    135      */
    136     void setRetryDirectory(File resultDir);
    137 
    138 }
    139