citrusframework / citrus

Framework for automated integration tests with focus on messaging integration
https://citrusframework.org
Apache License 2.0
459 stars 136 forks source link

Citrus-Maven-Plugin: 'Generate Docs'-Mojo fails on plain Java Tests #450

Open mischcon opened 6 years ago

mischcon commented 6 years ago

Hi,

when running the 'citrus:create-docs' or 'citrus:generate-docs' Mojo on a Citrus project that contains plain Java-Tests (not the Java-Test-'Stubs' that refer to a XML-Test) the report does not contain those tests.

Citrus-Version: Tested on 2.7.6 and 2.8.0-SNAPSHOT

Expected Behavior: Report should contain the Java-based Tests and the XML-based Tests Actual Behavior: Report only contains XML-based Tests

Further notes: It seems as if the protected List<File> getTestFiles() Method (located in AbstractTestDocsGenerator.java) only searches for XML-based tests.

protected List<File> getTestFiles() throws IOException {
        if (testFiles == null) {
            testFiles = FileUtils.findFiles(srcDirectory + "resources" + File.separator, Citrus.getXmlTestFileNamePattern());
        }

        return testFiles;
}

Also the implementations of public abstract void doBody(OutputStream buffered) and public abstract void doHeader(OutputStream buffered) (located in AbstractTestDocsGenerator.java) seem to only work with XML-files.

svettwer commented 6 years ago

Hi!

Thx for the report! Yes, it seems that there is a bug in the maven plugin ignoring java tests.

Memo: this is easily reproducible with the citrus-samples.

BR, Sven

svettwer commented 5 years ago

Hi!

Now that I'm working on it, the report functionality was intended to work with XML only. So this is not a bug but a complete new feature.

The XML Test Documentation also provides a lot of information about the test case, test steps, etc. Adding this for Java as well is definitively a big thing.

Therefore I'll remove this issue from the milestone, relabel it as feature and reschedule it.

Sorry for the inconvenience. BR, Sven