Goal:
My goal is to provide an unambiguous (deterministic) path to my project xml 
file to ServerRuntime during automated testing (the plan is to have multiple 
stages of testing).   

My understanding  is that 4.0.1 uses:
     ServerRuntime.builder().addConfig()
to accomplish this normally.

Problems:
1. While trying to understand the behavior of .addConfig(), I have had to rely 
primarily on experiments (i.e. hacking), since I have found no documentation in 
JavaDocs (addConfig() JavaDoc has no comments). 

2. So it appears from my experiments that addConfig() assumes CLASSPATH 
referencing and will not accept an explicit path.
Example:
org.apache.cayenne.configuration.server.DataDomainLoadException: [v.4.0.1 Dec 
20 2018 11:02:32] Configuration resource 
"/webdev/cms/src/main/resources/config/cayenne/cayenne-CMSDomain.xml" is not 
found.
Note:
If I understand the behavior, addConfig() *only* allows project-file-path 
specification relative to one of the paths already specified in the CLASSPATH, 
and will not accept a full path entry.

3. To further complicate this, during testing, cayenne is complaining that 
multiple project files are found in the classpath (gradle, by default, appears 
to create a complex classpath that include multiple resource directories that 
contain the two project files).

Note:
Currently, I have the test-resources earlier in the classpath (cayenne runtime 
appears to select based on classpath positioning).  I would prefer a more 
explicit solution.


Questions:
1. With not much info in the JavaDocs on usage-options, does anyone have an 
online reference that could provide more insight (i.e. alternatives, use-case 
examples, etc)?

2. Does anyone know of a simpler way to accomplish my goal (i.e. 
deterministically or explicitly provide the project file to cayenne runtime)?


Thanks
Joe

Reply via email to