You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Lennart Jörelid <le...@gmail.com> on 2014/12/29 16:36:21 UTC

Doclets and Unit Testing (JAXB2 Maven Plugin context)

Hello all,

I need to enhance the Jaxb2 Maven Plugin to optionally merge JavaDoc
comments into XSDs generated from JAXB-annotated classes. In order to do
this, I need to develop a custom Doclet - and unit test it, just like I do
all other code I develop.

*Alas:* What's the best practise for setting up Doclet tests in a Maven
project?
*Condition:* I don't want to resort to AbstractMojoTestCases, as I am not
attempting to create reports. I would simply like a plain jUnit testcase
for a Doclet.


*Background*
This custom Doclet is not intended to generate Maven documentation, but
instead to perform postprocessing of java sources to inject javadoc
comments into generated XSDs on the form shown below:

/**
 * Some information here...
 */
@XmlType(namespace =
"http://www.jguru.se/foobar")@XmlAccessorType(XmlAccessType.FIELD)public
class SomeType { ... }

... should yield ...

<xs:complexType name="someType">
     <xs:annotation>
          <xs:documentation>
               Some information here...
          </xs:documentation>
     </xs:annotation>
     <xs:complexContent>
     ....


The issue opened is http://jira.codehaus.org/browse/MJAXB-103.

-- 

--
+==============================+
| Bästa hälsningar,
| [sw. "Best regards"]
|
| Lennart Jörelid
| EAI Architect & Integrator
|
| jGuru Europe AB
| Mölnlycke - Kista
|
| Email: lj@jguru.se
| URL:   www.jguru.se
| Phone
| (skype):    jgurueurope
| (intl):     +46 708 507 603
| (domestic): 0708 - 507 603
+==============================+

Re: Doclets and Unit Testing (JAXB2 Maven Plugin context)

Posted by Lennart Jörelid <le...@gmail.com>.
A few minutes of looking at QDox, I think you are correct.
The development approach and the API seems to be simpler in QDox than in
the standard JavaDoc Doclet.

I'll give it a spin and get back to you with questions. Thanks.

:)

2014-12-29 16:42 GMT+01:00 Robert Scholte <rf...@apache.org>:

> Hi,
>
> It's probably easier to parse those sources with QDox[1], like we do with
> maven-plugin-tools.
> I've become the project lead of this project, so if you need help just let
> me know.
>
> Robert
>
> [1] http://qdox.codehaus.org
>
> Op Mon, 29 Dec 2014 16:36:21 +0100 schreef Lennart Jörelid <
> lennart.jorelid@gmail.com>:
>
>  Hello all,
>>
>> I need to enhance the Jaxb2 Maven Plugin to optionally merge JavaDoc
>> comments into XSDs generated from JAXB-annotated classes. In order to do
>> this, I need to develop a custom Doclet - and unit test it, just like I do
>> all other code I develop.
>>
>> *Alas:* What's the best practise for setting up Doclet tests in a Maven
>> project?
>> *Condition:* I don't want to resort to AbstractMojoTestCases, as I am not
>> attempting to create reports. I would simply like a plain jUnit testcase
>> for a Doclet.
>>
>>
>> *Background*
>> This custom Doclet is not intended to generate Maven documentation, but
>> instead to perform postprocessing of java sources to inject javadoc
>> comments into generated XSDs on the form shown below:
>>
>> /**
>>  * Some information here...
>>  */
>> @XmlType(namespace =
>> "http://www.jguru.se/foobar")@XmlAccessorType(XmlAccessType.FIELD)public
>> class SomeType { ... }
>>
>> ... should yield ...
>>
>> <xs:complexType name="someType">
>>      <xs:annotation>
>>           <xs:documentation>
>>                Some information here...
>>           </xs:documentation>
>>      </xs:annotation>
>>      <xs:complexContent>
>>      ....
>>
>>
>> The issue opened is http://jira.codehaus.org/browse/MJAXB-103.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


-- 

--
+==============================+
| Bästa hälsningar,
| [sw. "Best regards"]
|
| Lennart Jörelid
| EAI Architect & Integrator
|
| jGuru Europe AB
| Mölnlycke - Kista
|
| Email: lj@jguru.se
| URL:   www.jguru.se
| Phone
| (skype):    jgurueurope
| (intl):     +46 708 507 603
| (domestic): 0708 - 507 603
+==============================+

Re: Doclets and Unit Testing (JAXB2 Maven Plugin context)

Posted by Robert Scholte <rf...@apache.org>.
Hi,

It's probably easier to parse those sources with QDox[1], like we do with  
maven-plugin-tools.
I've become the project lead of this project, so if you need help just let  
me know.

Robert

[1] http://qdox.codehaus.org

Op Mon, 29 Dec 2014 16:36:21 +0100 schreef Lennart Jörelid  
<le...@gmail.com>:

> Hello all,
>
> I need to enhance the Jaxb2 Maven Plugin to optionally merge JavaDoc
> comments into XSDs generated from JAXB-annotated classes. In order to do
> this, I need to develop a custom Doclet - and unit test it, just like I  
> do
> all other code I develop.
>
> *Alas:* What's the best practise for setting up Doclet tests in a Maven
> project?
> *Condition:* I don't want to resort to AbstractMojoTestCases, as I am not
> attempting to create reports. I would simply like a plain jUnit testcase
> for a Doclet.
>
>
> *Background*
> This custom Doclet is not intended to generate Maven documentation, but
> instead to perform postprocessing of java sources to inject javadoc
> comments into generated XSDs on the form shown below:
>
> /**
>  * Some information here...
>  */
> @XmlType(namespace =
> "http://www.jguru.se/foobar")@XmlAccessorType(XmlAccessType.FIELD)public
> class SomeType { ... }
>
> ... should yield ...
>
> <xs:complexType name="someType">
>      <xs:annotation>
>           <xs:documentation>
>                Some information here...
>           </xs:documentation>
>      </xs:annotation>
>      <xs:complexContent>
>      ....
>
>
> The issue opened is http://jira.codehaus.org/browse/MJAXB-103.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org