Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
starkda committed Apr 1, 2024
1 parent 47254cc commit a8684bd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/test/java/org/jpeek/MetricsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import java.nio.file.Path;
import org.cactoos.text.FormattedText;
import org.cactoos.text.TextOf;
import org.jpeek.calculus.Calculus;
import org.jpeek.calculus.java.Ccm;
import org.jpeek.calculus.xsl.XslCalculus;
import org.jpeek.skeleton.Skeleton;
import org.junit.jupiter.api.io.TempDir;
Expand Down Expand Up @@ -70,9 +72,16 @@ final class MetricsTest {
void testsTarget(final String target, final String metric, final double value,
@TempDir final Path output)
throws Exception {
Calculus calculus;
if (metric.equals("CCM")) {
calculus = new Ccm();
}
else {
calculus = new XslCalculus();
}
new XslReport(
new Skeleton(new FakeBase(target)).xml(), new XslCalculus(),
new ReportData(metric)
new Skeleton(new FakeBase(target)).xml(), calculus,
new ReportData(metric)
).save(output);
final String xpath;
if (Double.isNaN(value)) {
Expand Down

0 comments on commit a8684bd

Please sign in to comment.