You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Gary Rudolph <Ga...@eharmony.com> on 2008/06/18 07:00:40 UTC

Unit Testing

Any resources/links that show how to unit test Synapse (particularly  
with maven)?

I saw the mock services with synapse at IBM Developers (which is  
fantastic to mock out proxies), but wanted to move to running via an  
automated build with maven.

An example is to launch synapse, run a unit test that uses a jax-ws  
client to connect and run a test.

Thanks, Gary

Re: Unit Testing

Posted by Ruwan Linton <ru...@gmail.com>.
Asankha and Garry,

I will need to walk through it again because most of them are not working
for the moment :-(

I will get back to you once they are working.

Thanks,
Ruwan

On Thu, Jun 19, 2008 at 7:51 AM, Asankha C. Perera <as...@wso2.com> wrote:

> Gary
>
>> That's correct. It's more about testing from a user perspective of testing
>> our synapse configuration, transformations, etc. If I envisioned this it
>> would be to launch Synapse, load the configuration and resources, etc. all
>> in the setup of a unit test, and then in the tests bang against that
>> instance.
>>
>> It's something we can work out on our side and post back to do it. I don't
>> see it being anything more elaborate than getting the right maven
>> dependencies for the runtime, launch axis/synapse embedded, point to our
>> configuration all inside some base unit test that we can extend. We're still
>> doing a POC, so I want to get through that first.
>>
>> I just wanted to see if anybody had done this already.
>>
> Sometime back Ruwan automated some of our many samples as unit tests..
> these can be found here [1], and triggered if you pass "-Dintegration" to
> Maven. See the pom.xml here [2]
>
> asankha
>
> [1]
> http://svn.apache.org/repos/asf/synapse/trunk/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/
> [2]
> http://svn.apache.org/repos/asf/synapse/trunk/java/modules/samples/pom.xml
>
> --
> Asankha C. Perera
>
> WSO2 - http://wso2.org
> http://esbmagic.blogspot.com
>
>


-- 
Ruwan Linton
http://wso2.org - "Oxygenating the Web Services Platform"
http://ruwansblog.blogspot.com/

Re: Unit Testing

Posted by "Asankha C. Perera" <as...@wso2.com>.
Gary
> That's correct. It's more about testing from a user perspective of 
> testing our synapse configuration, transformations, etc. If I 
> envisioned this it would be to launch Synapse, load the configuration 
> and resources, etc. all in the setup of a unit test, and then in the 
> tests bang against that instance.
>
> It's something we can work out on our side and post back to do it. I 
> don't see it being anything more elaborate than getting the right 
> maven dependencies for the runtime, launch axis/synapse embedded, 
> point to our configuration all inside some base unit test that we can 
> extend. We're still doing a POC, so I want to get through that first.
>
> I just wanted to see if anybody had done this already.
Sometime back Ruwan automated some of our many samples as unit tests.. 
these can be found here [1], and triggered if you pass "-Dintegration" 
to Maven. See the pom.xml here [2]

asankha

[1] 
http://svn.apache.org/repos/asf/synapse/trunk/java/modules/samples/src/test/java/org/apache/synapse/samples/n2n/
[2] 
http://svn.apache.org/repos/asf/synapse/trunk/java/modules/samples/pom.xml

-- 
Asankha C. Perera

WSO2 - http://wso2.org
http://esbmagic.blogspot.com


Re: Unit Testing

Posted by Gary Rudolph <Ga...@eharmony.com>.
That's correct. It's more about testing from a user perspective of  
testing our synapse configuration, transformations, etc. If I  
envisioned this it would be to launch Synapse, load the configuration  
and resources, etc. all in the setup of a unit test, and then in the  
tests bang against that instance.

It's something we can work out on our side and post back to do it. I  
don't see it being anything more elaborate than getting the right  
maven dependencies for the runtime, launch axis/synapse embedded,  
point to our configuration all inside some base unit test that we can  
extend. We're still doing a POC, so I want to get through that first.

I just wanted to see if anybody had done this already.

Thanks, Gary

On Jun 18, 2008, at 2:16 AM, Asankha C. Perera wrote:

> I guess the question is how an "end-user" of Synapse can use Maven to
> run unit tests for his Synapse configuration.. I guess this is a good
> mini-project for a Google Summer of Code :D..
>
> Gary, if you are interested in helping us by any chance, do let us  
> know
> and we would be very happy to help you. Else, you can also add a  
> JIRA as
> an enhancement / nice-to have feature, so that anyone who has the
> bandwidth to help us out would know of this requirement
>
> asankha
>
> Ruwan Linton wrote:
>> I think this is more of an unit test (junit) problem, or am I not  
>> getting
>> your question correctly? (in which case please describe the  
>> requirement a
>> bit more)
>>
>> You can find the synapse Unit tests in the synapse code base at the
>> svn<http://svn.apache.org/repos/asf/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/ 
>> >or
>> in the source distribution in the downloads
>> section <http://synapse.apache.org/download.html> and get some  
>> understanding
>> on the tests. I think
>> SynapseCommodityServiceTest<http://svn.apache.org/repos/asf/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/n2n/SynapseCommodityServiceTest.java 
>> >will
>> give you a better understanding on how to do this. Even you can use
>> TestSuite to setup the Synapse server at the initiation of the tests.
>>
>> Thanks,
>> Ruwan
>>
>> On Wed, Jun 18, 2008 at 10:30 AM, Gary Rudolph <GaryRudolph@eharmony.com 
>> >
>> wrote:
>>
>>
>>> Any resources/links that show how to unit test Synapse  
>>> (particularly with
>>> maven)?
>>>
>>> I saw the mock services with synapse at IBM Developers (which is  
>>> fantastic
>>> to mock out proxies), but wanted to move to running via an  
>>> automated build
>>> with maven.
>>>
>>> An example is to launch synapse, run a unit test that uses a jax- 
>>> ws client
>>> to connect and run a test.
>>>
>>> Thanks, Gary
>>>
>>>
>>
>>
>>
>>
>
> --
> Asankha C. Perera
>
> WSO2 - http://wso2.org
> http://esbmagic.blogspot.com
>


Re: Unit Testing

Posted by "Asankha C. Perera" <as...@wso2.com>.
I guess the question is how an "end-user" of Synapse can use Maven to 
run unit tests for his Synapse configuration.. I guess this is a good 
mini-project for a Google Summer of Code :D..

Gary, if you are interested in helping us by any chance, do let us know 
and we would be very happy to help you. Else, you can also add a JIRA as 
an enhancement / nice-to have feature, so that anyone who has the 
bandwidth to help us out would know of this requirement

asankha

Ruwan Linton wrote:
> I think this is more of an unit test (junit) problem, or am I not getting
> your question correctly? (in which case please describe the requirement a
> bit more)
>
> You can find the synapse Unit tests in the synapse code base at the
> svn<http://svn.apache.org/repos/asf/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/>or
> in the source distribution in the downloads
> section <http://synapse.apache.org/download.html> and get some understanding
> on the tests. I think
> SynapseCommodityServiceTest<http://svn.apache.org/repos/asf/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/n2n/SynapseCommodityServiceTest.java>will
> give you a better understanding on how to do this. Even you can use
> TestSuite to setup the Synapse server at the initiation of the tests.
>
> Thanks,
> Ruwan
>
> On Wed, Jun 18, 2008 at 10:30 AM, Gary Rudolph <Ga...@eharmony.com>
> wrote:
>
>   
>> Any resources/links that show how to unit test Synapse (particularly with
>> maven)?
>>
>> I saw the mock services with synapse at IBM Developers (which is fantastic
>> to mock out proxies), but wanted to move to running via an automated build
>> with maven.
>>
>> An example is to launch synapse, run a unit test that uses a jax-ws client
>> to connect and run a test.
>>
>> Thanks, Gary
>>
>>     
>
>
>
>   

-- 
Asankha C. Perera

WSO2 - http://wso2.org
http://esbmagic.blogspot.com


Re: Unit Testing

Posted by Ruwan Linton <ru...@gmail.com>.
I think this is more of an unit test (junit) problem, or am I not getting
your question correctly? (in which case please describe the requirement a
bit more)

You can find the synapse Unit tests in the synapse code base at the
svn<http://svn.apache.org/repos/asf/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/>or
in the source distribution in the downloads
section <http://synapse.apache.org/download.html> and get some understanding
on the tests. I think
SynapseCommodityServiceTest<http://svn.apache.org/repos/asf/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/n2n/SynapseCommodityServiceTest.java>will
give you a better understanding on how to do this. Even you can use
TestSuite to setup the Synapse server at the initiation of the tests.

Thanks,
Ruwan

On Wed, Jun 18, 2008 at 10:30 AM, Gary Rudolph <Ga...@eharmony.com>
wrote:

>
> Any resources/links that show how to unit test Synapse (particularly with
> maven)?
>
> I saw the mock services with synapse at IBM Developers (which is fantastic
> to mock out proxies), but wanted to move to running via an automated build
> with maven.
>
> An example is to launch synapse, run a unit test that uses a jax-ws client
> to connect and run a test.
>
> Thanks, Gary
>



-- 
Ruwan Linton
http://wso2.org - "Oxygenating the Web Services Platform"
http://ruwansblog.blogspot.com/