[Java BASICS3] XML, Unit Testing

Source: Internet
Author: User

What ' s the difference between DOM and SAX? DOM creates tree-like representation of the XML document in memory, SAX is event-based.
What ' s the difference between XSD and DTD? XSD is in XML, DTD is not. XSD is much more comprehensive than DTD
You ' re given an XML file, and you ' re supposed to retrieve the value of a specific element in the file. How does that? Open-ended question. See how the candidate uses various types of parsers (DOM, SAX, etc) and see if he explores the usage of XPath.

you ' re supposed to unit test Java class that accesses a database,
in a machine that doesn ' t has database server installed,
and no external connectivity at all. What ' s your approach?
open-ended question. See if the answer tackles the problem effectively.
See if he/she suggests mocking as an option
use Code coverage tool like Cobertura, Emma, etc
how do you unit-test a private method? -use Reflection, set accessible property of this method to true
-call an accessible met Hod that calls the private method and observe the effect caused by calling the private method

[Java BASICS3] XML, Unit testing

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.