You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by lulynn_2008 <lu...@163.com> on 2015/01/16 03:55:33 UTC

Is ther a way to run one test of special unit test?

Hi All,

There are multiple tests in one Test* file. Is there a way to just run only one pointed test?

Thanks

RE: Re:Re: Is ther a way to run one test of special unit test?

Posted by "Zhang, Liyun" <li...@intel.com>.
Hi:
If you want to run one unittest, you can use following command:
ant -Dtestcase=$TestFileName -Dexectype=$mode -DdebugPort=$debugPort test

$mode can be : MR, tez, spark


Best regards
Zhang,Liyun





-----Original Message-----
From: lulynn_2008 [mailto:lulynn_2008@163.com] 
Sent: Monday, January 19, 2015 11:57 AM
To: user@pig.apache.org
Cc: dev@pig.apache.org
Subject: Re:Re: Is ther a way to run one test of special unit test?

Thanks for reply. But Pig is using ant.

At 2015-01-16 15:06:51, "Pradeep Gollakota" <pr...@gmail.com> wrote:
>If you're using maven AND using surefire plugin 2.7.3+ AND using Junit 
>4, then you can do this by specifying -Dtest=TestClass#methodName
>
>ref:
>http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-
>test.html
>
>On Thu, Jan 15, 2015 at 8:02 PM, Cheolsoo Park <pi...@gmail.com> wrote:
>
>> I don't think you can disable test cases on the fly in JUnit. You 
>> will need to add @Ignore annotation and recompile the test file. 
>> Correct me if I am wrong.
>>
>> On Thu, Jan 15, 2015 at 6:55 PM, lulynn_2008 <lu...@163.com> wrote:
>>
>> > Hi All,
>> >
>> > There are multiple tests in one Test* file. Is there a way to just 
>> > run only one pointed test?
>> >
>> > Thanks
>> >
>>

RE: Re:Re: Is ther a way to run one test of special unit test?

Posted by "Zhang, Liyun" <li...@intel.com>.
Hi:
If you want to run one unittest, you can use following command:
ant -Dtestcase=$TestFileName -Dexectype=$mode -DdebugPort=$debugPort test

$mode can be : MR, tez, spark


Best regards
Zhang,Liyun





-----Original Message-----
From: lulynn_2008 [mailto:lulynn_2008@163.com] 
Sent: Monday, January 19, 2015 11:57 AM
To: user@pig.apache.org
Cc: dev@pig.apache.org
Subject: Re:Re: Is ther a way to run one test of special unit test?

Thanks for reply. But Pig is using ant.

At 2015-01-16 15:06:51, "Pradeep Gollakota" <pr...@gmail.com> wrote:
>If you're using maven AND using surefire plugin 2.7.3+ AND using Junit 
>4, then you can do this by specifying -Dtest=TestClass#methodName
>
>ref:
>http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-
>test.html
>
>On Thu, Jan 15, 2015 at 8:02 PM, Cheolsoo Park <pi...@gmail.com> wrote:
>
>> I don't think you can disable test cases on the fly in JUnit. You 
>> will need to add @Ignore annotation and recompile the test file. 
>> Correct me if I am wrong.
>>
>> On Thu, Jan 15, 2015 at 6:55 PM, lulynn_2008 <lu...@163.com> wrote:
>>
>> > Hi All,
>> >
>> > There are multiple tests in one Test* file. Is there a way to just 
>> > run only one pointed test?
>> >
>> > Thanks
>> >
>>

Re:Re: Is ther a way to run one test of special unit test?

Posted by lulynn_2008 <lu...@163.com>.
Thanks for reply. But Pig is using ant.

At 2015-01-16 15:06:51, "Pradeep Gollakota" <pr...@gmail.com> wrote:
>If you're using maven AND using surefire plugin 2.7.3+ AND using Junit 4,
>then you can do this by specifying -Dtest=TestClass#methodName
>
>ref:
>http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html
>
>On Thu, Jan 15, 2015 at 8:02 PM, Cheolsoo Park <pi...@gmail.com> wrote:
>
>> I don't think you can disable test cases on the fly in JUnit. You will need
>> to add @Ignore annotation and recompile the test file. Correct me if I am
>> wrong.
>>
>> On Thu, Jan 15, 2015 at 6:55 PM, lulynn_2008 <lu...@163.com> wrote:
>>
>> > Hi All,
>> >
>> > There are multiple tests in one Test* file. Is there a way to just run
>> > only one pointed test?
>> >
>> > Thanks
>> >
>>

Re:Re: Is ther a way to run one test of special unit test?

Posted by lulynn_2008 <lu...@163.com>.
Thanks for reply. But Pig is using ant.

At 2015-01-16 15:06:51, "Pradeep Gollakota" <pr...@gmail.com> wrote:
>If you're using maven AND using surefire plugin 2.7.3+ AND using Junit 4,
>then you can do this by specifying -Dtest=TestClass#methodName
>
>ref:
>http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html
>
>On Thu, Jan 15, 2015 at 8:02 PM, Cheolsoo Park <pi...@gmail.com> wrote:
>
>> I don't think you can disable test cases on the fly in JUnit. You will need
>> to add @Ignore annotation and recompile the test file. Correct me if I am
>> wrong.
>>
>> On Thu, Jan 15, 2015 at 6:55 PM, lulynn_2008 <lu...@163.com> wrote:
>>
>> > Hi All,
>> >
>> > There are multiple tests in one Test* file. Is there a way to just run
>> > only one pointed test?
>> >
>> > Thanks
>> >
>>

Re: Is ther a way to run one test of special unit test?

Posted by Pradeep Gollakota <pr...@gmail.com>.
If you're using maven AND using surefire plugin 2.7.3+ AND using Junit 4,
then you can do this by specifying -Dtest=TestClass#methodName

ref:
http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html

On Thu, Jan 15, 2015 at 8:02 PM, Cheolsoo Park <pi...@gmail.com> wrote:

> I don't think you can disable test cases on the fly in JUnit. You will need
> to add @Ignore annotation and recompile the test file. Correct me if I am
> wrong.
>
> On Thu, Jan 15, 2015 at 6:55 PM, lulynn_2008 <lu...@163.com> wrote:
>
> > Hi All,
> >
> > There are multiple tests in one Test* file. Is there a way to just run
> > only one pointed test?
> >
> > Thanks
> >
>

Re: Is ther a way to run one test of special unit test?

Posted by Pradeep Gollakota <pr...@gmail.com>.
If you're using maven AND using surefire plugin 2.7.3+ AND using Junit 4,
then you can do this by specifying -Dtest=TestClass#methodName

ref:
http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html

On Thu, Jan 15, 2015 at 8:02 PM, Cheolsoo Park <pi...@gmail.com> wrote:

> I don't think you can disable test cases on the fly in JUnit. You will need
> to add @Ignore annotation and recompile the test file. Correct me if I am
> wrong.
>
> On Thu, Jan 15, 2015 at 6:55 PM, lulynn_2008 <lu...@163.com> wrote:
>
> > Hi All,
> >
> > There are multiple tests in one Test* file. Is there a way to just run
> > only one pointed test?
> >
> > Thanks
> >
>

Re: Is ther a way to run one test of special unit test?

Posted by Cheolsoo Park <pi...@gmail.com>.
I don't think you can disable test cases on the fly in JUnit. You will need
to add @Ignore annotation and recompile the test file. Correct me if I am
wrong.

On Thu, Jan 15, 2015 at 6:55 PM, lulynn_2008 <lu...@163.com> wrote:

> Hi All,
>
> There are multiple tests in one Test* file. Is there a way to just run
> only one pointed test?
>
> Thanks
>

Re: Is ther a way to run one test of special unit test?

Posted by Cheolsoo Park <pi...@gmail.com>.
I don't think you can disable test cases on the fly in JUnit. You will need
to add @Ignore annotation and recompile the test file. Correct me if I am
wrong.

On Thu, Jan 15, 2015 at 6:55 PM, lulynn_2008 <lu...@163.com> wrote:

> Hi All,
>
> There are multiple tests in one Test* file. Is there a way to just run
> only one pointed test?
>
> Thanks
>