Skip to content

Commit f474706

Browse files
Bump axis2 version and add inbound factory test for versioned deployment
1 parent 12d94f4 commit f474706

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

modules/core/src/test/java/org/apache/synapse/endpoints/dynamic/InboundEndpointTestCase.java

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
import org.apache.synapse.config.xml.inbound.InboundEndpointSerializer;
2929
import org.apache.synapse.inbound.InboundEndpoint;
3030

31+
import java.util.Properties;
32+
3133
/**
3234
* Testing InboundEndpoint related operations
3335
*/
@@ -73,6 +75,30 @@ public class InboundEndpointTestCase extends TestCase {
7375
+ "<sequence xmlns=\"http://ws.apache.org/ns/synapse\" name=\"receiveSeq\">\n" + " <send/>\n"
7476
+ "</sequence>";
7577

78+
private static final String rabbitMQInbound = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
79+
"<inboundEndpoint name=\"RabbitMQInbound\" sequence=\"RabbitMQInbound-inboundSequence\" onError=\"RabbitMQInbound-inboundErrorSequence\" suspend=\"false\" protocol=\"rabbitmq\">\n" +
80+
" <parameters xmlns=\"http://ws.apache.org/ns/synapse\">\n" +
81+
" <parameter name=\"rabbitmq.connection.factory\">QueueConnectionFactory</parameter>\n" +
82+
" <parameter name=\"rabbitmq.server.host.name\">localhost</parameter>\n" +
83+
" <parameter name=\"rabbitmq.server.port\">5672</parameter>\n" +
84+
" <parameter name=\"rabbitmq.server.user.name\">guest</parameter>\n" +
85+
" <parameter name=\"rabbitmq.server.password\">guest</parameter>\n" +
86+
" <parameter name=\"rabbitmq.queue.name\">queue_transaction</parameter>\n" +
87+
" <parameter name=\"sequential\">true</parameter>\n" +
88+
" <parameter name=\"coordination\">true</parameter>\n" +
89+
" <parameter name=\"rabbitmq.queue.durable\">false</parameter>\n" +
90+
" <parameter name=\"rabbitmq.queue.exclusive\">false</parameter>\n" +
91+
" <parameter name=\"rabbitmq.queue.auto.delete\">false</parameter>\n" +
92+
" <parameter name=\"rabbitmq.queue.auto.ack\">false</parameter>\n" +
93+
" <parameter name=\"rabbitmq.queue.autodeclare\">false</parameter>\n" +
94+
" <parameter name=\"rabbitmq.exchange.durable\">false</parameter>\n" +
95+
" <parameter name=\"rabbitmq.exchange.auto.delete\">false</parameter>\n" +
96+
" <parameter name=\"rabbitmq.exchange.autodeclare\">false</parameter>\n" +
97+
" <parameter name=\"rabbitmq.connection.ssl.enabled\">false</parameter>\n" +
98+
" <parameter name=\"rabbitmq.channel.consumer.qos\">0</parameter>\n" +
99+
" </parameters>\n" +
100+
"</inboundEndpoint>";
101+
76102
public void testCreateValidInboundEP() throws Exception {
77103
ep = factory.createInboundEndpoint(AXIOMUtil.stringToOM(sampleEP), config);
78104
Assert.assertNotNull("Inbound Endpoint is null", ep);
@@ -110,4 +136,28 @@ public void testCreateInvalidInboundEP() throws Exception {
110136
Assert.assertEquals(e.getMessage().contains("Inbound Endpoint name cannot be null"), true);
111137
}
112138
}
139+
140+
public void testInboundEPWithVersionedDeployment() throws Exception {
141+
142+
Properties properties = new Properties();
143+
properties.put("synapse.artifact.versioned.deployment", true);
144+
properties.put("synapse.artifact.identifier", "com.microintegrator.projects__beta1__1.0.2");
145+
146+
ep = factory.createInboundEndpoint(AXIOMUtil.stringToOM(rabbitMQInbound), config, properties);
147+
Assert.assertEquals("RabbitMQInbound", ep.getName());
148+
Assert.assertEquals("com.microintegrator.projects__beta1__1.0.2__RabbitMQInbound-inboundSequence", ep.getInjectingSeq());
149+
Assert.assertEquals("com.microintegrator.projects__beta1__1.0.2__RabbitMQInbound-inboundErrorSequence", ep.getOnErrorSeq());
150+
}
151+
152+
public void testInboundEPWithNonVersionedDeployment() throws Exception {
153+
154+
Properties properties = new Properties();
155+
properties.put("synapse.artifact.versioned.deployment", false);
156+
properties.put("synapse.artifact.identifier", "com.microintegrator.projects__beta1__1.0.2");
157+
158+
ep = factory.createInboundEndpoint(AXIOMUtil.stringToOM(rabbitMQInbound), config, properties);
159+
Assert.assertEquals("RabbitMQInbound", ep.getName());
160+
Assert.assertEquals("RabbitMQInbound-inboundSequence", ep.getInjectingSeq());
161+
Assert.assertEquals("RabbitMQInbound-inboundErrorSequence", ep.getOnErrorSeq());
162+
}
113163
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@
15641564
<mina.version>2.1.6</mina.version>
15651565
<jms-1.1-spec.version>1.1</jms-1.1-spec.version>
15661566
<!-- Axis2 and its dependencies -->
1567-
<axis2.version>1.6.1-wso2v112</axis2.version>
1567+
<axis2.version>1.6.1-wso2v113</axis2.version>
15681568
<axis2.transport.version>2.0.0-wso2v77</axis2.transport.version>
15691569
<axiom.version>1.2.11-wso2v30</axiom.version>
15701570
<xml_schema.version>1.4.7</xml_schema.version>

0 commit comments

Comments
 (0)