DPascalBernard / maven-alfresco-archetypes

Automatically exported from code.google.com/p/maven-alfresco-archetypes
0 stars 0 forks source link

The AlfrescoPerson does not work in Maven SDK 1.1.1 #168

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by m.swe...@aca-it.be on 2 Dec 2013 at 3:30

GoogleCodeExporter commented 9 years ago
An issue has been created: http://issues.alfresco.com/jira/browse/ALF-20644

Original comment by m.swe...@aca-it.be on 10 Dec 2013 at 1:06

GoogleCodeExporter commented 9 years ago
Sam, you are assigned to the related 
http://issues.alfresco.com/jira/browse/ALF-20644
so assigning this to you if you don't mind.

Can you have a look at this?

Original comment by colum...@gmail.com on 18 Jul 2014 at 8:19