org.springframework.aop.aspectj.AfterReturningAdviceBindingTestAspect.AfterReturningAdviceBindingCollaborator Java Examples

The following examples show how to use org.springframework.aop.aspectj.AfterReturningAdviceBindingTestAspect.AfterReturningAdviceBindingCollaborator. 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: AfterReturningAdviceBindingTests.java    From spring-analysis-note with MIT License 6 votes vote down vote up
@Before
public void setup() throws Exception {
	ClassPathXmlApplicationContext ctx =
			new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

	afterAdviceAspect = (AfterReturningAdviceBindingTestAspect) ctx.getBean("testAspect");

	mockCollaborator = mock(AfterReturningAdviceBindingCollaborator.class);
	afterAdviceAspect.setCollaborator(mockCollaborator);

	testBeanProxy = (ITestBean) ctx.getBean("testBean");
	assertTrue(AopUtils.isAopProxy(testBeanProxy));

	// we need the real target too, not just the proxy...
	this.testBeanTarget = (TestBean) ((Advised)testBeanProxy).getTargetSource().getTarget();
}
 
Example #2
Source File: AfterReturningAdviceBindingTests.java    From java-technology-stack with MIT License 6 votes vote down vote up
@Before
public void setup() throws Exception {
	ClassPathXmlApplicationContext ctx =
			new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

	afterAdviceAspect = (AfterReturningAdviceBindingTestAspect) ctx.getBean("testAspect");

	mockCollaborator = mock(AfterReturningAdviceBindingCollaborator.class);
	afterAdviceAspect.setCollaborator(mockCollaborator);

	testBeanProxy = (ITestBean) ctx.getBean("testBean");
	assertTrue(AopUtils.isAopProxy(testBeanProxy));

	// we need the real target too, not just the proxy...
	this.testBeanTarget = (TestBean) ((Advised)testBeanProxy).getTargetSource().getTarget();
}
 
Example #3
Source File: AfterReturningAdviceBindingTests.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
	ClassPathXmlApplicationContext ctx =
		new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());

	afterAdviceAspect = (AfterReturningAdviceBindingTestAspect) ctx.getBean("testAspect");

	mockCollaborator = mock(AfterReturningAdviceBindingCollaborator.class);
	afterAdviceAspect.setCollaborator(mockCollaborator);

	testBeanProxy = (ITestBean) ctx.getBean("testBean");
	assertTrue(AopUtils.isAopProxy(testBeanProxy));

	// we need the real target too, not just the proxy...
	this.testBeanTarget = (TestBean) ((Advised)testBeanProxy).getTargetSource().getTarget();
}
 
Example #4
Source File: AfterReturningAdviceBindingTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
private AfterReturningAdviceBindingCollaborator getCollaborator() {
	return (AfterReturningAdviceBindingCollaborator) this.collaborator;
}
 
Example #5
Source File: AfterReturningAdviceBindingTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
private AfterReturningAdviceBindingCollaborator getCollaborator() {
	return (AfterReturningAdviceBindingCollaborator) this.collaborator;
}
 
Example #6
Source File: AfterReturningAdviceBindingTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
private AfterReturningAdviceBindingCollaborator getCollaborator() {
	return (AfterReturningAdviceBindingCollaborator) this.collaborator;
}