Solved

unit testing in java and jsfunit

Posted on 2013-12-03
5
445 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 36

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 36

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

635 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