ch.elca.el4j.tests.core.context
Class ModuleApplicationContextTest

java.lang.Object
  extended by ch.elca.el4j.tests.core.context.ModuleApplicationContextTest

public class ModuleApplicationContextTest
extends Object

JUnit Test Class for the ModuleApplicationContext.

Author:
Raphael Boog (RBO)
File-location:
ModuleApplicationContextTest
Last check-in date:
2009-08-04 15:22:05 +0200 (Di, 04. Aug 2009) by swismer for revision 3881

Field Summary
(package private)  String m_allFileNamesInBothClasspaths
          Test configuration.
(package private)  String m_allFileNamesInClasspath
          Test configuration.
(package private)  String m_fileName1
          Test configuration.
(package private)  String m_fileName2
          Test configuration.
(package private)  String m_fileName3
          Test configuration.
(package private)  String m_mandatoryFiles
          Mandatory configurations.
private static org.slf4j.Logger s_logger
          The static logger.
 
Constructor Summary
ModuleApplicationContextTest()
           
 
Method Summary
 void testAllInBothClasspathsMinusAllInFilepath1()
          This test takes all configuration files in both classpaths via '*\*.xml' ant-style pattern, all configuration files via '*.xml' ant-style pattern in one of the filepaths as exclusive configuration files, loads them into one ApplicationContext and checks if the correct bean was loaded.
 void testAllInClasspathFileNamesMinusAllInClasspathFileNames()
          This test takes all configuration files in the classpath via '*.xml' ant-style pattern, all configuration files via '*.xml' ant-style pattern in the classpath as exclusive configuration files, loads them into one ApplicationContext and checks if no bean was loaded.
 void testAllInClasspathFileNamesMinusTwoExclusiveFileNames()
          This test takes all configuration files in the classpath via '*.xml' ant-style pattern, two exclusive configuration files in this classpath, loads them into one ApplicationContext and checks if the correct bean was loaded and the three other beans were not loaded.
 void testBeanDefinitionOverridingIsFalse()
          This test takes twice the same configuration file, sets allowBeanOverridingDefinition to false and checks if a BeanDefinitionStoreException is thrown.
 void testInclusiveFileNameNull()
          This test takes a null String as inclusive configuration file and checks if a NullPointerException is thrown.
 void testMandatoryWarning()
          This test has to be verified by the user.
 void testOneExistingInclusiveFileNamePlusOneNonExistingFileName()
          This test takes an existing file and a non existing file, tries to load them into one ApplicationContext and checks if the correct bean was loaded and no exception was thrown.
 void testOneInclusiveFileName()
          This test takes one inclusive configuration file with one bean defined, loads it into one ApplicationContext with one bean and checks if the bean was loaded.
 void testOneInclusiveFileNameExclusiveFileNamesIsEmpty()
          This test takes one inclusive configuration file, an empty String as exclusive configuration file, loads them into one ApplicationContext and checks if the defined bean was loaded.
 void testOneInclusiveFileNameExclusiveFileNamesIsNull()
          This test takes one inclusive configuration file, a null String as exclusive configuration file and checks if a NullPointerException is thrown.
 void testOneInclusiveFileNamesAnotherExclusiveFileName()
          This test takes an inclusive configuration files with one bean defined, another exclusive configuration file, loads them into one ApplicationContext and checks if the bean was loaded and no exception is thrown since the exclusive configuration file defines a bean which is not in an inclusive configuration file.
 void testTwoInclusiveFileNames()
          This test takes two inclusive configuration files with one bean defined each, loads them into one ApplicationContext and checks if the two beans were loaded.
 void testTwoInclusiveFileNamesOneExclusiveFileName()
          This test takes two inclusive configuration files, one of them as exclusive configuration file, loads them into one ApplicationContext and checks if one bean was loaded and the other not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_logger

private static org.slf4j.Logger s_logger
The static logger.


m_fileName1

String m_fileName1
Test configuration.


m_fileName2

String m_fileName2
Test configuration.


m_fileName3

String m_fileName3
Test configuration.


m_allFileNamesInClasspath

String m_allFileNamesInClasspath
Test configuration.


m_allFileNamesInBothClasspaths

String m_allFileNamesInBothClasspaths
Test configuration.


m_mandatoryFiles

String m_mandatoryFiles
Mandatory configurations.

Constructor Detail

ModuleApplicationContextTest

public ModuleApplicationContextTest()
Method Detail

testInclusiveFileNameNull

public void testInclusiveFileNameNull()
This test takes a null String as inclusive configuration file and checks if a NullPointerException is thrown.


testOneInclusiveFileName

public void testOneInclusiveFileName()
This test takes one inclusive configuration file with one bean defined, loads it into one ApplicationContext with one bean and checks if the bean was loaded.


testTwoInclusiveFileNames

public void testTwoInclusiveFileNames()
This test takes two inclusive configuration files with one bean defined each, loads them into one ApplicationContext and checks if the two beans were loaded.


testOneInclusiveFileNameExclusiveFileNamesIsNull

public void testOneInclusiveFileNameExclusiveFileNamesIsNull()
This test takes one inclusive configuration file, a null String as exclusive configuration file and checks if a NullPointerException is thrown.


testOneInclusiveFileNameExclusiveFileNamesIsEmpty

public void testOneInclusiveFileNameExclusiveFileNamesIsEmpty()
This test takes one inclusive configuration file, an empty String as exclusive configuration file, loads them into one ApplicationContext and checks if the defined bean was loaded.


testOneInclusiveFileNamesAnotherExclusiveFileName

public void testOneInclusiveFileNamesAnotherExclusiveFileName()
This test takes an inclusive configuration files with one bean defined, another exclusive configuration file, loads them into one ApplicationContext and checks if the bean was loaded and no exception is thrown since the exclusive configuration file defines a bean which is not in an inclusive configuration file.


testTwoInclusiveFileNamesOneExclusiveFileName

public void testTwoInclusiveFileNamesOneExclusiveFileName()
This test takes two inclusive configuration files, one of them as exclusive configuration file, loads them into one ApplicationContext and checks if one bean was loaded and the other not.


testAllInClasspathFileNamesMinusTwoExclusiveFileNames

public void testAllInClasspathFileNamesMinusTwoExclusiveFileNames()
This test takes all configuration files in the classpath via '*.xml' ant-style pattern, two exclusive configuration files in this classpath, loads them into one ApplicationContext and checks if the correct bean was loaded and the three other beans were not loaded.


testAllInClasspathFileNamesMinusAllInClasspathFileNames

public void testAllInClasspathFileNamesMinusAllInClasspathFileNames()
This test takes all configuration files in the classpath via '*.xml' ant-style pattern, all configuration files via '*.xml' ant-style pattern in the classpath as exclusive configuration files, loads them into one ApplicationContext and checks if no bean was loaded.


testAllInBothClasspathsMinusAllInFilepath1

public void testAllInBothClasspathsMinusAllInFilepath1()
This test takes all configuration files in both classpaths via '*\*.xml' ant-style pattern, all configuration files via '*.xml' ant-style pattern in one of the filepaths as exclusive configuration files, loads them into one ApplicationContext and checks if the correct bean was loaded.


testOneExistingInclusiveFileNamePlusOneNonExistingFileName

public void testOneExistingInclusiveFileNamePlusOneNonExistingFileName()
This test takes an existing file and a non existing file, tries to load them into one ApplicationContext and checks if the correct bean was loaded and no exception was thrown. However, a logger warning should have been displayed.


testBeanDefinitionOverridingIsFalse

public void testBeanDefinitionOverridingIsFalse()
This test takes twice the same configuration file, sets allowBeanOverridingDefinition to false and checks if a BeanDefinitionStoreException is thrown.


testMandatoryWarning

public void testMandatoryWarning()
This test has to be verified by the user. Between the two warn logger outputs, no other warn logger should appear. Especially not the one saying that 'classpath*:mandatory/*.xml' was not loaded.



Copyright © 2005-2011 ELCA. All Rights Reserved.