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.util.List; 19 20 /** 21 * Data structure for a Compatibility test module result. 22 */ 23 public interface IModuleResult extends Comparable<IModuleResult> { 24 getId()25 String getId(); 26 getName()27 String getName(); 28 getAbi()29 String getAbi(); 30 addRuntime(long elapsedTime)31 void addRuntime(long elapsedTime); 32 getRuntime()33 long getRuntime(); 34 isDone()35 boolean isDone(); 36 setDone(boolean done)37 void setDone(boolean done); 38 39 /** 40 * Gets a {@link ICaseResult} for the given testcase, creating it if it doesn't exist. 41 * 42 * @param caseName the name of the testcase eg <package-name><class-name> 43 * @return the {@link ICaseResult} or <code>null</code> 44 */ getOrCreateResult(String caseName)45 ICaseResult getOrCreateResult(String caseName); 46 47 /** 48 * Gets the {@link ICaseResult} result for given testcase. 49 * 50 * @param caseName the name of the testcase eg <package-name><class-name> 51 * @return the {@link ITestResult} or <code>null</code> 52 */ getResult(String caseName)53 ICaseResult getResult(String caseName); 54 55 /** 56 * Gets all results sorted by name. 57 */ getResults()58 List<ICaseResult> getResults(); 59 60 /** 61 * Counts the number of results which have the given status. 62 */ countResults(TestStatus status)63 int countResults(TestStatus status); 64 65 /** 66 * Merge the module results from otherModuleResult into this moduleResult. 67 */ mergeFrom(IModuleResult otherModuleResult)68 void mergeFrom(IModuleResult otherModuleResult); 69 } 70