Java Doc for BaseDirContextTestCase.java in  » Sevlet-Container » tomcat-catalina » org » apache » naming » resources » 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 » Sevlet Container » tomcat catalina » org.apache.naming.resources 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.naming.resources.BaseDirContextTestCase

All known Subclasses:   org.apache.naming.resources.WARDirContextTestCase,  org.apache.naming.resources.FileDirContextTestCase,
BaseDirContextTestCase
abstract public class BaseDirContextTestCase extends TestCase (Code)

Basic unit tests for the javax.naming.directory.DirContext implementations. This class must be subclassed for each individual DirContext implementation.

WARNING: These tests make certain assumptions that can generate "false negative" results if they are violated:

  • The pathname of a directory (or WAR file) containing the static resources of the /examples web application shipped with Tomcat is passed to our test class as a system property named doc.base.
  • The entry names that can be found in the top-level DirContext of the static resources are enumerated in the topLevelNames variable.
  • The entry names that can be found in the WEB-INF DirContext of the static resources are enumerated in the webInfNames variable.
  • The entry names in either the top-level or WEB-INF DirContext contexts that should themselves be DirContext implementations (i.e. "subdirectories" in the static resources for this web application) are enumerated in the dirContextNames variable.

author:
   Craig R. McClanahan
version:
   $Revision: 1.3 $ $Date: 2004/02/27 14:58:55 $


Field Summary
protected  DirContextcontext
     A directory context implementation to be tested.
final protected static  StringdirContextNames
     Entry names that must be DirContexts.
protected  StringdocBase
     The pathname of the document base directory for this directory context.
final protected static  StringtopLevelNames
     The set of names that should be present in the top-level directory context.
final protected static  StringwebInfAttrs
     The set of names that should be attributes of WEB-INF.
final protected static  StringwebInfNames
     The set of names that should be present in the WEB-INF directory context.
final protected static  StringwebXmlAttrs
     The set of names that should be attributes of WEB-INF/web.xml.

Constructor Summary
public  BaseDirContextTestCase(String name)
     Construct a new instance of this test case.

Method Summary
protected  voidcheckList(NamingEnumeration ne, String list)
     Check the results of a list() call against the specified entry list.
protected  voidcheckListBindings(NamingEnumeration ne, String list)
     Check the results of a listBindings() call against the specified entry list.
protected  voidcheckWebInfAttributes(Attributes attrs, Date creationDate, long contentLength, String displayName, Date lastModifiedDate)
     Check the attributes associated with a WEB-INF entry.
protected  voidcheckWebXmlAttributes(Attributes attrs, Date creationDate, long contentLength, String displayName, Date lastModifiedDate)
     Check the attributes associated with a WEB-INF/web.xml entry.
protected  intgetIndex(String name, String list)
     Return the index of the specified name in the specified list, or -1 if the name is not present.
protected  booleanisDirContext(String name)
    
protected  booleanisListed(String name, String list)
     Returns true if the specified name is found in the specified list.
abstract public  voidsetUp()
     Set up instance variables required by this test case.
abstract public  voidtearDown()
     Tear down instance variables required by this test case.
abstract public  voidtestGetAttributesWebInf()
     Test the attributes returned for the WEB-INF entry.
abstract public  voidtestGetAttributesWebXml()
     Test the attributes returned for the WEB-INF/web.xml entry.
public  voidtestListBindingsTopLevel()
     We should be able to list the bindings of the top-level context itself, and locate some entries we know are there.
public  voidtestListBindingsWebInfDirect()
     We should be able to list the bindings of the WEB-INF entry, and locate some entries we know are there.
public  voidtestListBindingsWebInfIndirect()
     We should be able to list the bindings of the WEB-INF entry, and locate some entries we know are there.
public  voidtestListTopLevel()
     We should be able to list the contents of the top-level context itself, and locate some entries we know are there.
public  voidtestListWebInfDirect()
     We should be able to list the contents of the WEB-INF entry, and locate some entries we know are there.
public  voidtestListWebInfIndirect()
     We should be able to list the contents of the WEB-INF entry, and locate some entries we know are there.

Field Detail
context
protected DirContext context(Code)
A directory context implementation to be tested.



dirContextNames
final protected static String dirContextNames(Code)
Entry names that must be DirContexts. Names not on this list are assumed to be Resources.



docBase
protected String docBase(Code)
The pathname of the document base directory for this directory context.



topLevelNames
final protected static String topLevelNames(Code)
The set of names that should be present in the top-level directory context.



webInfAttrs
final protected static String webInfAttrs(Code)
The set of names that should be attributes of WEB-INF.



webInfNames
final protected static String webInfNames(Code)
The set of names that should be present in the WEB-INF directory context.



webXmlAttrs
final protected static String webXmlAttrs(Code)
The set of names that should be attributes of WEB-INF/web.xml.




Constructor Detail
BaseDirContextTestCase
public BaseDirContextTestCase(String name)(Code)
Construct a new instance of this test case.
Parameters:
  name - Name of the test case




Method Detail
checkList
protected void checkList(NamingEnumeration ne, String list) throws NamingException(Code)
Check the results of a list() call against the specified entry list. enum The naming enumeration we are checking
Parameters:
  list - The list of entry names we are expecting
exception:
  NamingException - if a naming exception occurs



checkListBindings
protected void checkListBindings(NamingEnumeration ne, String list) throws NamingException(Code)
Check the results of a listBindings() call against the specified entry list. enum The naming enumeration we are checking
Parameters:
  list - The list of entry names we are expecting
exception:
  NamingException - if a naming exception occurs



checkWebInfAttributes
protected void checkWebInfAttributes(Attributes attrs, Date creationDate, long contentLength, String displayName, Date lastModifiedDate) throws NamingException(Code)
Check the attributes associated with a WEB-INF entry.
Parameters:
  attrs - The attributes for this entry
Parameters:
  creationDate - The creation date for this entry
Parameters:
  contentLength - The content length for this entry
Parameters:
  displayName - The display name for this entry
Parameters:
  lastModifiedDate - The last modified date for this entry



checkWebXmlAttributes
protected void checkWebXmlAttributes(Attributes attrs, Date creationDate, long contentLength, String displayName, Date lastModifiedDate) throws NamingException(Code)
Check the attributes associated with a WEB-INF/web.xml entry.
Parameters:
  attrs - The attributes for this entry
Parameters:
  creationDate - The creation date for this entry
Parameters:
  contentLength - The content length for this entry
Parameters:
  displayName - The display name for this entry
Parameters:
  lastModifiedDate - The last modified date for this entry



getIndex
protected int getIndex(String name, String list)(Code)
Return the index of the specified name in the specified list, or -1 if the name is not present.
Parameters:
  name - Name to be looked up
Parameters:
  list - List of names to be checked



isDirContext
protected boolean isDirContext(String name)(Code)
Is an entry of the specified name supposed to be a DirContext?
Parameters:
  name - Name to be checked



isListed
protected boolean isListed(String name, String list)(Code)
Returns true if the specified name is found in the specified list.
Parameters:
  name - Name to be looked up
Parameters:
  list - List to be looked up into



setUp
abstract public void setUp()(Code)
Set up instance variables required by this test case. This method MUST be implemented by a subclass.



tearDown
abstract public void tearDown()(Code)
Tear down instance variables required by this test case. This method MUST be implemented by a subclass.



testGetAttributesWebInf
abstract public void testGetAttributesWebInf()(Code)
Test the attributes returned for the WEB-INF entry.



testGetAttributesWebXml
abstract public void testGetAttributesWebXml()(Code)
Test the attributes returned for the WEB-INF/web.xml entry.



testListBindingsTopLevel
public void testListBindingsTopLevel()(Code)
We should be able to list the bindings of the top-level context itself, and locate some entries we know are there.



testListBindingsWebInfDirect
public void testListBindingsWebInfDirect()(Code)
We should be able to list the bindings of the WEB-INF entry, and locate some entries we know are there.



testListBindingsWebInfIndirect
public void testListBindingsWebInfIndirect()(Code)
We should be able to list the bindings of the WEB-INF entry, and locate some entries we know are there.



testListTopLevel
public void testListTopLevel()(Code)
We should be able to list the contents of the top-level context itself, and locate some entries we know are there.



testListWebInfDirect
public void testListWebInfDirect()(Code)
We should be able to list the contents of the WEB-INF entry, and locate some entries we know are there.



testListWebInfIndirect
public void testListWebInfIndirect()(Code)
We should be able to list the contents of the WEB-INF entry, and locate some entries we know are there.



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