Hi Ruwan,
 
do you mean the check in ServerManager.validate()? This private method will 
only be called from the public start() method which only gets called from the 
main-method as well as from the init() method of the SynapseStartUpServlet. So 
while executing the test, this validation simply does not take place as the 
test uses its own "bootstrap" code to start the needed transports for the test. 
Atleast this is my understanding.
 
Regards,
   Eric

________________________________

Hi Eric/Asankha,

I just checked the code,


On Fri, May 16, 2008 at 5:29 AM, Hubert, Eric <[EMAIL PROTECTED]> wrote:


        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. 


this fixes the issue, but I was wondering how this error has occurred (it must 
fail before this). Because there is a validation before the server start, which 
checks whether the required parameters are not null and this validation 
includes synapse home as well????? Asabkha?
 

        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.


This is sort of OK, it tries to load the fault sequence from the registry since 
it is not specified in the local configuration and if not found directs to a 
default fault sequence which will be local to the configuration. Please note 
that this is a one time lookup (if not present in the registry) and happens at 
the startup time and is OK.....

Thanks,
Ruwan
 

         
        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




-- 
Ruwan Linton
http://www.wso2.org <http://www.wso2.org/>  - "Oxygenating the Web Services 
Platform" 

<<winmail.dat>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to