Mmmh,
Ok for the compilation with the 1.5 option. But for the tests recognition I still miss something. Here is a piece of my code:

<code>
   @Test public void formatMySqlDateTime()
   {
assertEquals (calendarValue20060215120523.getTime ().toString (), //message "2006-02-15 12:05:23", //expected result DatesFormatter.formatMySqlDateTime (calendarValue20060215120523)); //result
   }


   public static junit.framework.Test suite()
   {
       return new JUnit4TestAdapter(DatesFormatter.class);
   }
</code>

Here is the command that I launch : mvn surefire:test or mvn compile (runs also the tests)

And then invariably I get a "BUILD ERROR" from Maven because there are no test method recognized or something like that.

Just a question, do you succeed in running JUNIT 4.0 tests via MAVEN 2 ?


Thanks a lot for your help. Regards


Gianfranco OLDANI
Mob: +41787330350
Web: www.gfoldani.com



----Original Message Follows----
From: "Kaare Nilsen" <[EMAIL PROTECTED]>
Reply-To: "Maven Users List" <users@maven.apache.org>
To: "Maven Users List" <users@maven.apache.org>
Subject: Re: MVN and JUnit 4.0
Date: Mon, 20 Mar 2006 09:32:52 +0100

Well.. you could use the same approach in your testcases for getting
surefire to recognise the testcases by using the inner testsuite class
<code>
public static junit.framework.Test suite() {
    return new JUnit4TestAdapter(SimpleTest.class);
}
</code>
But to get maven to compile with annotations you need to set the 1.5
option on the compiler: see here for more info on that:
http://maven.apache.org/general.html

/Kaare

On 19/03/06, Gianfranco Oldani <[EMAIL PROTECTED]> wrote:
> Hi Kaare,
> Thanks a lot for your answer. But I currently not use Eclipse and its a
> problem related to the compilation of annotated source in the maven 2 build
> process. DO I miss something in your answer?
>
> Regards
>
> Gianfranco OLDANI
> Mob: +41787330350
> Web: www.gfoldani.com
>
>
>
> ----Original Message Follows----
> From: "Kaare Nilsen" <[EMAIL PROTECTED]>
> Reply-To: "Maven Users List" <users@maven.apache.org>
> To: "Maven Users List" <users@maven.apache.org>
> Subject: Re: MVN and JUnit 4.0
> Date: Sun, 19 Mar 2006 09:21:32 +0100
>
> Hi..
>
> There could possibly be more than one way of doing this, but the
> solution in this blog :
> http://jroller.com/page/eu?entry=running_junit_4_test_cases
> would at least work
>
> /Kaare
> On 17/03/06, Gianfranco Oldani <[EMAIL PROTECTED]> wrote:
>  > Hello,
> > Somebody can help me to make maven 2 run with junit 4.0 and annotations
> ?
>  >
>  > Thanks a lot
>  >
>  > Gianfranco OLDANI
>  > Mob: +41787330350
>  > Web: www.gfoldani.com
>  >
>  > _________________________________________________________________
>  > Sélectionnez les meilleurs albums pour votre discothèque MP3 en ligne!
>  > http://sib1.od2.com/common/Framework.aspx?shid=0045002E
>  >
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > For additional commands, e-mail: [EMAIL PROTECTED]
>  >
>  >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> _________________________________________________________________
> Sélectionnez les meilleurs albums pour votre discothèque MP3 en ligne!
> http://sib1.od2.com/common/Framework.aspx?shid=0045002E
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

_________________________________________________________________
Sélectionnez les meilleurs albums pour votre discothèque MP3 en ligne! http://sib1.od2.com/common/Framework.aspx?shid=0045002E


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to