org.springframework.extensions.webscripts
Class WebScriptFormatReaderTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.springframework.extensions.webscripts.WebScriptFormatReaderTest
All Implemented Interfaces:
junit.framework.Test

public class WebScriptFormatReaderTest
extends junit.framework.TestCase

Unit test to test Web Script API

Author:
David Ward

Constructor Summary
WebScriptFormatReaderTest()
           
 
Method Summary
 void testAtomEntry()
          Ensure that for a .atom.js script and an application/atom+xml;type=entry request (for which a less generalized atomentry format is registered) the entry variable is available as "entry".
 void testBogus()
          Ensure that for a .bogus.js script and an application/bogus request, an error is returned because the bogus format is registered, but no FormatReader is registered.
 void testJson()
          Ensure that for a .json.js script and an application/json request, the json string is available as "json".
 void testRequestBody()
          Ensure that, for a non request type specific .js script, the request body is available as requestbody.
 void testXWwwFormUrlEncoded()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebScriptFormatReaderTest

public WebScriptFormatReaderTest()
Method Detail

testRequestBody

public void testRequestBody()
                     throws Exception
Ensure that, for a non request type specific .js script, the request body is available as requestbody.

Throws:
Exception

testJson

public void testJson()
              throws Exception
Ensure that for a .json.js script and an application/json request, the json string is available as "json".

Throws:
Exception

testXWwwFormUrlEncoded

public void testXWwwFormUrlEncoded()
                            throws Exception
Throws:
Exception

testAtomEntry

public void testAtomEntry()
                   throws Exception
Ensure that for a .atom.js script and an application/atom+xml;type=entry request (for which a less generalized atomentry format is registered) the entry variable is available as "entry".

Throws:
Exception

testBogus

public void testBogus()
               throws Exception
Ensure that for a .bogus.js script and an application/bogus request, an error is returned because the bogus format is registered, but no FormatReader is registered.

Throws:
Exception


Copyright © 2009 SpringSource, Inc. All Rights Reserved.