Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 168 by
m.swe...@aca-it.be: The AlfrescoPerson does not work in
Maven SDK 1.1.1
http://code.google.com/p/maven-alfresco-archetypes/issues/detail?id=168
What steps will reproduce the problem?
1. Create a fresh project with the Maven SDK 1.1.1
2. Create a test using the AlfrescoPerson rule to create a temporary user
3. The test will fail, because it cannot find the bean "testUserComponent".
What is the expected output? What do you see instead?
The rule should still work (just like in Maven SDK version 1.0.2), but it
complains about the bean that cannot be found.
What version of the product are you using? On what operating system?
Maven SDK 1.1.1. on OSX with Maven 3.1.1 and Alfresco 4.2.e.
Please provide any additional information below.
The bean is defined in the file "community-integration-test-context.xml". I
added it to my resources and referenced it in the @ContextConfiguration
annotation to work around this problem. However this should work out of the
box.
I also noticed that it is difficult to make it work out of the box, because
it is hard getting to the application context before the JUnit rule is
initialised. To fix it:
* My test implements ApplicationContextAware
* I have a custom ApplicationContextInit class which has a setter for the
ApplicationContext and a simple getter. I instantiate it as a private
variable on my test class.
* I pass the ApplicationContext within my test in the setApplicationContext
method provided by the ApplicationContextAware interface
* I am then able to pass the ApplicationContextInit instance to the
AlfrescoPerson rule.
This is also necessary to be able to use the TemporaryNodes rule. I feel
that it shouldn't be so hard trying to make the default test utility
classes to work.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings