Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ws Wiki" for change 
notification.

The "FrontPage/Synapse/Samples/AutomationFramework/Extending" page has been 
changed by AmilaManoj:
http://wiki.apache.org/ws/FrontPage/Synapse/Samples/AutomationFramework/Extending

Comment:
Initial post

New page:
== Extending Synapse Sample Automation Framework ==
The framework will do tasks such as starting Syanpse with a provided 
configuration, starting back end servers such as Axis2, JMS broker, Derby 
server prior to the test and shutting down them after the test. It will also 
handle the requests from clients for currently implemented sample services.

=== Sample Descriptors ===
The configuration for a sample is provided to the framework through a 
descriptor file.

The file name of the descriptor should be the  Sample<sample-number>.xml and it 
should be placed in test  resources direcotry: 
SYNAPSE_HOME/modules/integration/src/test/resources

The structure of the descriptor is as follows,

{{{
<synapseSample>
    <sampleID>999</sampleID>
    <sampleName>Foo</sampleName>
    <synapseConfig>
        ...
    </synapseConfig>
    <backEndServerConfig>
        ...
    </backEndServerConfig>
    <clientConfig>
        ...
    </clientConfig>
</synapseSample>
}}}
=== Synapse Server ===
The framework will start synapse server before running a sample. Synapse 
specific configuration is defined in <synapseConfig> element in the descriptor. 
Here, Synapse configuration xml file for your sample is mandatory. Others are 
optional. You can specify the repository location for synapse (where addressing 
module, etc. is located), Axis2 Xml for synapse can also be specified. This is 
useful when your sample require configuring transports, clustering, etc.

The framework provides pre-configured axis2.xml files for default http/https 
transport (axis2_def.xml), jms, tcp, udp transports and axis2 clustering (. You 
can either choose to specify one of those or give your own customized axis2.xml 
location. The paths specified here are relative to synapse home.

{{{
<synapseConfig>
    <axis2Repo>repository/samples/synapseConfigs</axis2Repo>
    
<axis2Xml>repository/samples/synapseConfigs/severalsynapseAxis2/axis2_jms.xml</axis2Xml>
    <synapseXml>repository/conf/sample/synapse_sample_250.xml</synapseXml>
</synapseConfig>
}}}
=== Back-End Servers ===
You can start any number of backend servers for your sample. Currently Axis2, 
JMS Server and Derby Server are supported.

Configuration relevant to all the back end servers are given in 
<backEndServerConfig> in the descriptor file

{{{
<backEndServerConfig>
    <axis2Server id='0'>
        ...
    </axis2Server>
    <axis2Server id='1'>
        ...
    </axis2Server>
    <axis2Server id='2'>
        ...
    </axis2Server>
    ...
    ...
    <jmsBroker id='3'>
        ...
    </jmsBroker>
    ...
    ...
    <derbyServer id='5' />
    ...
</backEndServerConfig>
}}}
==== Axis2 Server ====
You can define a new axis2 server using <axis2Server> and specify the 
configuration similar to <synapseConfig>

{{{
<axis2Server id='0'>
    <axis2Repo>repository/samples/axis2Configs</axis2Repo>
    <axis2Xml>repository/samples/axis2Configs/axis2_def.xml</axis2Xml>
</axis2Server>
}}}
Here again, framework provides preconfigured axis2 xml files with default 
http/https transport(axis2_def.xml), for clustering (axis2_clustering.xml) and  
jms transport (axis2_jms.xml)

By default, following axis2 services used for existing samples are deployed in 
Axis2 Server

 * !SimpleStockQuoteService
 * !SecureStockQuoteService
 * !ReliableStockQuoteService
 * MTOMSwASampleService
 * !LoadbalanceFailoverService

If want use an Axis2 service other than those, you can create the  service, 
create the aar file and copy to  
SYNAPSE_HOME/repository/samples/axis2Configs/services direcotry.

==== JMS Broker ====
If you want JMS transport, you can use apache ActiveMQ as the JMS broker. This 
can be defined under <backEndServerConfig> in the descriptor file.

{{{
<jmsBroker id='0'>
    <providerURL>tcp://localhost:61616</providerURL>
    
<initialNamingFactory>org.apache.activemq.jndi.ActiveMQInitialContextFactory</initialNamingFactory>
</jmsBroker>
}}}
==== Derby Server ====
If your samples interacts with some database, you can use Apache Derby as the 
database server. It can be configured as,

{{{
<derbyServer id='1' />
}}}
=== Client Configuration ===
In addition to Synapse and Back-end servers, certain properties specific to 
clients can also be given in the descriptor

{{{
<clientConfig>
    <clientRepo>repository/samples/client_repo</clientRepo>
    <axis2Xml>repository/samples/client_repo/conf/axis2_jms.xml</axis2Xml>
</clientConfig>
}}}
The framework provides several clients for existing samples,

 * !StockQuoteSampleClient - Creates and sends a stock quote request, consumer 
of SimpleStockQuoteService
 * MTOMSwASampleClient  - Sends binary content using MTOM and SwA optimizations
 * JMSSampleClient - Posts a raw JMS text or binary message
 * !EventSampleClient - Does Synapse event source related operations such as 
subscribing, unsubscribing. event sending

If you want your custom client for your own axis2 or other services, you can 
create the client and add it to the package:

{{{
org.apache.synapse.samples.framework.clients
}}}

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to