citrus icon indicating copy to clipboard operation
citrus copied to clipboard

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

Open mischcon opened this issue 6 years ago • 2 comments

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.

mischcon avatar Aug 23 '18 11:08 mischcon

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 avatar Aug 29 '18 07:08 svettwer

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

svettwer avatar Jan 15 '19 15:01 svettwer