![JAR search and dependency download from the Maven repository](/logo.png)
com.insightfullogic.lambdabehave.impl.output.ConsoleFormatter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lambda-behave Show documentation
Show all versions of lambda-behave Show documentation
A modern testing and behavioural specification framework for Java 8
package com.insightfullogic.lambdabehave.impl.output;
import com.insightfullogic.lambdabehave.impl.reports.Report;
import com.insightfullogic.lambdabehave.impl.reports.Result;
import com.insightfullogic.lambdabehave.impl.reports.SpecificationReport;
import java.io.PrintStream;
public final class ConsoleFormatter implements ReportFormatter {
@Override
public void format(final Report report) {
report.suites().forEach(suite -> {
System.out.print(suite.getName());
System.out.println();
suite.specifications().forEach(this::printSpecification);
});
}
private void printSpecification(final SpecificationReport specification) {
boolean isSuccess = specification.getResult() == Result.SUCCESS;
PrintStream out = isSuccess ? System.out : System.err;
out.print("\tshould ");
out.print(specification.getDescription());
if (!isSuccess) {
out.print("[");
out.print(specification.getMessage());
out.print("]");
}
out.println();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy