ch.elca.el4j.tests.core.aop
Class ExclusiveBeanNameAutoProxyCreatorTest

java.lang.Object
  extended by ch.elca.el4j.tests.core.aop.ExclusiveBeanNameAutoProxyCreatorTest

public class ExclusiveBeanNameAutoProxyCreatorTest
extends Object

This class tests the ExclusiveBeanNameAutoProxyCreator.

Author:
Andreas Bur (ABU)
File-location:
ExclusiveBeanNameAutoProxyCreatorTest
Last check-in date:
2009-08-04 14:35:53 +0200 (Di, 04. Aug 2009) by swismer for revision 3875

Field Summary
private static String BAR
          Bean bar.
private static String BEAN_A
          Bean A.
private static String BEAN_B
          Bean B.
private static String[] BEAN_NAMES
          Registered beans.
private static String EMPTY_EXCLUSIVE_CONFIG
          Configuration without any beans to exclude.
private static String EXCLUDE_ALL_CONFIG
          Configuration that exclude all beans.
private static String FOO
          Bean foo.
private static String FOOBAR
          Bean foobar.
private static String INCLUDE_ALL_BUT_BAR_SUFFIX_CONFIG
          Configuration that includes all beans but those ending with 'bar'.
private static String INCLUDE_ALL_BUT_FOO_PREFIX_CONFIG
          Configuration that includes all beans but those beginning with 'foo'.
private static String INCLUDE_ALL_BUT_FOOBAR_CONFIG
          Configuration that excludes only bean 'foobar'.
private static String INCLUDE_ALL_STARTING_WITH_BEAN_BUT_SUFFIX_A_CONFIG
          Configuration that includes all beans starting with 'bean' but those ending with 'a'.
static String PROXIED
          String returned by proxied beans.
 
Constructor Summary
ExclusiveBeanNameAutoProxyCreatorTest()
           
 
Method Summary
protected  void assertAdvised(ApplicationContext appCtx, String beanName)
          Asserts that the bean with the given name is advised in the given application context.
protected  void assertNotAdvised(ApplicationContext appCtx, String beanName)
          Asserts that the bean with the given name is not advised in the given application context.
private  ApplicationContext createAppContext(String config)
          Crates a new application context for the given configuration file.
 void testExcludeAll()
          Tehsts the configuration that excludes all beans.
 void testIncludeAllButBarSuffix()
          Tests the configuration that includes all beans but those ending with 'bar'.
 void testIncludeAllButFoobar()
          Tests the configuration that includes all beans but the one named 'foobar'.
 void testIncludeAllButFooPrefix()
          Tests the configuration that includes all beans but those starting with 'foo'.
 void testIncludeAllStartingWithBeanButSuffixA()
          Tests the configuration that includes all beans which start with 'bean' but don't end with 'a'.
 void testIncludesOnly()
          Tests the configuration that doesn't exclude any beans.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROXIED

public static final String PROXIED
String returned by proxied beans.

See Also:
Constant Field Values

BEAN_A

private static final String BEAN_A
Bean A.

See Also:
Constant Field Values

BEAN_B

private static final String BEAN_B
Bean B.

See Also:
Constant Field Values

FOO

private static final String FOO
Bean foo.

See Also:
Constant Field Values

BAR

private static final String BAR
Bean bar.

See Also:
Constant Field Values

FOOBAR

private static final String FOOBAR
Bean foobar.

See Also:
Constant Field Values

BEAN_NAMES

private static final String[] BEAN_NAMES
Registered beans.


EMPTY_EXCLUSIVE_CONFIG

private static final String EMPTY_EXCLUSIVE_CONFIG
Configuration without any beans to exclude.

See Also:
Constant Field Values

EXCLUDE_ALL_CONFIG

private static final String EXCLUDE_ALL_CONFIG
Configuration that exclude all beans.

See Also:
Constant Field Values

INCLUDE_ALL_BUT_FOOBAR_CONFIG

private static final String INCLUDE_ALL_BUT_FOOBAR_CONFIG
Configuration that excludes only bean 'foobar'.

See Also:
Constant Field Values

INCLUDE_ALL_BUT_FOO_PREFIX_CONFIG

private static final String INCLUDE_ALL_BUT_FOO_PREFIX_CONFIG
Configuration that includes all beans but those beginning with 'foo'.

See Also:
Constant Field Values

INCLUDE_ALL_BUT_BAR_SUFFIX_CONFIG

private static final String INCLUDE_ALL_BUT_BAR_SUFFIX_CONFIG
Configuration that includes all beans but those ending with 'bar'.

See Also:
Constant Field Values

INCLUDE_ALL_STARTING_WITH_BEAN_BUT_SUFFIX_A_CONFIG

private static final String INCLUDE_ALL_STARTING_WITH_BEAN_BUT_SUFFIX_A_CONFIG
Configuration that includes all beans starting with 'bean' but those ending with 'a'.

See Also:
Constant Field Values
Constructor Detail

ExclusiveBeanNameAutoProxyCreatorTest

public ExclusiveBeanNameAutoProxyCreatorTest()
Method Detail

testIncludesOnly

public void testIncludesOnly()
Tests the configuration that doesn't exclude any beans.


testExcludeAll

public void testExcludeAll()
Tehsts the configuration that excludes all beans.


testIncludeAllButFoobar

public void testIncludeAllButFoobar()
Tests the configuration that includes all beans but the one named 'foobar'.


testIncludeAllButFooPrefix

public void testIncludeAllButFooPrefix()
Tests the configuration that includes all beans but those starting with 'foo'.


testIncludeAllButBarSuffix

public void testIncludeAllButBarSuffix()
Tests the configuration that includes all beans but those ending with 'bar'.


testIncludeAllStartingWithBeanButSuffixA

public void testIncludeAllStartingWithBeanButSuffixA()
Tests the configuration that includes all beans which start with 'bean' but don't end with 'a'.


assertAdvised

protected void assertAdvised(ApplicationContext appCtx,
                             String beanName)
Asserts that the bean with the given name is advised in the given application context.

Parameters:
appCtx - The application context.
beanName - The name of the bean which is asserted to be advised.

assertNotAdvised

protected void assertNotAdvised(ApplicationContext appCtx,
                                String beanName)
Asserts that the bean with the given name is not advised in the given application context.

Parameters:
appCtx - The application context.
beanName - The name of the bean which is asserted not to be advised.

createAppContext

private ApplicationContext createAppContext(String config)
Crates a new application context for the given configuration file.

Parameters:
config - The configuration file's location.
Returns:
Returns a newly created application context.


Copyright © 2005-2011 ELCA. All Rights Reserved.