axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r529468 - /webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/configuration/ConfigurationManagerTestCase.java
Date Tue, 17 Apr 2007 01:58:49 GMT
Author: dims
Date: Mon Apr 16 18:58:49 2007
New Revision: 529468

URL: http://svn.apache.org/viewvc?view=rev&rev=529468
Log:
serialize policy before calling applyPolicy

Modified:
    webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/configuration/ConfigurationManagerTestCase.java

Modified: webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/configuration/ConfigurationManagerTestCase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/configuration/ConfigurationManagerTestCase.java?view=diff&rev=529468&r1=529467&r2=529468
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/configuration/ConfigurationManagerTestCase.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/configuration/ConfigurationManagerTestCase.java
Mon Apr 16 18:58:49 2007
@@ -17,6 +17,8 @@
 package org.apache.axis2.clustering.configuration;
 
 import java.util.List;
+import java.io.ByteArrayOutputStream;
+import java.io.StringWriter;
 
 import org.apache.axis2.cluster.ClusteringFault;
 import org.apache.axis2.cluster.configuration.ConfigurationEvent;
@@ -25,6 +27,10 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.neethi.Policy;
 
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+
 
 public abstract class ConfigurationManagerTestCase extends ClusterManagerTestCase {
 
@@ -73,7 +79,7 @@
 		assertEquals(event.getServiceGroupNames(), serviceGroupName);
     }
     
-    public void testApplyPolicy () throws ClusteringFault {
+    public void testApplyPolicy () throws ClusteringFault, XMLStreamException {
     	
     	configurationManagerListener2.clearEventList();
     	
@@ -82,8 +88,15 @@
     	
     	Policy policy = new Policy ();
     	policy.setId(policyID);
-    	
-    	clusterManager1.getConfigurationManager().applyPolicy (serviceGroupName,policy);
+
+        StringWriter writer = new StringWriter();
+        XMLStreamWriter xmlStreamWriter = XMLOutputFactory.newInstance()
+                .createXMLStreamWriter(writer);
+
+        policy.serialize(xmlStreamWriter);
+        xmlStreamWriter.flush();
+        
+        clusterManager1.getConfigurationManager().applyPolicy (serviceGroupName,writer.toString());
     	
     	try {
 			Thread.sleep(3000);



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


Mime
View raw message