Author: supun
Date: Wed May 18 13:06:01 2011
New Revision: 1124245
URL: http://svn.apache.org/viewvc?rev=1124245&view=rev
Log:
fixing the url rewrite mediator test cases
Modified:
synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/URLRewriteMediatorSerializationTest.java
synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/mediators/transform/url/URLRewriteMediatorTest.java
Modified:
synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/URLRewriteMediatorSerializationTest.java
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/URLRewriteMediatorSerializationTest.java?rev=1124245&r1=1124244&r2=1124245&view=diff
==============================================================================
---
synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/URLRewriteMediatorSerializationTest.java
(original)
+++
synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/URLRewriteMediatorSerializationTest.java
Wed May 18 13:06:01 2011
@@ -30,37 +30,37 @@ public class URLRewriteMediatorSerializa
}
public void testSerializationScenario1() {
- String xml = "<rewrite
xmlns=\"http://ws.apache.org/ns/synapse\"><rule>" +
+ String xml = "<rewrite
xmlns=\"http://ws.apache.org/ns/synapse\"><rewriterule>" +
"<action fragment=\"protocol\" value=\"https\"
type=\"set\"/><action " +
"fragment=\"host\" value=\"www.test.com\"
type=\"set\"/><action " +
"fragment=\"port\" value=\"9090\" type=\"set\"/><action
fragment=\"path\" " +
- "value=\"/services\" type=\"prepend\"/></rule></rewrite>";
+ "value=\"/services\"
type=\"prepend\"/></rewriterule></rewrite>";
assertTrue(serialization(xml, urlRewriteMediatorFactory,
urlRewriteMediatorSerializer));
}
public void testSerializationScenario2() {
String xml = "<rewrite xmlns=\"http://ws.apache.org/ns/synapse\">" +
- "<rule><condition><match xmlns=\"\" type=\"url\"
source=\"host\" regex=\"localhost\"/>" +
+ "<rewriterule><condition><match xmlns=\"\" type=\"url\"
source=\"host\" regex=\"localhost\"/>" +
"</condition><action fragment=\"protocol\" value=\"https\"
type=\"set\"/>" +
"<action fragment=\"host\" value=\"www.test.com\"
type=\"set\"/><action " +
"fragment=\"port\" value=\"9090\" type=\"set\"/><action
fragment=\"path\" " +
- "value=\"/services\" type=\"prepend\"/></rule>" +
+ "value=\"/services\" type=\"prepend\"/></rewriterule>" +
"</rewrite>";
assertTrue(serialization(xml, urlRewriteMediatorFactory,
urlRewriteMediatorSerializer));
}
public void testSerializationScenario3() {
- String xml = "<rewrite
xmlns=\"http://ws.apache.org/ns/synapse\"><rule>" +
- "<action fragment=\"full\"
value=\"http://localhost:8080/synapse\" type=\"set\"/></rule>" +
- "<rule><condition><match xmlns=\"\" type=\"url\"
source=\"host\" regex=\"localhost\"/>" +
+ String xml = "<rewrite
xmlns=\"http://ws.apache.org/ns/synapse\"><rewriterule>" +
+ "<action fragment=\"full\"
value=\"http://localhost:8080/synapse\" type=\"set\"/></rewriterule>" +
+ "<rewriterule><condition><match xmlns=\"\" type=\"url\"
source=\"host\" regex=\"localhost\"/>" +
"</condition><action fragment=\"protocol\" value=\"https\"
type=\"set\"/>" +
"<action fragment=\"host\" value=\"www.test.com\"
type=\"set\"/>" +
"<action fragment=\"port\" xpath=\"get-property('port')\"
type=\"set\"/>" +
- "<action fragment=\"path\" value=\"/services\"
type=\"prepend\"/></rule><rule>" +
+ "<action fragment=\"path\" value=\"/services\"
type=\"prepend\"/></rewriterule><rewriterule>" +
"<condition><and xmlns=\"\"><match type=\"url\"
source=\"host\" regex=\"www.test.com\"/>" +
"<equal type=\"url\" source=\"port\"
value=\"9090\"/></and></condition>" +
"<action fragment=\"path\" regex=\".*/FooService\"
type=\"replace\" " +
- "value=\"/BarService\"/></rule>" +
+ "value=\"/BarService\"/></rewriterule>" +
"</rewrite>";
assertTrue(serialization(xml, urlRewriteMediatorFactory,
urlRewriteMediatorSerializer));
}
Modified:
synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/mediators/transform/url/URLRewriteMediatorTest.java
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/mediators/transform/url/URLRewriteMediatorTest.java?rev=1124245&r1=1124244&r2=1124245&view=diff
==============================================================================
---
synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/mediators/transform/url/URLRewriteMediatorTest.java
(original)
+++
synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/mediators/transform/url/URLRewriteMediatorTest.java
Wed May 18 13:06:01 2011
@@ -224,7 +224,7 @@ public class URLRewriteMediatorTest exte
public void testFullRewriteScenario1() throws Exception {
String xml =
"<rewrite xmlns=\"http://ws.apache.org/ns/synapse\">\n" +
- " <rule>\n" +
+ " <rewriterule>\n" +
" <condition>\n" +
" <and>\n" +
" <equal type=\"url\" source=\"protocol\"
value=\"http\"/>\n" +
@@ -234,16 +234,16 @@ public class URLRewriteMediatorTest exte
" <action value=\"https\" fragment=\"protocol\"/>\n" +
" <action value=\"test.com\" fragment=\"host\"/>\n" +
" <action value=\"9443\" fragment=\"port\"/>\n" +
- " </rule>\n" +
- " <rule>\n" +
+ " </rewriterule>\n" +
+ " <rewriterule>\n" +
" <condition>\n" +
" <not>\n" +
" <match type=\"url\" source=\"path\"
regex=\"/services/.*\"/>\n" +
" </not>\n" +
" </condition>\n" +
" <action value=\"/services\" type=\"prepend\"
fragment=\"path\"/>\n" +
- " </rule>\n" +
- " <rule>\n" +
+ " </rewriterule>\n" +
+ " <rewriterule>\n" +
" <condition>\n" +
" <and>\n" +
" <match type=\"url\" source=\"path\"
regex=\".*/MyService\"/>\n" +
@@ -252,7 +252,7 @@ public class URLRewriteMediatorTest exte
" </condition> \n" +
" <action fragment=\"path\" value=\"StockQuoteService\"
regex=\"MyService\" type=\"replace\"/>\n" +
" <action fragment=\"ref\" value=\"id\"/>\n" +
- " </rule>\n" +
+ " </rewriterule>\n" +
"</rewrite>";
OMElement element = AXIOMUtil.stringToOM(xml);