Java Doc for TestXPathExpressionEngine.java in  » Library » Apache-commons-configuration-1.4-src » org » apache » commons » configuration » tree » xpath » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache commons configuration 1.4 src » org.apache.commons.configuration.tree.xpath 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.commons.configuration.tree.xpath.TestXPathExpressionEngine

TestXPathExpressionEngine
public class TestXPathExpressionEngine extends TestCase (Code)
Test class for XPathExpressionEngine.
author:
   Oliver Heger
version:
   $Id: TestXPathExpressionEngine.java 502705 2007-02-02 19:55:37Z oheger $

Inner Class :static class MockJXPathContext extends JXPathContextReferenceImpl
Inner Class :static class MockJXPathContextExpressionEngine extends XPathExpressionEngine

Field Summary
final static  ConfigurationNodeROOT
     Constant for the test root node.
final static  StringTEST_KEY
     Constant for the valid test key.
 XPathExpressionEngineengine
     The expression engine to be tested.


Method Summary
protected  voidcheckSelectCalls(int expected)
     Checks if the JXPath context's selectNodes() method was called as often as expected.
protected  voidsetUp()
    
public  voidtestCreateContext()
     Tests if the used JXPathContext is correctly initialized.
public  voidtestNodeKeyAttribute()
     Tests nodeKey() for an attribute node.
public  voidtestNodeKeyForRootChild()
     Tests node key() for direct children of the root node.
public  voidtestNodeKeyForRootNode()
     Tests nodeKey() for the root node.
public  voidtestNodeKeyNormal()
     Tests a normal call of nodeKey().
public  voidtestPrepareAddAttribute()
     Tests adding a new attribute node.
public  voidtestPrepareAddAttributePath()
     Tests adding a complete path whose final node is an attribute.
public  voidtestPrepareAddEmptyKey()
     Tests an add operation where the key is null.
public  voidtestPrepareAddEmptyPath()
     Tests an add operation with an empty path for the new node.
public  voidtestPrepareAddInvalidAttributePath()
     Tests an add operation with an invalid path: the path contains an attribute in the middle part.
public  voidtestPrepareAddInvalidAttributePath2()
     Tests an add operation with an invalid path: the path contains an attribute after a slash.
public  voidtestPrepareAddInvalidFormat()
     Tests an add operation where the passed in key has an invalid format: it does not contain a whitspace.
public  voidtestPrepareAddInvalidParent()
     Tests an add operation with a query that does not return a single node.
public  voidtestPrepareAddInvalidPath()
     Tests an add operation with an invalid path.
public  voidtestPrepareAddInvalidPathMultipleAttributes()
     Tests an add operation with an invalid path that contains multiple attribute components.
public  voidtestPrepareAddInvalidPathWithSlash()
     Tests an add operation with an invalid path that starts with a slash.
public  voidtestPrepareAddNode()
     Tests adding a single child node.
public  voidtestPrepareAddNullKey()
     Tests an add operation where the key is null.
public  voidtestPrepareAddPath()
     Tests adding a complete path.
public  voidtestPrepareAddRootAttribute()
     Tests adding a new attribute to the root.
public  voidtestPrepareAddRootChild()
     Tests adding a new node to the root.
public  voidtestQueryExpression()
     Tests the query() method with a normal expression.
public  voidtestQueryWithEmptyKey()
     Tests a query with an empty key.
public  voidtestQueryWithNullKey()
     Tests a query with a null key.
public  voidtestQueryWithoutResult()
     Tests a query that has no results.

Field Detail
ROOT
final static ConfigurationNode ROOT(Code)
Constant for the test root node.



TEST_KEY
final static String TEST_KEY(Code)
Constant for the valid test key.



engine
XPathExpressionEngine engine(Code)
The expression engine to be tested.





Method Detail
checkSelectCalls
protected void checkSelectCalls(int expected)(Code)
Checks if the JXPath context's selectNodes() method was called as often as expected.
Parameters:
  expected - the number of expected calls



setUp
protected void setUp() throws Exception(Code)



testCreateContext
public void testCreateContext()(Code)
Tests if the used JXPathContext is correctly initialized.



testNodeKeyAttribute
public void testNodeKeyAttribute()(Code)
Tests nodeKey() for an attribute node.



testNodeKeyForRootChild
public void testNodeKeyForRootChild()(Code)
Tests node key() for direct children of the root node.



testNodeKeyForRootNode
public void testNodeKeyForRootNode()(Code)
Tests nodeKey() for the root node.



testNodeKeyNormal
public void testNodeKeyNormal()(Code)
Tests a normal call of nodeKey().



testPrepareAddAttribute
public void testPrepareAddAttribute()(Code)
Tests adding a new attribute node.



testPrepareAddAttributePath
public void testPrepareAddAttributePath()(Code)
Tests adding a complete path whose final node is an attribute.



testPrepareAddEmptyKey
public void testPrepareAddEmptyKey()(Code)
Tests an add operation where the key is null.



testPrepareAddEmptyPath
public void testPrepareAddEmptyPath()(Code)
Tests an add operation with an empty path for the new node.



testPrepareAddInvalidAttributePath
public void testPrepareAddInvalidAttributePath()(Code)
Tests an add operation with an invalid path: the path contains an attribute in the middle part.



testPrepareAddInvalidAttributePath2
public void testPrepareAddInvalidAttributePath2()(Code)
Tests an add operation with an invalid path: the path contains an attribute after a slash.



testPrepareAddInvalidFormat
public void testPrepareAddInvalidFormat()(Code)
Tests an add operation where the passed in key has an invalid format: it does not contain a whitspace. This will cause an error.



testPrepareAddInvalidParent
public void testPrepareAddInvalidParent()(Code)
Tests an add operation with a query that does not return a single node.



testPrepareAddInvalidPath
public void testPrepareAddInvalidPath()(Code)
Tests an add operation with an invalid path.



testPrepareAddInvalidPathMultipleAttributes
public void testPrepareAddInvalidPathMultipleAttributes()(Code)
Tests an add operation with an invalid path that contains multiple attribute components.



testPrepareAddInvalidPathWithSlash
public void testPrepareAddInvalidPathWithSlash()(Code)
Tests an add operation with an invalid path that starts with a slash.



testPrepareAddNode
public void testPrepareAddNode()(Code)
Tests adding a single child node.



testPrepareAddNullKey
public void testPrepareAddNullKey()(Code)
Tests an add operation where the key is null.



testPrepareAddPath
public void testPrepareAddPath()(Code)
Tests adding a complete path.



testPrepareAddRootAttribute
public void testPrepareAddRootAttribute()(Code)
Tests adding a new attribute to the root.



testPrepareAddRootChild
public void testPrepareAddRootChild()(Code)
Tests adding a new node to the root.



testQueryExpression
public void testQueryExpression()(Code)
Tests the query() method with a normal expression.



testQueryWithEmptyKey
public void testQueryWithEmptyKey()(Code)
Tests a query with an empty key. This should directly return the root node without invoking the JXPathContext.



testQueryWithNullKey
public void testQueryWithNullKey()(Code)
Tests a query with a null key. Same as an empty key.



testQueryWithoutResult
public void testQueryWithoutResult()(Code)
Tests a query that has no results. This should return an empty list.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.