Solved

unit testing in java and jsfunit

Posted on 2013-12-03
5
393 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
One possibility is that your complex object implements the .equals() method in an appropriate manner,

what it means.
Please advise
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now