Solved

unit testing in java and jsfunit

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.

770 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