码迷,mamicode.com
首页 > 编程语言 > 详细

[Java Basics3] XML, Unit testing

时间:2014-09-09 11:21:18      阅读:237      评论:0      收藏:0      [点我收藏+]

标签:style   os   io   java   ar   cti   sp   on   c   

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 do you do 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 have 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
How do you ensure your unit tests have covered all paths / possibilities? Use code coverage tool like Cobertura, Emma, etc
How do you unit-test a private method? - Use Reflection, set accessible property of that method to true
- Call an accessible method that calls the private method and observe the effect caused by calling the private method

[Java Basics3] XML, Unit testing

标签:style   os   io   java   ar   cti   sp   on   c   

原文地址:http://www.cnblogs.com/chayu3/p/3961620.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!