Multi artifact-type forwarding broken
Description
When trying to forward a req artifact to an imp and a utest artifact from a Markdown file, the according implicit dsn artifact is not created.
If I forward to one type only, it works as expected.
Strangely there is a unit test that should cover this kind of situation. Looks like it does not completely:
https://github.com/itsallcode/openfasttrace/blob/develop/importer/markdown/src/test/java/org/itsallcode/openfasttrace/importer/markdown/TestMarkdownImporter.java
Steps to Reproduce
- Create requirement spec item
req~boolean-operators~1that needsdsncoverage - Forward it throut
dsnlike thisdsn --> impl, utest: req~boolean-operators~1 - Create coverage in
implandutest - Run trace
Expected behavior
Trace is green
Environment
- OFT: 2.2.0
- OS: Fedora 29
- Java Version: openjdk version "1.8.0_191" OpenJDK Runtime Environment (build 1.8.0_191-b13) OpenJDK 64-Bit Server VM (build 25.191-b13, mixed mode)
The problem is probably caused by the Markdown state machine. It recognizes FORWARD patterns only in states START and OUTSIDE. When adding a forwarding in the middle (see below) it won't detect the forwarding:
req~boolean-operators~1
Needs: dsn
dsn --> impl, utest: req~boolean-operators~1
A workaround would be to force the state machine into the OUTSIDE state by prefixing the forwarding line with a header and some text:
req~boolean-operators~1
Needs: dsn
# Separator
ignore
dsn --> impl, utest: req~boolean-operators~1
Fixing this will require updating the state machine to allow forwarding also in SPEC_ITEM state.