Hi all,
 
at least on Windows (but I guess the same applies to Unix) the 
SynapseCommodityServiceTest is broken. I suspect this is due to the following 
change in ServerManager:
 
     public void setSynapseXMLPath(String synapseXMLPath) {
-        this.synapseXMLPath = synapseXMLPath;
+        if (!new File(synapseXMLPath).isAbsolute()) {
+            this.synapseXMLPath = synapseHome + File.separator + 
synapseXMLPath;
+        } else {
+            this.synapseXMLPath = synapseXMLPath;
+        }
     }
 
The condition is evaluated to true, but synapseHome is null which results in an 
invald path.
 
I don't know what's the proper fix to that. Maybe the Unit-Test has to set the 
SynapseHome appropriately.
Adding a line like:
ServerManager.getInstance().setSynapseHome(".");
in the setUp()-method of the test would let the test pass. Even if it passes 
the test synapse complaints about the missing
file ././../../repository/conf/sample/resources/fault, which indeed does not 
exist. But this seems to be only a warning as a result of a failed lookup using 
the registry. Anyway a default value will be used.
 
StackTrace for reference:
org.apache.synapse.SynapseException: Cannot load Synapse configuration from : 
null\./../../repository/conf/sample/resources/misc/synapse.xml
 at 
org.apache.synapse.config.SynapseConfigurationBuilder.handleException(SynapseConfigurationBuilder.java:105)
 at 
org.apache.synapse.config.SynapseConfigurationBuilder.getConfiguration(SynapseConfigurationBuilder.java:84)
 at 
org.apache.synapse.core.axis2.SynapseInitializationModule.getConfiguration(SynapseInitializationModule.java:161)
 at 
org.apache.synapse.core.axis2.SynapseInitializationModule.init(SynapseInitializationModule.java:84)
 at 
org.apache.axis2.context.ConfigurationContextFactory.initModules(ConfigurationContextFactory.java:226)
 at 
org.apache.axis2.context.ConfigurationContextFactory.init(ConfigurationContextFactory.java:204)
 at 
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:80)
 at 
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:184)
 at 
org.apache.synapse.n2n.SynapseCommodityServiceTest.setUp(SynapseCommodityServiceTest.java:67)
 at junit.framework.TestCase.runBare(TestCase.java:128)
 at junit.framework.TestResult$1.protect(TestResult.java:106)
 at junit.framework.TestResult.runProtected(TestResult.java:124)
 at junit.framework.TestResult.run(TestResult.java:109)
 at junit.framework.TestCase.run(TestCase.java:120)
 at 
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
 at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.io.FileNotFoundException: 
null\.\..\..\repository\conf\sample\resources\misc\synapse.xml (Das System kann 
den angegebenen Pfad nicht finden)
 at java.io.FileInputStream.open(Native Method)
 at java.io.FileInputStream.<init>(Unknown Source)
 at java.io.FileInputStream.<init>(Unknown Source)
 at 
org.apache.synapse.config.SynapseConfigurationBuilder.getConfiguration(SynapseConfigurationBuilder.java:77)
 ... 18 more
 
 
 
Regards,
   Eric

Reply via email to