maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Petr V." <greatman...@yahoo.com>
Subject Re: Can I run individual test in maven
Date Tue, 04 Nov 2008 21:09:49 GMT
Thanks Rafael for the help.

I created this project via maven commands on DOS.

I imported then maven project in Eclipse.

Now this maven project was not in build path so I believe I was getting error of not finding
any junit test . 

Then  I clicked on project and select build path --> use as source folder

Now when I entered to Run menu, Run Configurations..., in left site tree, selected JUnit,

and my JUnitTest Case. I changed the runner for JUnit4, and the test complains 
"java.lang.Exception  No runnable methods"

Are you using maven project in Eclipse ? Did you set it in build bath as source folder ?

Thanks,

Petr

--- On Wed, 11/5/08, Rafael Trestini <trestini@gmail.com> wrote:
From: Rafael Trestini <trestini@gmail.com>
Subject: Re: Can I run individual test in maven
To: "Maven Users List" <users@maven.apache.org>
Date: Wednesday, November 5, 2008, 1:38 AM

Petr,

When I tried to reproduce your scenario, I got the message "No JUnit
test Found *for JUnit 3 runner*", because my set of tests was writen
under junit 3.8.1. For this, I've entered in Run menu, Run
Configurations..., in left site tree, selected JUnit, and my JUnit
Test Case. Finally, I've changed the runner for JUnit4, and the test
works fine.

Are you using maven eclipse plugin to generate your project?

Rafael Trestini

On Tue, Nov 4, 2008 at 6:06 PM, Petr V. <greatman787@yahoo.com> wrote:
> Rafael,
>
> I am using Junit 4.5
>
> My test class is as follows
>
> import org.junit.Test;
> import junit.framework.Assert;
>
> public class TestContract {
>
>     @Test
>     public void testCom() throws Exception
>     {
>                         Assert.assertEquals(true, true);
>
>     }
> }
>
> When I issue "mvn test" from command prompt it works fine. It
even works
> fine if I right click on component/module in eclipse and choose mvn test
> menu. But when I right click on test class in package explorer and ask it
to
> run as junit test then  it says "No JUnit Tests Found". Any idea
what is
> going on ?
>
> Thanks,
>
> Petr
>
> --- On Wed, 11/5/08, Rafael Trestini <trestini@gmail.com> wrote:
>
> From: Rafael Trestini <trestini@gmail.com>
> Subject: Re: Can I run individual test in maven
> To: "Maven Users List" <users@maven.apache.org>,
greatman787@yahoo.com
> Date: Wednesday, November 5, 2008, 12:06 AM
>
> Petr,
>
> Please, let me know: are you using junit to code your test cases? If
> yes, eclipse has a "native" plugin to deal with junit - no maven
or
> m2eclipse is needed. Is just to open your test case, Run As, JUnit
> Test Case.
>
> When 'mvn test' is running, it means that all test cases will be
> executed, to ensure that the package is not "broken" due to
logical
> errors.
>
> Rafael Trestini
>
> On Tue, Nov 4, 2008 at 4:49 PM, Petr V.
>  <greatman787@yahoo.com> wrote:
>> When I issue "mvn test" command, all my tests in test
directory
> are executed, what if I need to run some particular test(assuming we have
> different test classes instead of one big test class). And is it possible
in
> eclipse to run one particular test with m2eclipse ?
>>
>> Thanks,
>>
>> Petr
>>
>>
>>
>>
>
>
>
> --
> Responsibility is the price of freedom
>
>



-- 
Responsibility is the price of freedom

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




      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message