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

Quick Search    Search Deep

servletunit.tests
Class TestServletContext  view TestServletContext download TestServletContext.java

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byservletunit.tests.TestServletContext
All Implemented Interfaces:
junit.framework.Test

public class TestServletContext
extends junit.framework.TestCase


Field Summary
(package private)  servletunit.ServletContextSimulator context
           
(package private)  java.lang.String contextDirectory
           
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
TestServletContext(java.lang.String testName)
           
 
Method Summary
 void setUp()
          Sets up the fixture, for example, open a network connection.
 void testGetAttributeNames()
           
 void testGetRealPath()
           
 void testGetRealPathNotSet()
           
 void testGetResourceAsFileFromFileSystem()
          verifies that web.xml can be loaded using the filesystem.
 void testGetResourceAsFileFromFileSystemWithRelativePath()
          verifies that web.xml can be loaded using the filesystem.
 void testGetResourceAsStreamFromClasspath()
          verifies that web.xml can be loaded using the classpath
 void testGetResourceAsStreamFromClasspathWithPathCorrection()
          confirms that calls to getResource will adjust to a path missing the leading "/"
 void testGetResourceAsStreamFromFileSystem()
          verifies that web.xml can be loaded using the filesystem.
 void testGetResourceAsStreamFromFileSystemWithPathCorrection()
          confirms that calls to getResource will adjust to a path missing the leading "/"
 void testGetResourceFromClasspath()
          verified that web.xml can be loaded as a URL using the classpath
 void testGetResourceFromClasspathWithPathCorrection()
          confirms that calls to getResource will adjust to a path missing the leading "/"
 void testGetResourceFromFileSystem()
          verified that web.xml can be loaded as a URL using the classpath
 void testGetResourceFromFileSystemWithPathCorrection()
          confirms that calls to getResource will adjust to a path missing the leading "/"
 void testNoAttribute()
           
 void testSetAttribute()
           
 
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

contextDirectory

java.lang.String contextDirectory

context

servletunit.ServletContextSimulator context
Constructor Detail

TestServletContext

public TestServletContext(java.lang.String testName)
Method Detail

setUp

public void setUp()
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.


testSetAttribute

public void testSetAttribute()

testNoAttribute

public void testNoAttribute()

testGetAttributeNames

public void testGetAttributeNames()

testGetRealPath

public void testGetRealPath()

testGetRealPathNotSet

public void testGetRealPathNotSet()

testGetResourceAsStreamFromClasspath

public void testGetResourceAsStreamFromClasspath()
verifies that web.xml can be loaded using the classpath


testGetResourceFromClasspath

public void testGetResourceFromClasspath()
                                  throws java.lang.Exception
verified that web.xml can be loaded as a URL using the classpath


testGetResourceAsStreamFromFileSystem

public void testGetResourceAsStreamFromFileSystem()
verifies that web.xml can be loaded using the filesystem. Assumes test is being run from the strutstestcase project root directory and that WEB-INF is in src/examples


testGetResourceFromFileSystem

public void testGetResourceFromFileSystem()
                                   throws java.lang.Exception
verified that web.xml can be loaded as a URL using the classpath


testGetResourceFromFileSystemWithPathCorrection

public void testGetResourceFromFileSystemWithPathCorrection()
                                                     throws java.lang.Exception
confirms that calls to getResource will adjust to a path missing the leading "/"


testGetResourceFromClasspathWithPathCorrection

public void testGetResourceFromClasspathWithPathCorrection()
                                                    throws java.lang.Exception
confirms that calls to getResource will adjust to a path missing the leading "/"


testGetResourceAsStreamFromFileSystemWithPathCorrection

public void testGetResourceAsStreamFromFileSystemWithPathCorrection()
                                                             throws java.lang.Exception
confirms that calls to getResource will adjust to a path missing the leading "/"


testGetResourceAsStreamFromClasspathWithPathCorrection

public void testGetResourceAsStreamFromClasspathWithPathCorrection()
                                                            throws java.lang.Exception
confirms that calls to getResource will adjust to a path missing the leading "/"


testGetResourceAsFileFromFileSystem

public void testGetResourceAsFileFromFileSystem()
verifies that web.xml can be loaded using the filesystem. Assumes test is being run from the strutstestcase project root directory and that WEB-INF is in src/examples this is necessary because the other tests could be "fooled" by a file that was actually loaded by the classloader.


testGetResourceAsFileFromFileSystemWithRelativePath

public void testGetResourceAsFileFromFileSystemWithRelativePath()
verifies that web.xml can be loaded using the filesystem. Assumes test is being run from the strutstestcase project root directory and that WEB-INF is in src/examples this is necessary because the other tests could be "fooled" by a file that was actually loaded by the classloader.