cancel
Showing results for 
Search instead for 
Did you mean: 

Execute Unit Tests of AddOns and CommonWeb

Former Member

I got different Addons and CommomWeb extensions using Hybris 6.6 which have the corresponding java sources within the following folders:

 myaddonextension/acceleratoraddon/web/tsrc
 myaddonextension/acceleratoraddon/web/testsrc
 mycommonwebextension/commonweb/tsrc
 mycommonwebextension/commonweb/testsrc

Within the Storefront Extension I have the following distribution logic within buildcallbacks.xml

 <macrodef name="mystorefrontextension_after_build">
     <sequential>
     ...
         <copyAddOnToExtension addonextension="myaddonextension" addonresource="@{addOnFile}" target="mystorefrontextension"/>
     ...
         <copyCommonWebToExtension commonwebextension="mycommonwebextension" commonwebresource="/src" target="mystorefrontextension"/>
     </sequential>
 </macrodef>

These two calls copy the corresponding sources to the storefront under the following folders:

 mystorefrontextension/addonsrc
 mystorefrontextension/addontestsrc
 mystorefrontextension/commonwebsrc

First of all, the commonwebtestsrc folder is missing, because it get's not copied within <copyCommonWebToExtension>. I guess this is a Hybris Bug.

But when I call ant unittests -Dtestclasses.extensions="mystorefrontextension, mycommonwebextension, myaddonextension" none of the tests are called. Neither the tests within the addon / commonweb extensions, nor the copied tests within addontestsrc.

What am I doing wrong?


Update: I found a similar post here: https://answers.sap.com/questions/12768338/is-it-possible-to-run-unit-tests-within-addons-whe.html

The posted solution did not work.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Have you checked **-webtestclasses.xml* in your storefront? It should contain all test classes from storefront and addons that is uses