Solved

unit testing in java and jsfunit

Posted on 2013-12-03
5
405 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
listing all functions in JavaScript 19 176
Basic Java Case or If-Else statement... 3 43
object oriented programming comparison 5 54
oracle 11g 23 48
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
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.

911 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

22 Experts available now in Live!

Get 1:1 Help Now