Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright 2006-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.objenesis.tck;
import org.objenesis.Objenesis;
import java.io.PrintStream;
import java.util.*;
/**
* Reports results from TCK as tabulated text, suitable for dumping to the console or a file and
* being read by a human. It can be reused to provide a summary reports of different candidates as
* long as the same objenesisDescription is not used twice.
*
* @author Joe Walnes
* @author Henri Tremblay
* @see TCK
* @see Reporter
*/
public class TextReporter implements Reporter {
private static class Result {
String objenesisDescription;
String candidateDescription;
boolean result;
Exception exception;
/**
* @param objenesisDescription Description of the tested Objenesis instance
* @param candidateDescription Description of the tested candidate
* @param result If the test is successful or not
* @param exception Exception that might have occured during the test
*/
public Result(String objenesisDescription, String candidateDescription, boolean result,
Exception exception) {
this.objenesisDescription = objenesisDescription;
this.candidateDescription = candidateDescription;
this.result = result;
this.exception = exception;
}
}
private final PrintStream summary;
private final PrintStream log;
private long startTime;
private long totalTime = 0;
private int errorCount = 0;
private SortedMap allCandidates = new TreeMap();
private SortedMap allInstantiators = new TreeMap();
private String currentObjenesis;
private String currentCandidate;
private Map