You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by in...@apache.org on 2007/03/12 13:16:02 UTC

svn commit: r517189 - in /webservices/synapse/trunk/java: ./ modules/core/src/main/java/org/apache/synapse/config/xml/ modules/core/src/test/java/org/apache/synapse/config/xml/ modules/extensions/src/test/java/org/apache/synapse/mediators/ modules/exte...

Author: indika
Date: Mon Mar 12 05:16:01 2007
New Revision: 517189

URL: http://svn.apache.org/viewvc?view=rev&rev=517189
Log:
change remote registry parameter syntax 
add XMlUnit to compare two xml
change sample 
add throttle samples

Added:
    webservices/synapse/trunk/java/repository/conf/sample/resources/policy/throttle_policy.xml
    webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_400.xml
    webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_401.xml
Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RegistryFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RegistrySerializer.java
    webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/AbstractTestCase.java
    webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/ProxyServiceSerializationTest.java
    webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/RegistrySerializationTest.java
    webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/SwitchMediatorSerializationTest.java
    webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/AbstractTestCase.java
    webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/bsf/ScriptMediatorSerializationTest.java
    webservices/synapse/trunk/java/pom.xml
    webservices/synapse/trunk/java/repository/conf/sample/resources/spring/synapse_spring_unittest.xml
    webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml
    webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_11.xml
    webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_503.xml
    webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_8.xml
    webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_9.xml

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RegistryFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RegistryFactory.java?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RegistryFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RegistryFactory.java Mon Mar 12 05:16:01 2007
@@ -43,7 +43,6 @@
     public static final QName PROVIDER_Q = new QName(Constants.NULL_NAMESPACE, "provider");
     public static final QName PARAMETER_Q = new QName(Constants.NULL_NAMESPACE, "parameter");
     public static final QName NAME_Q     = new QName(Constants.NULL_NAMESPACE, "name");
-    public static final QName VALUE_Q    = new QName(Constants.NULL_NAMESPACE, "value");
 
     public static Registry createRegistry(OMElement elem) {
 
@@ -73,21 +72,22 @@
     }
 
     private static void setProperties(Registry reg, OMElement elem) {
-        Iterator iter = elem.getChildrenWithName(PARAMETER_Q);
-        while (iter.hasNext()) {
-            Object o = iter.next();
+        Iterator params = elem.getChildrenWithName(PARAMETER_Q);
+        while (params.hasNext()) {
+            Object o = params.next();
             if (o instanceof OMElement) {
-                OMElement propEle = (OMElement) o;
-                OMAttribute nAtt = propEle.getAttribute(NAME_Q);
-                OMAttribute vAtt = propEle.getAttribute(VALUE_Q);
-                if (nAtt != null && vAtt !=null) {
-                    reg.addConfigProperty(nAtt.getAttributeValue(), vAtt.getAttributeValue());
+                OMElement prop = (OMElement) o;
+                OMAttribute pname = prop.getAttribute(NAME_Q);
+                String propertyValue = prop.getText();
+                if (pname != null) {
+                    if (propertyValue != null) {
+                        reg.addConfigProperty(pname.getAttributeValue(), propertyValue.trim());
+                    }
                 } else {
-                    handleException("The 'name' and 'value' attributes are required for a " +
-                        "registry property definition");
+                    handleException("Invalid registry property - property should have a name ");
                 }
             } else {
-                handleException("Invalid 'property' definition for registry.");
+                handleException("Invalid registry property");
             }
         }
     }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RegistrySerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RegistrySerializer.java?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RegistrySerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RegistrySerializer.java Mon Mar 12 05:16:01 2007
@@ -61,8 +61,7 @@
             OMElement property = fac.createOMElement("parameter", synNS);
             property.addAttribute(fac.createOMAttribute(
                 "name", nullNS, name));
-            property.addAttribute(fac.createOMAttribute(
-                "value", nullNS, value));
+            property.setText(value.trim());
             reg.addChild(property);
         }
 

Modified: webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/AbstractTestCase.java?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/AbstractTestCase.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/AbstractTestCase.java Mon Mar 12 05:16:01 2007
@@ -22,20 +22,26 @@
 import org.apache.axiom.om.impl.exception.XMLComparisonException;
 import org.apache.axiom.om.impl.llom.util.XMLComparator;
 import org.apache.synapse.Mediator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.custommonkey.xmlunit.XMLTestCase;
+import org.xml.sax.SAXException;
 
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.parsers.ParserConfigurationException;
 import java.io.StringReader;
+import java.io.IOException;
 
 /**
  *
  *
  */
 
-public abstract class AbstractTestCase extends TestCase {
+public abstract class AbstractTestCase extends XMLTestCase {
 
-    XMLComparator comparator = null;
+    private static final Log log = LogFactory.getLog(AbstractTestCase.class);
 
     public AbstractTestCase(String name) {
         super(name);
@@ -46,7 +52,6 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        comparator = new XMLComparator();
     }
 
     protected OMElement createOMElement(String xml) {
@@ -63,19 +68,39 @@
         }
     }
 
-    protected boolean serialization(String inputXml, MediatorFactory mediatorFactory, MediatorSerializer mediatorSerializer) throws XMLComparisonException {
+    protected boolean serialization(String inputXml, MediatorFactory mediatorFactory, MediatorSerializer mediatorSerializer) {
 
         OMElement inputOM = createOMElement(inputXml);
         Mediator mediator = mediatorFactory.createMediator(inputOM);
         OMElement resultOM = mediatorSerializer.serializeMediator(null, mediator);
-        return comparator.compare(resultOM, inputOM);
+        try {
+            assertXMLEqual(resultOM.toString(), inputOM.toString());
+            return true;
+        } catch (SAXException e) {
+            log.error(e);
+        } catch (IOException e) {
+            log.error(e);
+        } catch (ParserConfigurationException e) {
+            log.error(e);
+        }
+        return false;
     }
 
-    protected boolean serialization(String inputXml, MediatorSerializer mediatorSerializer) throws XMLComparisonException {
+    protected boolean serialization(String inputXml, MediatorSerializer mediatorSerializer) {
         OMElement inputOM = createOMElement(inputXml);
         Mediator mediator = MediatorFactoryFinder.getInstance().getMediator(inputOM);
         OMElement resultOM = mediatorSerializer.serializeMediator(null, mediator);
-        return comparator.compare(resultOM, inputOM);
+        try {
+            assertXMLEqual(resultOM.toString(), inputOM.toString());
+            return true;
+        } catch (SAXException e) {
+            log.error(e);
+        } catch (IOException e) {
+            log.error(e);
+        } catch (ParserConfigurationException e) {
+            log.error(e);
+        }
+        return false;
     }
 
     protected OMElement getParent() {
@@ -83,7 +108,18 @@
         return createOMElement(parentXML);
     }
 
-    protected boolean compare(OMElement inputElement, OMElement serializedElement) throws XMLComparisonException {
-        return  comparator.compare(inputElement, serializedElement);
+    protected boolean compare(OMElement inputElement, OMElement serializedElement)  {
+        try {
+            
+            assertXMLEqual(inputElement.toString(), serializedElement.toString());
+            return true;
+        } catch (SAXException e) {
+            log.error(e);
+        } catch (IOException e) {
+            log.error(e);
+        } catch (ParserConfigurationException e) {
+            log.error(e);
+        }
+        return false;
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/ProxyServiceSerializationTest.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/ProxyServiceSerializationTest.java?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/ProxyServiceSerializationTest.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/ProxyServiceSerializationTest.java Mon Mar 12 05:16:01 2007
@@ -31,7 +31,7 @@
         OMElement inputOM = createOMElement(inputXml);
         ProxyService proxy = ProxyServiceFactory.createProxy(inputOM);
         OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy);
-        assertTrue(comparator.compare(resultOM, inputOM));
+        assertTrue(compare(resultOM, inputOM));
     }
 
     public void testProxyServiceSerializationSenarioTwo() throws Exception {
@@ -39,7 +39,7 @@
         OMElement inputOM = createOMElement(inputXml);
         ProxyService proxy = ProxyServiceFactory.createProxy(inputOM);
         OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy);
-        assertTrue(comparator.compare(resultOM, inputOM));
+        assertTrue(compare(resultOM, inputOM));
     }
 
     public void testProxyServiceSerializationSenarioThree() throws Exception {
@@ -47,7 +47,7 @@
         OMElement inputOM = createOMElement(inputXml);
         ProxyService proxy = ProxyServiceFactory.createProxy(inputOM);
         OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy);
-        assertTrue(comparator.compare(resultOM, inputOM));
+        assertTrue(compare(resultOM, inputOM));
     }
 
 //    public void testProxyServiceSerializationSenarioFour() throws Exception {
@@ -63,7 +63,7 @@
         OMElement inputOM = createOMElement(inputXml);
         ProxyService proxy = ProxyServiceFactory.createProxy(inputOM);
         OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy);     
-        assertTrue(comparator.compare(resultOM, inputOM));
+        assertTrue(compare(resultOM, inputOM));
     }
 //     public void testProxyServiceSerializationSenarioSix() throws Exception {
 //        String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" startOnLoad=\"true\" name=\"name\"  transports=\"http\"><description>description</description><target><endpoint address=\"http://www.example.com/testepr\" /></target><publish-wsdl uri=\"http://uri\" key=\"key\"></publish-wsdl><policy key=\"key\"/><parameter name=\"para\"><inline xmlns=\"http://customns\"><test/></inline></parameter></proxy>";

Modified: webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/RegistrySerializationTest.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/RegistrySerializationTest.java?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/RegistrySerializationTest.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/RegistrySerializationTest.java Mon Mar 12 05:16:01 2007
@@ -36,17 +36,16 @@
     public void testRegistrySerialization() {
 
         String regitryConfiguration = "<syn:registry xmlns:syn=\"http://ws.apache.org/ns/synapse\" provider=\"org.apache.synapse.registry.url.SimpleURLRegistry\">" +
-                "<syn:parameter name=\"root\" value=\"file:./../../repository/\"/>" +
-                "<syn:parameter name=\"cachableDuration\" value=\"15000\"/>" +
+                "<syn:parameter name=\"root\">file:./../../repository/</syn:parameter>" +
+                "<syn:parameter name=\"cachableDuration\">15000</syn:parameter>" +
                 "</syn:registry>";
 
         OMElement registryElement = createOMElement(regitryConfiguration);
         Registry registry = RegistryFactory.createRegistry(registryElement);
         OMElement serializedElement = RegistrySerializer.serializeRegistry(null, registry);
-
         try {
             assertTrue(compare(registryElement, serializedElement));
-        } catch (XMLComparisonException e) {
+        } catch (Exception e) {
             fail("Exception in test.");
         }
     }

Modified: webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/SwitchMediatorSerializationTest.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/SwitchMediatorSerializationTest.java?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/SwitchMediatorSerializationTest.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/SwitchMediatorSerializationTest.java Mon Mar 12 05:16:01 2007
@@ -41,7 +41,7 @@
 
         try {
             assertTrue(serialization(switchConfiguration, switchMediatorFactory, switchMediatorSerializer));
-        } catch (XMLComparisonException e) {
+        } catch (Exception e) {
             fail("Exception in test");
         }
     }
@@ -55,7 +55,7 @@
 
         try {
             assertTrue(serialization(switchConfiguration, switchMediatorFactory, switchMediatorSerializer));
-        } catch (XMLComparisonException e) {
+        } catch (Exception e) {
             fail("Exception in test");
         }
     }

Modified: webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/AbstractTestCase.java?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/AbstractTestCase.java (original)
+++ webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/AbstractTestCase.java Mon Mar 12 05:16:01 2007
@@ -24,20 +24,27 @@
 import org.apache.synapse.config.xml.MediatorSerializer;
 import org.apache.synapse.config.xml.MediatorFactoryFinder;
 import org.apache.synapse.Mediator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.xml.sax.SAXException;
+import org.custommonkey.xmlunit.XMLTestCase;
 
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
+import javax.xml.parsers.ParserConfigurationException;
 import java.io.StringReader;
+import java.io.IOException;
 
 /**
  *
  *
  */
 
-public abstract class AbstractTestCase extends TestCase {
+public abstract class AbstractTestCase extends XMLTestCase {
 
-    XMLComparator comparator = null;
+
+    private static final Log log = LogFactory.getLog(AbstractTestCase.class);
 
     public AbstractTestCase(String name) {
         super(name);
@@ -48,7 +55,6 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        comparator = new XMLComparator();
     }
 
     protected OMElement createOMElement(String xml) {
@@ -65,19 +71,39 @@
         }
     }
 
-    protected boolean serialization(String inputXml, MediatorFactory mediatorFactory, MediatorSerializer mediatorSerializer) throws XMLComparisonException {
+    protected boolean serialization(String inputXml, MediatorFactory mediatorFactory, MediatorSerializer mediatorSerializer) {
 
         OMElement inputOM = createOMElement(inputXml);
         Mediator mediator = mediatorFactory.createMediator(inputOM);
         OMElement resultOM = mediatorSerializer.serializeMediator(null, mediator);
-        return comparator.compare(resultOM, inputOM);
+        try {
+            assertXMLEqual(resultOM.toString(), inputOM.toString());
+            return true;
+        } catch (SAXException e) {
+            log.error(e);
+        } catch (IOException e) {
+            log.error(e);
+        } catch (ParserConfigurationException e) {
+            log.error(e);
+        }
+        return false;
     }
 
-    protected boolean serialization(String inputXml, MediatorSerializer mediatorSerializer) throws XMLComparisonException {
+    protected boolean serialization(String inputXml, MediatorSerializer mediatorSerializer) {
         OMElement inputOM = createOMElement(inputXml);
         Mediator mediator = MediatorFactoryFinder.getInstance().getMediator(inputOM);
         OMElement resultOM = mediatorSerializer.serializeMediator(null, mediator);
-        return comparator.compare(resultOM, inputOM);
+        try {
+            assertXMLEqual(resultOM.toString(), inputOM.toString());
+            return true;
+        } catch (SAXException e) {
+            log.error(e);
+        } catch (IOException e) {
+            log.error(e);
+        } catch (ParserConfigurationException e) {
+            log.error(e);
+        }
+        return false;
     }
 
     protected OMElement getParent() {
@@ -85,7 +111,17 @@
         return createOMElement(parentXML);
     }
 
-    protected boolean compare(OMElement inputElement, OMElement serializedElement) throws XMLComparisonException {
-        return comparator.compare(inputElement, serializedElement);
+    protected boolean compare(OMElement inputElement, OMElement serializedElement) {
+        try {
+            assertXMLEqual(inputElement.toString(), serializedElement.toString());
+            return true;
+        } catch (SAXException e) {
+            log.error(e);
+        } catch (IOException e) {
+            log.error(e);
+        } catch (ParserConfigurationException e) {
+            log.error(e);
+        }
+        return false;
     }
 }

Modified: webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/bsf/ScriptMediatorSerializationTest.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/bsf/ScriptMediatorSerializationTest.java?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/bsf/ScriptMediatorSerializationTest.java (original)
+++ webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/bsf/ScriptMediatorSerializationTest.java Mon Mar 12 05:16:01 2007
@@ -48,9 +48,9 @@
     }
 
     public void testInlineScriptMediatorSerializationSenarioOne() throws XMLComparisonException {
-        String inputXml = "<script.js xmlns=\"http://ws.apache.org/ns/synapse\" " +
-                "> <![CDATA[var symbol = mc.getPayloadXML()..*::Code.toString();mc.setPayloadXML(<m:getQuote xmlns:m=\"http://services.samples/xsd\">\n" +
-                "<m:request><m:symbol>{symbol}</m:symbol></m:request></m:getQuote>);]]></script.js> ";
+        String inputXml = "<syn:script.js xmlns:syn=\"http://ws.apache.org/ns/synapse\" " +
+                "><![CDATA[nvar symbol = mc.getPayloadXML()..*::Code.toString();mc.setPayloadXML(<m:getQuote xmlns:m=\"http://services.samples/xsd\">\n" +
+                "<m:request><m:symbol>{symbol}</m:symbol></m:request></m:getQuote>);]]></syn:script.js> ";
         assertTrue(serialization(inputXml, mediatorFactory, inlineScriptMediatorSerializer));
         assertTrue(serialization(inputXml, inlineScriptMediatorSerializer));
     }

Modified: webservices/synapse/trunk/java/pom.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/pom.xml?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/pom.xml (original)
+++ webservices/synapse/trunk/java/pom.xml Mon Mar 12 05:16:01 2007
@@ -431,6 +431,13 @@
             <artifactId>jakarta-httpcore-niossl</artifactId>
             <version>${jakarta.httpcore.nio.version}</version>
         </dependency>
+        <!-- Xml Unit Test -->
+        <dependency>
+            <groupId>xmlunit</groupId>
+            <artifactId>xmlunit</artifactId>
+            <version>${xmlunit.version}</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <reporting>
@@ -655,7 +662,8 @@
         <junit.version>3.8.2</junit.version>
         <log4j.version>1.2.13</log4j.version>
         <wso2commons.version>1.2-SNAPSHOT</wso2commons.version>
-                
+        <xmlunit.version>1.0</xmlunit.version>
+
     </properties>
 
     <developers>

Added: webservices/synapse/trunk/java/repository/conf/sample/resources/policy/throttle_policy.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/resources/policy/throttle_policy.xml?view=auto&rev=517189
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/resources/policy/throttle_policy.xml (added)
+++ webservices/synapse/trunk/java/repository/conf/sample/resources/policy/throttle_policy.xml Mon Mar 12 05:16:01 2007
@@ -0,0 +1,49 @@
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+            xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle">
+    <throttle:ThrottleAssertion>
+        <wsp:All>
+            <throttle:ID throttle:type="IP">Other</throttle:ID>
+            <wsp:ExactlyOne>
+                <wsp:All>
+                    <throttle:MaximumCount>4</throttle:MaximumCount>
+                    <throttle:UnitTime>800000</throttle:UnitTime>
+                    <throttle:ProhibitTimePeriod wsp:Optional="true">10000</throttle:ProhibitTimePeriod>
+                </wsp:All>
+                <throttle:IsAllow>true</throttle:IsAllow>
+            </wsp:ExactlyOne>
+        </wsp:All>
+        <wsp:All>
+            <throttle:ID throttle:type="IP">192.168.8.200-192.168.8.222</throttle:ID>
+            <wsp:ExactlyOne>
+                <wsp:All>
+                    <throttle:MaximumCount>8</throttle:MaximumCount>
+                    <throttle:UnitTime>800000</throttle:UnitTime>
+                    <throttle:ProhibitTimePeriod wsp:Optional="true">10</throttle:ProhibitTimePeriod>
+                </wsp:All>
+                <throttle:IsAllow>true</throttle:IsAllow>
+            </wsp:ExactlyOne>
+        </wsp:All>
+        <wsp:All>
+            <throttle:ID throttle:type="IP">192.168.8.201</throttle:ID>
+            <wsp:ExactlyOne>
+                <wsp:All>
+                    <throttle:MaximumCount>200</throttle:MaximumCount>
+                    <throttle:UnitTime>600000</throttle:UnitTime>
+                    <throttle:ProhibitTimePeriod wsp:Optional="true"></throttle:ProhibitTimePeriod>
+                </wsp:All>
+                <throttle:IsAllow>true</throttle:IsAllow>
+            </wsp:ExactlyOne>
+        </wsp:All>
+        <wsp:All>
+            <throttle:ID throttle:type="IP">192.168.8.198</throttle:ID>
+            <wsp:ExactlyOne>
+                <wsp:All>
+                    <throttle:MaximumCount>50</throttle:MaximumCount>
+                    <throttle:UnitTime>500000</throttle:UnitTime>
+                    <throttle:ProhibitTimePeriod wsp:Optional="true"></throttle:ProhibitTimePeriod>
+                </wsp:All>
+                <throttle:IsAllow>true</throttle:IsAllow>
+            </wsp:ExactlyOne>
+        </wsp:All>
+    </throttle:ThrottleAssertion>
+</wsp:Policy>
\ No newline at end of file

Modified: webservices/synapse/trunk/java/repository/conf/sample/resources/spring/synapse_spring_unittest.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/resources/spring/synapse_spring_unittest.xml?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/resources/spring/synapse_spring_unittest.xml (original)
+++ webservices/synapse/trunk/java/repository/conf/sample/resources/spring/synapse_spring_unittest.xml Mon Mar 12 05:16:01 2007
@@ -20,8 +20,8 @@
 <synapse xmlns="http://ws.apache.org/ns/synapse" xmlns:spring="http://ws.apache.org/ns/synapse/spring">
 
 	<registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
-		<parameter name="root" value="file:./../../repository/"/>
-		<parameter name="cachableDuration" value="15000"/>
+		<parameter name="root">file:./../../repository/</parameter>
+		<parameter name="cachableDuration">15000</parameter>
 	</registry>
   
     <localEntry key="springconfig2" src="file:./../../repository/conf/sample/resources/spring/springsample.xml"/>

Modified: webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml (original)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_10.xml Mon Mar 12 05:16:01 2007
@@ -23,9 +23,9 @@
 
     <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
         <!-- the root property of the simple URL registry helps resolve a resource URL as root + key -->
-        <property name="root" value="file:repository/conf/sample/resources/"/>
-        <!-- all resources loaded from the URL registry would be cached for this number of milli seconds -->
-        <property name="cachableDuration" value="15000"/>
+        <parameter name="root">file:./../../repository/</parameter>
+		        <!-- all resources loaded from the URL registry would be cached for this number of milli seconds -->
+        <parameter name="cachableDuration">15000</parameter>
     </registry>
 
     <definitions>

Modified: webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_11.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_11.xml?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_11.xml (original)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_11.xml Mon Mar 12 05:16:01 2007
@@ -23,9 +23,10 @@
 
     <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
         <!-- the root property of the simple URL registry helps resolve a resource URL as root + key -->
-        <property name="root" value="file:repository/conf/sample/resources/"/>
+        <parameter name="root">file:./../../repository/</parameter>
         <!-- all resources loaded from the URL registry would be cached for this number of milli seconds -->
-        <property name="cachableDuration" value="15000"/>
+        <parameter name="cachableDuration">15000</parameter>
     </registry>
+
 
 </synapse> 

Added: webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_400.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_400.xml?view=auto&rev=517189
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_400.xml (added)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_400.xml Mon Mar 12 05:16:01 2007
@@ -0,0 +1,87 @@
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+<definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:throttle="http://ws.apache.org/ns/synapse/throttle">
+    <sequence name="main">
+        <in>
+            <throttle:throttle>
+                <policy>
+                    <!-- define throttle policy -->
+                    <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+                                xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle">
+                        <throttle:ThrottleAssertion>
+                            <wsp:All>
+                                <throttle:ID throttle:type="IP">Other</throttle:ID>
+                                <wsp:ExactlyOne>
+                                    <wsp:All>
+                                        <throttle:MaximumCount>4</throttle:MaximumCount>
+                                        <throttle:UnitTime>800000</throttle:UnitTime>
+                                        <throttle:ProhibitTimePeriod wsp:Optional="true">10000</throttle:ProhibitTimePeriod>
+                                    </wsp:All>
+                                    <throttle:IsAllow>true</throttle:IsAllow>
+                                </wsp:ExactlyOne>
+                            </wsp:All>
+                            <wsp:All>
+                                <throttle:ID throttle:type="IP">192.168.8.200-192.168.8.222</throttle:ID>
+                                <wsp:ExactlyOne>
+                                    <wsp:All>
+                                        <throttle:MaximumCount>8</throttle:MaximumCount>
+                                        <throttle:UnitTime>800000</throttle:UnitTime>
+                                        <throttle:ProhibitTimePeriod wsp:Optional="true">10</throttle:ProhibitTimePeriod>
+                                    </wsp:All>
+                                    <throttle:IsAllow>true</throttle:IsAllow>
+                                </wsp:ExactlyOne>
+                            </wsp:All>
+                            <wsp:All>
+                                <throttle:ID throttle:type="IP">192.168.8.201</throttle:ID>
+                                <wsp:ExactlyOne>
+                                    <wsp:All>
+                                        <throttle:MaximumCount>200</throttle:MaximumCount>
+                                        <throttle:UnitTime>600000</throttle:UnitTime>
+                                        <throttle:ProhibitTimePeriod wsp:Optional="true"></throttle:ProhibitTimePeriod>
+                                    </wsp:All>
+                                    <throttle:IsAllow>true</throttle:IsAllow>
+                                </wsp:ExactlyOne>
+                            </wsp:All>
+                            <wsp:All>
+                                <throttle:ID throttle:type="IP">192.168.8.198</throttle:ID>
+                                <wsp:ExactlyOne>
+                                    <wsp:All>
+                                        <throttle:MaximumCount>50</throttle:MaximumCount>
+                                        <throttle:UnitTime>500000</throttle:UnitTime>
+                                        <throttle:ProhibitTimePeriod wsp:Optional="true"></throttle:ProhibitTimePeriod>
+                                    </wsp:All>
+                                    <throttle:IsAllow>true</throttle:IsAllow>
+                                </wsp:ExactlyOne>
+                            </wsp:All>
+                        </throttle:ThrottleAssertion>
+                    </wsp:Policy>
+                </policy>
+            </throttle:throttle>
+            <send>
+                <endpoint>
+                    <address uri="http://localhost:8082/axis2/services/SimpleStockQuoteService"/>
+                </endpoint>
+            </send>
+        </in>
+        <out>
+            <send/>
+        </out>
+    </sequence>
+</definitions>

Added: webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_401.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_401.xml?view=auto&rev=517189
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_401.xml (added)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_401.xml Mon Mar 12 05:16:01 2007
@@ -0,0 +1,47 @@
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+<definitions xmlns="http://ws.apache.org/ns/synapse"
+             xmlns:throttle="http://ws.apache.org/ns/synapse/throttle">
+    <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
+        <!-- the root property of the simple URL registry helps resolve a resource URL as root + key -->
+        <parameter name="root">file:./../../repository/</parameter>
+        <!-- all resources loaded from the URL registry would be cached for this number of milli seconds -->
+        <parameter name="cachableDuration">15000</parameter>
+    </registry>
+
+
+    <localEntry key="thottlePolicy"
+                src="file:./repository/conf/sample/resources/policy/throttle_policy.xml"/>
+
+    <sequence name="main">
+        <in>
+            <throttle:throttle>
+                <policy key="thottlePolicy"/>
+            </throttle:throttle>
+            <send>
+                <endpoint>
+                    <address uri="http://localhost:8082/axis2/services/SimpleStockQuoteService"/>
+                </endpoint>
+            </send>
+        </in>
+        <out>
+            <send/>
+        </out>
+    </sequence>
+</definitions>

Modified: webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_503.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_503.xml?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_503.xml (original)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_503.xml Mon Mar 12 05:16:01 2007
@@ -17,30 +17,23 @@
   ~  under the License.
   -->
 
-<synapse xmlns="http://ws.apache.org/ns/synapse">
-
-    <!-- Introduction to the script mediator with Ruby scripts-->
-
-    <definitions>
-
-        <!-- define a static property for the JRuby source code file -->
-        <set-property name="stockquoteScript" src="file:repository/conf/sample/resources/script/stockquoteTransform.rb"/>
-
-        <!-- define a reuseable endpoint definition and use it within config -->
-        <endpoint name="stockquote">
-            <address uri="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
-        </endpoint>
-
-    </definitions>
-
-    <rules>
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+    <!-- define a static property for the JRuby source code file -->
+    <localEntry name="stockquoteScript"
+                src="file:repository/conf/sample/resources/script/stockquoteTransform.rb"/>
+
+    <!-- define a reuseable endpoint definition and use it within config -->
+    <endpoint name="stockquote">
+        <address uri="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
+    </endpoint>
+    <sequence name="main">
         <in>
             <!-- transform the custom quote request into a standard quote request expected by the service -->
             <script key="stockquoteScript" function="transformRequest"/>
 
             <!-- send message to real endpoint referenced by name "stockquote" and stop -->
             <send>
-                <endpoint ref="stockquote"/>
+                <endpoint key="stockquote"/>
             </send>
         </in>
 
@@ -51,6 +44,6 @@
             <!-- now send the custom response back to the client and stop -->
             <send/>
         </out>
-    </rules>
+    </sequence>
 
-</synapse> 
\ No newline at end of file
+</definitions>
\ No newline at end of file

Modified: webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_8.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_8.xml?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_8.xml (original)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_8.xml Mon Mar 12 05:16:01 2007
@@ -25,10 +25,11 @@
     <!-- file system (file://) or a web server (http://) -->
     <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
         <!-- the root property of the simple URL registry helps resolve a resource URL as root + key -->
-        <property name="root" value="file:repository/conf/sample/resources/"/>
+        <parameter name="root">file:./../../repository/</parameter>
         <!-- all resources loaded from the URL registry would be cached for this number of milli seconds -->
-        <property name="cachableDuration" value="15000"/>
+        <parameter name="cachableDuration">15000</parameter>
     </registry>
+
 
     <definitions>
 

Modified: webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_9.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_9.xml?view=diff&rev=517189&r1=517188&r2=517189
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_9.xml (original)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_9.xml Mon Mar 12 05:16:01 2007
@@ -23,11 +23,10 @@
 
     <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
         <!-- the root property of the simple URL registry helps resolve a resource URL as root + key -->
-        <property name="root" value="file:repository/conf/sample/resources/"/>
+        <parameter name="root">file:./../../repository/</parameter>
         <!-- all resources loaded from the URL registry would be cached for this number of milli seconds -->
-        <property name="cachableDuration" value="15000"/>
+        <parameter name="cachableDuration">15000</parameter>
     </registry>
-
     <definitions>
         <sequence name="dynamic_sequence" key="sequence/dynamic_seq_1.xml"/>
     </definitions>



---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org