Open leonardofl opened 11 years ago
Obs: the DeploymentManager Config tries to load the following file (path in my machine): /home/leonardo/workspaces/choreos/choreos_middleware/ChoreographyDeployer/file:/home/leonardo/.m2/repository/org/ow2/choreos/DeploymentManager/0.0.1-SNAPSHOT/DeploymentManager-0.0.1-SNAPSHOT.jar!/deployment.properties
An to this path, the command "new FileReader(new File(path))" executed in the ChoreographyDeployer project throws the FileNotFoundException.
Each project has its own resources folder. But when project A uses project B, and the JVM is started in the context of the project A, classes in project B will search for resources in the project A resources folder!
Currently we are accessing resources with the classLoader.getSystemResource() method.
Two points where this causes problems:
1) ChefNodeNameRetriever (Commons project) is searching my_chef_name.sh in the Deployment Manager project. Currently this is handled with the duplication of the my_chef_name.sh resource in both projects.
2) Choreography Deployer integration tests should the Deployment Manager, but this step is not working because the way like the RecipeBuilder access the resources. The workaround now is manually starting the Deployment Manager server and after running the Choreography Deployer test. But the right fix would be making the RecipeBuilder properly accessing the resources.
I'm not sure about the best solution, but in a Python project, Eduardo helped me to find the following solution: the source code knows the resource relative path and access it through the absolute path, joining the source file absolute path to the relative path. However some research is necessary to find the best Java way to do this.