Solved

unit testing in java and jsfunit

Posted on 2013-12-03
5
427 Views
Last Modified: 2014-01-02
Hi,

I was going through below link

http://java.dzone.com/articles/junit-tutorial-beginners


I wonder where i can find info on comparing complex objects and unit testing them not simple arthematic operations.

I am also new to jsfunit where to begin and find good resources on that.


Please advise. Any ideas, resources, sample code highly appreciated. thanks in advance
0
Comment
Question by:gudii9
  • 3
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 39699948
Can you provide an example of a "complex object" that you are unsure as to how to test?

One possibility is that your complex object implements the .equals() method in an appropriate manner, in which case the unit test is made easy as you can still just use a typical "assertEquals()" junit assertion. Otherwise, you just have multiple assertions for each of the different properties of your complex object. If you can provide an example it would make it much easier to demonstrate the idea.
0
 
LVL 7

Author Comment

by:gudii9
ID: 39709187
challenge is at new client projects, when i see them first time i feel them as complex objects which i cannot post here.  But i will follow your advise on assertEquals().

What is JSFUNIT, what for it is used. I never used it. Is it simple to master. Please advise.
0
 
LVL 35

Expert Comment

by:mccarl
ID: 39710268
jsfunit is just a library for making the testing of JSF applications easier (JSF = JavaServer Faces). If your application isn't JSF or you don't know what this is, then you don't need to worry about jsfunit.
0
 
LVL 7

Author Comment

by:gudii9
ID: 39712256
my application is in JSF 2.0. The challenge i am facing in writing the unit test cases is when i click one button in say xyz.xhtml it is going to other page  say abc.xhtml. I need to validate few pages in abc.xhtml to make sure the drop down values, text values are coming as expeted. I do not know how to write test case in this scenario.

I see some examples here
https://source.jboss.org/browse/JSFUnit/trunk/jboss-jsfunit-examples
but not sure how to download and run eclipse in one stroke.

I see couple of example here but not clear exactly what authors did.
http://www.mastertheboss.com/jsf/jsfunit-tutorial
http://www.javabeat.net/introduction-to-jsfunit/
i  tried to download podcat from here but link seems not working
http://www.jsfcentral.com/articles/silvert-08-09.html
please advise
0
 
LVL 7

Author Comment

by:gudii9
ID: 39738534
One possibility is that your complex object implements the .equals() method in an appropriate manner,

what it means.
Please advise
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question