The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Software Testing >> Unit Testing

Pages: 1
Zuid
Newbie


Reged: 10/08/10
Posts: 1
Unit testing a method that takes org.w3c.dom.Node
      #645050 - 10/08/10 05:28 PM

Hi everyone,

I want to know how to write a unit test for method that take org.w3c.dom.Node as its parameter and returns an Object.

here is the code
public static Object unmarshall(Node src) throws IllegalArgumentException {

Object obj = null;
try {
JAXBContext jc = JAXBContext.newInstance("com.test.xml");
Unmarshaller um = jc.createUnmarshaller();
//um.setValidating(true);
obj = um.unmarshal(src);

} catch (Exception e) {
e.printStackTrace();
throw new IllegalArgumentException(e.getMessage());
}
Logger.message(JaxbSerializer.class, "unmarshall sucess");
return obj;

}

Thanks in advance


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 3 anonymous users are browsing this forum.

Moderator:  AJ, Jeanj 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 1835

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5