Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.cactus.integration.ant.deployment.webapp
Class TestWebXmlMerger  view TestWebXmlMerger download TestWebXmlMerger.java

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.cactus.integration.ant.deployment.webapp.TestWebXmlMerger
All Implemented Interfaces:
junit.framework.Test

public final class TestWebXmlMerger
extends junit.framework.TestCase

Unit tests for WebXmlMerger. TODO: we need more tests for the security sections and the various references

Version:
$Id: TestWebXmlMerger.java,v 1.1 2004/05/31 20:05:21 vmassol Exp $

Field Summary
private  javax.xml.parsers.DocumentBuilder builder
          The JAXP document builder.
private  javax.xml.parsers.DocumentBuilderFactory factory
          The document builder factory.
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
TestWebXmlMerger()
           
 
Method Summary
 void setUp()
          Sets up the fixture, for example, open a network connection.
 void testMergeMultipleFiltersIntoEmptyDocument()
          Tests whether multiple filters are correctly merged into an empty descriptor.
 void testMergeMultipleServletsIntoEmptyDocument()
          Tests whether multiple servlet in the merge file are correctly inserted into an empty descriptor.
 void testMergeOneContextParamIntoDocumentWithAnotherContextParam()
          Tests whether a single context param is correctly merged into a descriptor that already contains another context param.
 void testMergeOneContextParamIntoDocumentWithSameContextParam()
          Tests whether a single context param in the merge descriptor is ignored because a context param with the same name already exists in the source descriptor.
 void testMergeOneContextParamIntoEmptyDocument()
          Tests whether a single context param is correctly merged into an empty descriptor.
 void testMergeOneEjbRefIntoEmptyDocument()
          Tests whether a single EJB reference is correctly inserted into an empty descriptor.
 void testMergeOneFilterIntoDocumentWithAnotherFilter()
          Tests whether a single filter is correctly merged into a descriptor that already contains another filter.
 void testMergeOneFilterIntoDocumentWithMultipleFilters()
          Tests whether a single filter is correctly merged into a descriptor that already contains multiple other filter definitions.
 void testMergeOneFilterIntoDocumentWithSameFilter()
          Tests whether a single filter in the merge descriptor is ignored because a filter with the same name already exists in the source descriptor.
 void testMergeOneFilterIntoDocumentWithSameFilterAndParam()
          Tests whether a filter initialization parameter is merged into the descriptor.
 void testMergeOneFilterIntoEmptyDocument()
          Tests whether a single filter is correctly merged into an empty descriptor.
 void testMergeOneFilterWithMultipleMappingsIntoEmptyDocument()
          Tests wether a single filter with multiple mappings is correctly merged into an empty descriptor.
 void testMergeOneFilterWithOneMappingIntoEmptyDocument()
          Tests whether a filter with one mapping is correctly merged into an empty descriptor.
 void testMergeOneServletIntoDocumentWithAnotherServlet()
          Tests whether a single servlet is correctly merged into a descriptor that already contains the definition of an other servlet.
 void testMergeOneServletIntoDocumentWithMultipleServlets()
          Tests whether a single servlet is correctly merged into a descriptor with multiple servlets.
 void testMergeOneServletIntoDocumentWithSameServlet()
          Tests whether a single servlet is correctly merged into a descriptor that already contains the definition of a servlet with the same name.
 void testMergeOneServletIntoDocumentWithSameServletAndParam()
          Tets whether a servlet with an initialization parameter is correctly merged into a descriptor that contains the definition of a servlet with the same name.
 void testMergeOneServletIntoEmptyDocument()
          Tests whether a single servlet is correctly merged into an empty descriptor.
 void testMergeOneServletWithMultipleMappingsIntoEmptyDocument()
          Tests whether a single servlet with multiple mappings is correctly inserted into an empty descriptor.
 void testMergeOneServletWithOneMappingIntoEmptyDocument()
          Tests whether a single servlet with one mapping is correctly inserted into an empty descriptor.
 void testMergeSecurityRoleIntoDocumentWithSameRole()
          Tests whether a single security role is ignored when the source descriptor already contains a role with the same name.
 void testMergeSecurityRoleIntoEmptyDocument()
          Tests whether a single security role is correctly inserted into an empty descriptor.
 void testMergingServletWithInitParamsThatIsAlreadyDefined()
          Verifies that servlet init parameters are added after the load-on-startup element of an already existing servlet definition.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

factory

private javax.xml.parsers.DocumentBuilderFactory factory
The document builder factory.


builder

private javax.xml.parsers.DocumentBuilder builder
The JAXP document builder.

Constructor Detail

TestWebXmlMerger

public TestWebXmlMerger()
Method Detail

setUp

public void setUp()
           throws javax.xml.parsers.ParserConfigurationException
Description copied from class: junit.framework.TestCase
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.


testMergeOneFilterIntoEmptyDocument

public void testMergeOneFilterIntoEmptyDocument()
                                         throws java.lang.Exception
Tests whether a single filter is correctly merged into an empty descriptor.


testMergeOneContextParamIntoEmptyDocument

public void testMergeOneContextParamIntoEmptyDocument()
                                               throws java.lang.Exception
Tests whether a single context param is correctly merged into an empty descriptor.


testMergeOneFilterIntoDocumentWithAnotherFilter

public void testMergeOneFilterIntoDocumentWithAnotherFilter()
                                                     throws java.lang.Exception
Tests whether a single filter is correctly merged into a descriptor that already contains another filter.


testMergeOneContextParamIntoDocumentWithAnotherContextParam

public void testMergeOneContextParamIntoDocumentWithAnotherContextParam()
                                                                 throws java.lang.Exception
Tests whether a single context param is correctly merged into a descriptor that already contains another context param.


testMergeOneFilterIntoDocumentWithSameFilter

public void testMergeOneFilterIntoDocumentWithSameFilter()
                                                  throws java.lang.Exception
Tests whether a single filter in the merge descriptor is ignored because a filter with the same name already exists in the source descriptor.


testMergeOneContextParamIntoDocumentWithSameContextParam

public void testMergeOneContextParamIntoDocumentWithSameContextParam()
                                                              throws java.lang.Exception
Tests whether a single context param in the merge descriptor is ignored because a context param with the same name already exists in the source descriptor.


testMergeOneFilterIntoDocumentWithSameFilterAndParam

public void testMergeOneFilterIntoDocumentWithSameFilterAndParam()
                                                          throws java.lang.Exception
Tests whether a filter initialization parameter is merged into the descriptor.


testMergeOneFilterIntoDocumentWithMultipleFilters

public void testMergeOneFilterIntoDocumentWithMultipleFilters()
                                                       throws java.lang.Exception
Tests whether a single filter is correctly merged into a descriptor that already contains multiple other filter definitions.


testMergeMultipleFiltersIntoEmptyDocument

public void testMergeMultipleFiltersIntoEmptyDocument()
                                               throws java.lang.Exception
Tests whether multiple filters are correctly merged into an empty descriptor.


testMergeOneFilterWithOneMappingIntoEmptyDocument

public void testMergeOneFilterWithOneMappingIntoEmptyDocument()
                                                       throws java.lang.Exception
Tests whether a filter with one mapping is correctly merged into an empty descriptor.


testMergeOneFilterWithMultipleMappingsIntoEmptyDocument

public void testMergeOneFilterWithMultipleMappingsIntoEmptyDocument()
                                                             throws java.lang.Exception
Tests wether a single filter with multiple mappings is correctly merged into an empty descriptor.


testMergeOneServletIntoEmptyDocument

public void testMergeOneServletIntoEmptyDocument()
                                          throws java.lang.Exception
Tests whether a single servlet is correctly merged into an empty descriptor.


testMergeOneServletIntoDocumentWithAnotherServlet

public void testMergeOneServletIntoDocumentWithAnotherServlet()
                                                       throws java.lang.Exception
Tests whether a single servlet is correctly merged into a descriptor that already contains the definition of an other servlet.


testMergeOneServletIntoDocumentWithSameServlet

public void testMergeOneServletIntoDocumentWithSameServlet()
                                                    throws java.lang.Exception
Tests whether a single servlet is correctly merged into a descriptor that already contains the definition of a servlet with the same name.


testMergeOneServletIntoDocumentWithSameServletAndParam

public void testMergeOneServletIntoDocumentWithSameServletAndParam()
                                                            throws java.lang.Exception
Tets whether a servlet with an initialization parameter is correctly merged into a descriptor that contains the definition of a servlet with the same name.


testMergeOneServletIntoDocumentWithMultipleServlets

public void testMergeOneServletIntoDocumentWithMultipleServlets()
                                                         throws java.lang.Exception
Tests whether a single servlet is correctly merged into a descriptor with multiple servlets.


testMergingServletWithInitParamsThatIsAlreadyDefined

public void testMergingServletWithInitParamsThatIsAlreadyDefined()
                                                          throws java.lang.Exception
Verifies that servlet init parameters are added after the load-on-startup element of an already existing servlet definition.


testMergeMultipleServletsIntoEmptyDocument

public void testMergeMultipleServletsIntoEmptyDocument()
                                                throws java.lang.Exception
Tests whether multiple servlet in the merge file are correctly inserted into an empty descriptor.


testMergeOneServletWithOneMappingIntoEmptyDocument

public void testMergeOneServletWithOneMappingIntoEmptyDocument()
                                                        throws java.lang.Exception
Tests whether a single servlet with one mapping is correctly inserted into an empty descriptor.


testMergeOneServletWithMultipleMappingsIntoEmptyDocument

public void testMergeOneServletWithMultipleMappingsIntoEmptyDocument()
                                                              throws java.lang.Exception
Tests whether a single servlet with multiple mappings is correctly inserted into an empty descriptor.


testMergeSecurityRoleIntoEmptyDocument

public void testMergeSecurityRoleIntoEmptyDocument()
                                            throws java.lang.Exception
Tests whether a single security role is correctly inserted into an empty descriptor.


testMergeSecurityRoleIntoDocumentWithSameRole

public void testMergeSecurityRoleIntoDocumentWithSameRole()
                                                   throws java.lang.Exception
Tests whether a single security role is ignored when the source descriptor already contains a role with the same name.


testMergeOneEjbRefIntoEmptyDocument

public void testMergeOneEjbRefIntoEmptyDocument()
                                         throws java.lang.Exception
Tests whether a single EJB reference is correctly inserted into an empty descriptor.