org.springframework.richclient.test
Class SpringRichTestCase

Show UML class diagram
java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.springframework.richclient.test.SpringRichTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractFormBuilderTestCase, AbstractFormModelTests, AbstractFormTests, AbstractPropertyAccessStrategyTests, AbstractValueModelTests, AnnotationAwareBeanPropertyAccessStrategyTests, ApplicationDialogTestCase, AsYouTypeTextComponentAdapterTests, BindingAbstractTests, BufferedCollectionValueModelTests, BufferedValueModelTests, ButtonTests, DefaultApplicationPageFactoryTests, DefaultApplicationServicesTests, DefaultApplicationWindowTests, DefaultFieldMetadataTests, DirtyIndicatorInterceptorTests, FocusLostTextComponentAdapterTests, FormattedTextFieldAdapterTests, FormGuardTests, FormModelMediatingValueModelTests, InputApplicationDialogTests, MessageSourceFieldFaceSourceTests, MultiFacedEnablingTests, OverlayHelperTests, ProtectedFieldTests, SwingBindingFactoryTests, TypeConverterTests, ValidationResultsTests

public abstract class SpringRichTestCase
extends junit.framework.TestCase

Convenient base implementation for Spring Rich test cases; automatically configures the application services singleton and provides hooks for common test case setup requirements.

Author:
Oliver Hutchison

Field Summary
protected  org.springframework.richclient.application.support.DefaultApplicationServices applicationServices
           
protected  org.apache.commons.logging.Log logger
          Logger available to subclasses.
 
Constructor Summary
SpringRichTestCase()
           
 
Method Summary
protected  ConfigurableApplicationContext createApplicationContext()
          returns the application context to use for testing overwrite to specify a different application context
protected  org.springframework.richclient.application.config.ApplicationLifecycleAdvisor createApplicationLifecycleAdvisor()
          Subclasses may override this to return a custom ApplicationLifecycleAdvisor.
protected  void doSetUp()
          Should be implemented in subclasses as an alternative to the final method setUp()
protected  void doTearDown()
          Should be implemented in subclasses as an alternative to the final method tearDown()
protected  org.springframework.richclient.application.support.DefaultApplicationServices getApplicationServices()
          Get the application services instance.
protected  void registerAdditionalServices(org.springframework.richclient.application.support.DefaultApplicationServices applicationServices)
          May be implemented in subclasses that need to register services with the global application services instance.
protected  void registerBasicServices(org.springframework.richclient.application.support.DefaultApplicationServices applicationServices)
          Register the application services needed for our tests.
protected  void setUp()
           
protected  void tearDown()
          Tear down method invoked by JUnit framework.
 
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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Logger available to subclasses.


applicationServices

protected org.springframework.richclient.application.support.DefaultApplicationServices applicationServices
Constructor Detail

SpringRichTestCase

public SpringRichTestCase()
Method Detail

setUp

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

createApplicationContext

protected ConfigurableApplicationContext createApplicationContext()
returns the application context to use for testing overwrite to specify a different application context

Returns:
this implementation returns an instance of StaticApplicationContext

createApplicationLifecycleAdvisor

protected org.springframework.richclient.application.config.ApplicationLifecycleAdvisor createApplicationLifecycleAdvisor()
Subclasses may override this to return a custom ApplicationLifecycleAdvisor.


registerBasicServices

protected void registerBasicServices(org.springframework.richclient.application.support.DefaultApplicationServices applicationServices)
Register the application services needed for our tests.


registerAdditionalServices

protected void registerAdditionalServices(org.springframework.richclient.application.support.DefaultApplicationServices applicationServices)
May be implemented in subclasses that need to register services with the global application services instance.


getApplicationServices

protected org.springframework.richclient.application.support.DefaultApplicationServices getApplicationServices()
Get the application services instance.


tearDown

protected final void tearDown()
                       throws Exception
Tear down method invoked by JUnit framework. Derived classes should put their work in doTearDown().

Overrides:
tearDown in class junit.framework.TestCase
Throws:
Exception

doSetUp

protected void doSetUp()
                throws Exception
Should be implemented in subclasses as an alternative to the final method setUp()

Throws:
Exception

doTearDown

protected void doTearDown()
                   throws Exception
Should be implemented in subclasses as an alternative to the final method tearDown()

Throws:
Exception


Copyright © 2004-2009 The Spring Framework. All Rights Reserved.