This content has been marked as final.
Show 1 reply
-
1. Re: Seam Unit Testing using TestNG
xsalefter.xsalefter.yahoo.com Dec 7, 2009 8:28 PM (in response to lavanyak)Can you describe more about
this is not working for me.
?For unit test, I'm follow some instruction from the reference book, and run well:
public class EntityClassesTest extends SeamTest { // ... some code to initialize data... // @Test public void testCategoryEntity() { // Get the third data from sample list. Category c3 = this.sampleCategories().get(2); // Test for the original data. assert c3.getId().equals(3L); assert c3.getName().equals("Third Category"); assert c3.getDescription().equals("Third Category Description"); // change some original data c3.setId(10L); c3.setName("Thirty Category"); c3.setDescription("Thirty Category Description"); // Test original data has been changed (using "not" semantics) assert !c3.getId().equals(3L); assert !c3.getName().equals("Third Category"); assert !c3.getDescription().equals("Third Category Description"); // Test changed data assert c3.getId() == 10L; assert c3.getName().equals("Thirty Category"); assert c3.getDescription().equals("Thirty Category Description"); }
And for the testng configuration xml:
<!-- EntityClassesTest.xml --> <!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" > <suite name="Simple Sales Test Suite" verbose="2" parallel="false"> <test name="EntityClassesTest - Test all entity classes."> <classes> <class name="com.xl.simplesales.test.unit.EntityClassesTest" /> </classes> </test> </suite>
But, yes, for component/integration test I have some problem described here.