Problem
Reported by Joelle Barido-Sottani:
I'm currently testing the new Maven build - seems the test classes are no longer exported? I was using some of the trace reading utilities (in the test.beast.beast2vs1.trace package) for my own tests and they can't be found anymore. Is there a way to put them back?
The old Ant build explicitly created a test.beast.jar containing all compiled test classes. When we migrated to Maven, this was not carried over — Maven only packages src/main/java classes by default.
Analysis
The classes in test.beast.beast2vs1.trace are not actually test classes. They are general-purpose trace-analysis tools that were misplaced in the test tree:
LogAnalyser — a BEAST Runnable with @Description/@Citation and Input fields
Expectation — a BEASTObject for comparing expected vs actual trace values
LogFileTraces — log file parser
TraceStatistics — computes mean, stdev, median, HPD, ESS, autocorrelation time, etc.
NumberFormatter, TraceException, TraceType, TrimLineReader — supporting utilities
DiscreteStatistics — identical duplicate of beast.base.util.DiscreteStatistics
Proposed solution
- Move the 8 classes (excluding the duplicate
DiscreteStatistics) from src/test/java/test/beast/beast2vs1/trace/ to src/main/java/beast/base/trace/ in beast-base.
- Delete the test
DiscreteStatistics and have TraceStatistics use the existing beast.base.util.DiscreteStatistics.
- Export
beast.base.trace in module-info.java.
- Update internal test imports.
Future work
beastfx.app.tools.LogAnalyser duplicates much of this functionality (log parsing, ESS, HPD, etc.) but is coupled to beast-fx via a Swing file-chooser fallback — even though the class is otherwise entirely GUI-less. A follow-up refactor should extract the pure computation from the beast-fx LogAnalyser into beast.base.trace and have the beast-fx class delegate to it.
Problem
Reported by Joelle Barido-Sottani:
The old Ant build explicitly created a
test.beast.jarcontaining all compiled test classes. When we migrated to Maven, this was not carried over — Maven only packagessrc/main/javaclasses by default.Analysis
The classes in
test.beast.beast2vs1.traceare not actually test classes. They are general-purpose trace-analysis tools that were misplaced in the test tree:LogAnalyser— a BEASTRunnablewith@Description/@CitationandInputfieldsExpectation— aBEASTObjectfor comparing expected vs actual trace valuesLogFileTraces— log file parserTraceStatistics— computes mean, stdev, median, HPD, ESS, autocorrelation time, etc.NumberFormatter,TraceException,TraceType,TrimLineReader— supporting utilitiesDiscreteStatistics— identical duplicate ofbeast.base.util.DiscreteStatisticsProposed solution
DiscreteStatistics) fromsrc/test/java/test/beast/beast2vs1/trace/tosrc/main/java/beast/base/trace/inbeast-base.DiscreteStatisticsand haveTraceStatisticsuse the existingbeast.base.util.DiscreteStatistics.beast.base.traceinmodule-info.java.Future work
beastfx.app.tools.LogAnalyserduplicates much of this functionality (log parsing, ESS, HPD, etc.) but is coupled tobeast-fxvia a Swing file-chooser fallback — even though the class is otherwise entirely GUI-less. A follow-up refactor should extract the pure computation from thebeast-fxLogAnalyserintobeast.base.traceand have thebeast-fxclass delegate to it.