org.jvnet.hudson.test
Class HudsonTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.jvnet.hudson.test.HudsonTestCase
All Implemented Interfaces:
junit.framework.Test

public abstract class HudsonTestCase
extends junit.framework.TestCase

Base class for all Hudson test cases.

Author:
Kohsuke Kawaguchi

Nested Class Summary
 class HudsonTestCase.WebClient
          Extends WebClient and provide convenience methods for accessing Hudson.
 
Field Summary
protected  java.lang.String contextPath
          Where in the Server is Hudson deploed?
protected  TestEnvironment env
           
protected  HudsonHomeLoader homeLoader
           
protected  Hudson hudson
           
protected  int localPort
          TCP/IP port that the server is listening on.
protected  org.mortbay.jetty.Server server
           
 
Constructor Summary
protected HudsonTestCase(java.lang.String name)
           
 
Method Summary
protected  FreeStyleProject createFreeStyleProject()
           
protected  FreeStyleProject createFreeStyleProject(java.lang.String name)
           
protected  javax.servlet.ServletContext createWebServer()
          Prepares a webapp hosting environment to get ServletContext implementation that we need for testing.
protected  Hudson newHudson()
           
protected  void recipe()
          Called during the setUp() to give a test case an opportunity to control the test environment in which Hudson is run.
protected  void setUp()
           
protected  void tearDown()
           
protected  HudsonTestCase withExistingHome(java.io.File source)
           
protected  HudsonTestCase withNewHome()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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

hudson

protected Hudson hudson

env

protected final TestEnvironment env

homeLoader

protected HudsonHomeLoader homeLoader

localPort

protected int localPort
TCP/IP port that the server is listening on.


server

protected org.mortbay.jetty.Server server

contextPath

protected java.lang.String contextPath
Where in the Server is Hudson deploed?

Constructor Detail

HudsonTestCase

protected HudsonTestCase(java.lang.String name)
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception

newHudson

protected Hudson newHudson()
                    throws java.lang.Exception
Throws:
java.lang.Exception

createWebServer

protected javax.servlet.ServletContext createWebServer()
                                                throws java.lang.Exception
Prepares a webapp hosting environment to get ServletContext implementation that we need for testing.

Throws:
java.lang.Exception

createFreeStyleProject

protected FreeStyleProject createFreeStyleProject()
                                           throws java.io.IOException
Throws:
java.io.IOException

createFreeStyleProject

protected FreeStyleProject createFreeStyleProject(java.lang.String name)
                                           throws java.io.IOException
Throws:
java.io.IOException

recipe

protected void recipe()
Called during the setUp() to give a test case an opportunity to control the test environment in which Hudson is run.

From here, call a series of withXXX methods.


withNewHome

protected HudsonTestCase withNewHome()

withExistingHome

protected HudsonTestCase withExistingHome(java.io.File source)


Copyright © 2008. All Rights Reserved.