Page 1 of 1

Testng Test Cases

Posted: Sat Oct 11, 2014 1:07 am
by prabhat.kataria
I want to write test cases to test some part of code in site module. I see testng library is added by default in DemoSite pom.xml and thus trying to use the same to write test case. Also I want to use spring context so that I can use actual beans that are created in dev or prod environment.

I followed tutorial at http://www.mkyong.com/unittest/testng-s ... n-example/ but everytime I end up with exceptions saying some or the other bean not found. I added all the spring xml files that are inside WEB-INF to @ContextConfiguration but still no help.

Does anybody have a sample test case using spring context

@TeamBLC you guys must be using test cases to test your changes before pushing it in new release. Can you post a sample test case which spring context?

Re: Testng Test Cases

Posted: Sun Oct 12, 2014 9:57 pm
by phillipuniverse
Hey Prabhat, we are actually migrating to use Groovy and Spock for our test cases. We have already done some initial work to make this easier with the commits on https://github.com/BroadleafCommerce/Br ... ssues/1127. Eventually all of our testing will be based on Spock and Groovy with the Spring 4 integration test project.

If you want to make use of what we currently have in the integration test project, you should extend from BaseTest (https://github.com/BroadleafCommerce/Br ... eTest.java) and add in your custom applicationContext files to the static 'moduleContexts' list.

Re: Testng Test Cases

Posted: Fri Nov 07, 2014 7:48 am
by chennaiwebdesign
Hi guys,Thanks for your information.It more important for us.How to write test cases.Please any one reply me.Thanks advance. :D

Re: Testng Test Cases

Posted: Fri Nov 06, 2015 2:24 am
by 908808303@qq.com
I followed the document
http://www.broadleafcommerce.com/docs/core/current/tutorials/testing-tutorials/groovy-spock-integration-test
but no test to run. Neithor java test nor groovy test file to run. I attached my DemoSite/pom.xml file.
This was the first time I use groovy/spock.
@phillipuniverse Can you post a sample test case

Re: Testng Test Cases

Posted: Mon Jun 06, 2016 4:47 am
by georgiamenzel
First i would like thank you for the sharing .this very important information for me.I so many cases we need to create so many test cases for testing process.This is the very useful information for me.Thank you so much