首页 > 代码库 > [Java Basics3] XML, Unit testing
[Java Basics3] XML, Unit testing
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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。