org.kuali.student.core.test
Class BaseCase

java.lang.Object
  extended by org.junit.Assert
      extended by org.kuali.student.core.test.BaseCase
Direct Known Subclasses:
MessageTest

public class BaseCase
extends org.junit.Assert

A base test class which adds the following capabilities to the test harness:

    1. Automatically starts an embedded Jetty server which loads the application.
      Starts a transaction before the test begins and rolls the transaction back after the test completes so that nothing is written to the database.
  • Author:
    Eric Westfall

    Field Summary
    private static String CONTEXT_NAME
               
    private static int DEFAULT_PORT
               
    private static JettyServer server
               
    private  TransactionalLifecycle transactionalLifecycle
               
    private static String WEBAPP_ROOT
               
     
    Constructor Summary
    BaseCase()
               
     
    Method Summary
    static void addWebappsToContext()
              Adds all ResourceLoaders registered to WebAppClassLoaders to the GlobalResourceLoader.
     void setUp()
               
    static void startJettyServer()
               
    static void stopJettyServer()
               
     void tearDown()
               
     
    Methods inherited from class org.junit.Assert
    assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    DEFAULT_PORT

    private static final int DEFAULT_PORT
    See Also:
    Constant Field Values

    CONTEXT_NAME

    private static final String CONTEXT_NAME
    See Also:
    Constant Field Values

    WEBAPP_ROOT

    private static final String WEBAPP_ROOT
    See Also:
    Constant Field Values

    server

    private static JettyServer server

    transactionalLifecycle

    private TransactionalLifecycle transactionalLifecycle
    Constructor Detail

    BaseCase

    public BaseCase()
    Method Detail

    setUp

    public void setUp()
               throws Exception
    Throws:
    Exception

    tearDown

    public void tearDown()
                  throws Exception
    Throws:
    Exception

    startJettyServer

    public static void startJettyServer()
                                 throws Exception
    Throws:
    Exception

    addWebappsToContext

    public static void addWebappsToContext()
    Adds all ResourceLoaders registered to WebAppClassLoaders to the GlobalResourceLoader. Overrides the current context config with the Config registered to the (last) WebAppClassLoader


    stopJettyServer

    public static void stopJettyServer()
                                throws Exception
    Throws:
    Exception


    Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.