Java Code Examples for org.springframework.aop.config.AopNamespaceUtils#registerAspectJAutoProxyCreatorIfNecessary()

The following examples show how to use org.springframework.aop.config.AopNamespaceUtils#registerAspectJAutoProxyCreatorIfNecessary() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AspectJNamespaceHandlerTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void testRegisterAutoProxyCreator() throws Exception {
	AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect number of definitions registered", 1, registry.getBeanDefinitionCount());

	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect number of definitions registered", 1, registry.getBeanDefinitionCount());
}
 
Example 2
Source File: AspectJNamespaceHandlerTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void testRegisterAspectJAutoProxyCreator() throws Exception {
	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect number of definitions registered", 1, registry.getBeanDefinitionCount());

	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect number of definitions registered", 1, registry.getBeanDefinitionCount());

	BeanDefinition definition = registry.getBeanDefinition(AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME);
	assertEquals("Incorrect APC class",
			AspectJAwareAdvisorAutoProxyCreator.class.getName(), definition.getBeanClassName());
}
 
Example 3
Source File: AspectJNamespaceHandlerTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void testRegisterAspectJAutoProxyCreatorWithExistingAutoProxyCreator() throws Exception {
	AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals(1, registry.getBeanDefinitionCount());

	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect definition count", 1, registry.getBeanDefinitionCount());

	BeanDefinition definition = registry.getBeanDefinition(AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME);
	assertEquals("APC class not switched",
			AspectJAwareAdvisorAutoProxyCreator.class.getName(), definition.getBeanClassName());
}
 
Example 4
Source File: AspectJNamespaceHandlerTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void testRegisterAutoProxyCreatorWhenAspectJAutoProxyCreatorAlreadyExists() throws Exception {
	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals(1, registry.getBeanDefinitionCount());

	AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect definition count", 1, registry.getBeanDefinitionCount());

	BeanDefinition definition = registry.getBeanDefinition(AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME);
	assertEquals("Incorrect APC class",
			AspectJAwareAdvisorAutoProxyCreator.class.getName(), definition.getBeanClassName());
}
 
Example 5
Source File: AspectJNamespaceHandlerTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testRegisterAutoProxyCreator() throws Exception {
	AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect number of definitions registered", 1, registry.getBeanDefinitionCount());

	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect number of definitions registered", 1, registry.getBeanDefinitionCount());
}
 
Example 6
Source File: AspectJNamespaceHandlerTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testRegisterAspectJAutoProxyCreator() throws Exception {
	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect number of definitions registered", 1, registry.getBeanDefinitionCount());

	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect number of definitions registered", 1, registry.getBeanDefinitionCount());

	BeanDefinition definition = registry.getBeanDefinition(AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME);
	assertEquals("Incorrect APC class",
			AspectJAwareAdvisorAutoProxyCreator.class.getName(), definition.getBeanClassName());
}
 
Example 7
Source File: AspectJNamespaceHandlerTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testRegisterAspectJAutoProxyCreatorWithExistingAutoProxyCreator() throws Exception {
	AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals(1, registry.getBeanDefinitionCount());

	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect definition count", 1, registry.getBeanDefinitionCount());

	BeanDefinition definition = registry.getBeanDefinition(AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME);
	assertEquals("APC class not switched",
			AspectJAwareAdvisorAutoProxyCreator.class.getName(), definition.getBeanClassName());
}
 
Example 8
Source File: AspectJNamespaceHandlerTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testRegisterAutoProxyCreatorWhenAspectJAutoProxyCreatorAlreadyExists() throws Exception {
	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals(1, registry.getBeanDefinitionCount());

	AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect definition count", 1, registry.getBeanDefinitionCount());

	BeanDefinition definition = registry.getBeanDefinition(AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME);
	assertEquals("Incorrect APC class",
			AspectJAwareAdvisorAutoProxyCreator.class.getName(), definition.getBeanClassName());
}
 
Example 9
Source File: AspectJNamespaceHandlerTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void testRegisterAutoProxyCreator() throws Exception {
	AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect number of definitions registered", 1, registry.getBeanDefinitionCount());

	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect number of definitions registered", 1, registry.getBeanDefinitionCount());
}
 
Example 10
Source File: AspectJNamespaceHandlerTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void testRegisterAspectJAutoProxyCreator() throws Exception {
	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect number of definitions registered", 1, registry.getBeanDefinitionCount());

	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect number of definitions registered", 1, registry.getBeanDefinitionCount());

	BeanDefinition definition = registry.getBeanDefinition(AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME);
	assertEquals("Incorrect APC class",
			AspectJAwareAdvisorAutoProxyCreator.class.getName(), definition.getBeanClassName());
}
 
Example 11
Source File: AspectJNamespaceHandlerTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void testRegisterAspectJAutoProxyCreatorWithExistingAutoProxyCreator() throws Exception {
	AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals(1, registry.getBeanDefinitionCount());

	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect definition count", 1, registry.getBeanDefinitionCount());

	BeanDefinition definition = registry.getBeanDefinition(AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME);
	assertEquals("APC class not switched",
			AspectJAwareAdvisorAutoProxyCreator.class.getName(), definition.getBeanClassName());
}
 
Example 12
Source File: AspectJNamespaceHandlerTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void testRegisterAutoProxyCreatorWhenAspectJAutoProxyCreatorAlreadyExists() throws Exception {
	AopNamespaceUtils.registerAspectJAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals(1, registry.getBeanDefinitionCount());

	AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(this.parserContext, null);
	assertEquals("Incorrect definition count", 1, registry.getBeanDefinitionCount());

	BeanDefinition definition = registry.getBeanDefinition(AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME);
	assertEquals("Incorrect APC class",
			AspectJAwareAdvisorAutoProxyCreator.class.getName(), definition.getBeanClassName());
}