You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Guy Gershoni <gu...@conchus.com> on 2010/06/15 04:22:36 UTC

Running ant run-single-test-suite on your own component

Hi Guys,

I am trying to run "ant run-single-test-suite" on a component I
created using "ant create-component".

I added a java file to the source which extends OFBizTestCase and
referenced it in testdef/ComponentTests.xml as a junit test suite.

I modified the build.xml build target to build <main-jar/> and <test-jar/>.

But when I run "ant run-single-test-suite -Dtest.component=mycomponent
-Dtest.suiteName=mytests" I get the following:

org.ofbiz.base.start.StartupException: Cannot start()
org.ofbiz.testtools.TestRunContainer (No tests found (mycomponent /
mytests / null))

Do I need to modify something to include the test jar or something?

Guy

-- 
Guy Gershoni
Conchus
Email: guy@conchus.com
Web: www.conchus.com

Re: Running ant run-single-test-suite on your own component

Posted by Guy Gershoni <gu...@conchus.com>.
Oh how embarrassing.... case sensitive.  I had in ComponentTests.xml
MyTests as name of suite... changed to mytests and works :-)

Guy

It does complain about not

On 15 June 2010 12:34, Scott Gray <sc...@hotwaxmedia.com> wrote:
> Hi Guy,
>
> It should work fine, I've used it in the past without any problems.  Some things to check:
> - is your component called mycomponent in it's ofbiz-component.xml?
> - is the test suite correctly referenced in the ofbiz-component.xml?
> - is the test suite called mytests in the test suite file?
> - are your test methods correctly named?  They should be called testSomething i.e. all test methods must be prepended with "test" and (I think) have "throws Exception" return void
>
> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 15/06/2010, at 2:22 PM, Guy Gershoni wrote:
>
>> Hi Guys,
>>
>> I am trying to run "ant run-single-test-suite" on a component I
>> created using "ant create-component".
>>
>> I added a java file to the source which extends OFBizTestCase and
>> referenced it in testdef/ComponentTests.xml as a junit test suite.
>>
>> I modified the build.xml build target to build <main-jar/> and <test-jar/>.
>>
>> But when I run "ant run-single-test-suite -Dtest.component=mycomponent
>> -Dtest.suiteName=mytests" I get the following:
>>
>> org.ofbiz.base.start.StartupException: Cannot start()
>> org.ofbiz.testtools.TestRunContainer (No tests found (mycomponent /
>> mytests / null))
>>
>> Do I need to modify something to include the test jar or something?
>>
>> Guy
>>
>> --
>> Guy Gershoni
>> Conchus
>> Email: guy@conchus.com
>> Web: www.conchus.com
>
>



-- 
Guy Gershoni
Conchus
Email: guy@conchus.com
Web: www.conchus.com

Re: Running ant run-single-test-suite on your own component

Posted by Scott Gray <sc...@hotwaxmedia.com>.
Hi Guy,

It should work fine, I've used it in the past without any problems.  Some things to check:
- is your component called mycomponent in it's ofbiz-component.xml?
- is the test suite correctly referenced in the ofbiz-component.xml?
- is the test suite called mytests in the test suite file?
- are your test methods correctly named?  They should be called testSomething i.e. all test methods must be prepended with "test" and (I think) have "throws Exception" return void

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 15/06/2010, at 2:22 PM, Guy Gershoni wrote:

> Hi Guys,
> 
> I am trying to run "ant run-single-test-suite" on a component I
> created using "ant create-component".
> 
> I added a java file to the source which extends OFBizTestCase and
> referenced it in testdef/ComponentTests.xml as a junit test suite.
> 
> I modified the build.xml build target to build <main-jar/> and <test-jar/>.
> 
> But when I run "ant run-single-test-suite -Dtest.component=mycomponent
> -Dtest.suiteName=mytests" I get the following:
> 
> org.ofbiz.base.start.StartupException: Cannot start()
> org.ofbiz.testtools.TestRunContainer (No tests found (mycomponent /
> mytests / null))
> 
> Do I need to modify something to include the test jar or something?
> 
> Guy
> 
> -- 
> Guy Gershoni
> Conchus
> Email: guy@conchus.com
> Web: www.conchus.com