1/** 2 * Copyright 2006-2013 the original author or authors. 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 */ 16package org.objenesis.tck; 17 18import java.util.Collection; 19 20/** 21 * Reports results from the TCK back to the user. 22 * <p> 23 * The sequence these methods are called is described below: 24 * </p> 25 * 26 * <pre> 27 * startTests(startObjenesis(result | exception) * endObjenesis) * endTests 28 * </pre> 29 * 30 * @author Joe Walnes 31 * @see TCK 32 * @see TextReporter 33 */ 34public interface Reporter { 35 36 /** 37 * Report that the tests are starting. Provides information that is useful to be reported. 38 * 39 * @param platformDescription Description the platform being run on (i.e. JVM version, vendor, 40 * etc). 41 * @param allCandidates Descriptions (String) of all candidates being used in tests. 42 * @param allObjenesisInstances Descriptions of all Objenesis instances being used in tests. 43 */ 44 void startTests(String platformDescription, Collection allCandidates, 45 Collection allObjenesisInstances); 46 47 /** 48 * Report that a test between a candidate and an objenesis instance if about to start. 49 * 50 * @param candidateDescription Description of the candidate class. 51 * @param objenesisDescription Description of the objenesis instance. 52 */ 53 void startTest(String candidateDescription, String objenesisDescription); 54 55 /** 56 * Report details about what happened when an Objenesis instance tried to instantiate the current 57 * candidate. 58 * 59 * @param instantiatedObject Whether the ObjectInstantiator successfully instantiated the 60 * candidate class. 61 */ 62 void result(boolean instantiatedObject); 63 64 /** 65 * Report that something bad happened during the test. 66 * 67 * @param exception Exception thrown by instantiator. 68 */ 69 void exception(Exception exception); 70 71 /** 72 * Report that tests have been completed for a particular Objenesis instance and candidate. 73 */ 74 void endTest(); 75 76 /** 77 * Report that all tests have finished. Nothing will be called after this method. 78 */ 79 void endTests(); 80} 81