qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agazzar...@apache.org
Subject svn commit: r744885 - in /qpid/trunk/qpid/java/management/client/src: main/java/ main/java/org/apache/qpid/management/wsdm/capabilities/ main/java/wsdl/ test/java/org/apache/qpid/management/wsdm/
Date Mon, 16 Feb 2009 10:40:41 GMT
Author: agazzarini
Date: Mon Feb 16 10:40:39 2009
New Revision: 744885

URL: http://svn.apache.org/viewvc?rev=744885&view=rev
Log:
QPID-1604 : Implementation of wrsf-rp:PutResourcePropertyDocument interface

Modified:
    qpid/trunk/qpid/java/management/client/src/main/java/muse.xml
    qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/capabilities/WsdlBuilder.java
    qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManAdapter.rmd
    qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManAdapter.wsdl
    qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.rmd
    qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.wsdl
    qpid/trunk/qpid/java/management/client/src/test/java/org/apache/qpid/management/wsdm/WsDmAdapterTest.java

Modified: qpid/trunk/qpid/java/management/client/src/main/java/muse.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/muse.xml?rev=744885&r1=744884&r2=744885&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/muse.xml (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/muse.xml Mon Feb 16 10:40:39 2009
@@ -144,14 +144,6 @@
 			<java-capability-class>org.apache.qpid.management.wsdm.capabilities.QManMetadataExchangeCapability</java-capability-class>
 		</capability>
 		<capability>
-			<capability-uri>http://docs.oasis-open.org/wsrf/rlw-2/ImmediateResourceTermination</capability-uri>
-			<java-capability-class>org.apache.muse.ws.resource.lifetime.impl.SimpleImmediateTermination</java-capability-class>
-		</capability>
-		<capability>
-			<capability-uri>http://docs.oasis-open.org/wsrf/rlw-2/ScheduledResourceTermination</capability-uri>
-			<java-capability-class>org.apache.muse.ws.resource.lifetime.impl.SimpleScheduledTermination</java-capability-class>
-		</capability>
-		<capability>
 			<capability-uri>http://docs.oasis-open.org/wsrf/rpw-2/Get</capability-uri>
 			<java-capability-class>org.apache.muse.ws.resource.properties.get.impl.SimpleGetCapability</java-capability-class>
 		</capability>
@@ -163,6 +155,10 @@
 			<capability-uri>http://docs.oasis-open.org/wsrf/rpw-2/Set</capability-uri>
 			<java-capability-class>org.apache.muse.ws.resource.properties.set.impl.SimpleSetCapability</java-capability-class>
 		</capability>
+		<capability>
+			<capability-uri>http://docs.oasis-open.org/wsrf/rpw-2/Put</capability-uri>
+			<java-capability-class>org.apache.muse.ws.resource.properties.set.impl.SimpleSetCapability</java-capability-class>
+		</capability>
 	</resource-type>
 	<resource-type>
 		<context-path>ServiceGroupEntry</context-path>

Modified: qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/capabilities/WsdlBuilder.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/capabilities/WsdlBuilder.java?rev=744885&r1=744884&r2=744885&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/capabilities/WsdlBuilder.java
(original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/org/apache/qpid/management/wsdm/capabilities/WsdlBuilder.java
Mon Feb 16 10:40:39 2009
@@ -96,7 +96,7 @@
 			propertyRef.setAttribute(
 					"ref", 
 					Names.PREFIX+":"+attributeMetadata.getName());
-			
+			propertyRef.setAttribute("minOccurs", "0");		
 			wsrpProperties.appendChild(propertyRef);
 			
 		} catch(Exception exception)
@@ -197,6 +197,7 @@
 			Element propertyDeclaration = XmlUtils.createElement(_document, XSD_ELEMENT_QNAME);
 			propertyDeclaration.setAttribute("name",attributeName);
 			propertyDeclaration.setAttribute("type", serializer.getXmlType(Class.forName(type)));
+				
 			return propertyDeclaration;
 		}			
 	}

Modified: qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManAdapter.rmd
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManAdapter.rmd?rev=744885&r1=744884&r2=744885&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManAdapter.rmd (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManAdapter.rmd Mon Feb 16 10:40:39
2009
@@ -4,7 +4,6 @@
 		xmlns:wsrf-sg="http://docs.oasis-open.org/wsrf/sg-2"
 		xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
 		xmlns:wsrl="http://docs.oasis-open.org/wsrf/rl-2" 	
-		xmlns:myns="http://ws.apache.org/muse/test/wsrf" 
 	    xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" 
 	    xmlns:wst="http://docs.oasis-open.org/wsn/t-1" 
 	    xmlns:muws1="http://docs.oasis-open.org/wsdm/muws1-2.xsd" 
@@ -20,33 +19,9 @@
 		</Property>
 		<Property name="wsrf-sg:Entry" modifiability="read-only" mutability="mutable" />
 		<Property name="wsrf-rp:QueryExpressionDialect" modifiability="read-only" mutability="constant"
/>
-
-<!--
-		<Property name="wsrl:CurrentTime" modifiability="read-only" mutability="mutable" />
-		
-		<Property name="wsrl:TerminationTime" modifiability="read-only" mutability="mutable"
/>
--->		
 		<Property name="wsnt:FixedTopicSet" modifiability="read-only" mutability="constant"
/>
-		
 		<Property name="wst:TopicSet" modifiability="read-only" mutability="mutable" />
-		
 		<Property name="wsnt:TopicExpression" modifiability="read-only" mutability="mutable"
/>
-		
 		<Property name="wsnt:TopicExpressionDialect" modifiability="read-only" mutability="mutable"
/>
-<!--		
-		<Property name="muws1:ResourceId" modifiability="read-only" mutability="constant" />
-		
-		<Property name="muws1:ManageabilityCapability" modifiability="read-only" mutability="constant"
/>
-		
-		<Property name="muws2:Caption" modifiability="read-only" mutability="mutable" />
-		
-		<Property name="muws2:Description" modifiability="read-only" mutability="mutable" />
-		
-		<Property name="muws2:Version" modifiability="read-only" mutability="constant" />
-		
-		<Property name="myns:ServerName" modifiability="read-only" mutability="constant"/>
-		
-		<Property name="myns:MessageInterval" modifiability="read-write" mutability="mutable"/>
--->		
 	</MetadataDescriptor>
 </Definitions>

Modified: qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManAdapter.wsdl
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManAdapter.wsdl?rev=744885&r1=744884&r2=744885&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManAdapter.wsdl (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManAdapter.wsdl Mon Feb 16
10:40:39 2009
@@ -61,32 +61,13 @@
 			<xsd:element name="WsDmAdapterResourceProperties">
 				<xsd:complexType>
 					<xsd:sequence>
-
-<!-- 
-						<xsd:element ref="wsrf-rl:CurrentTime" />
-						<xsd:element ref="wsrf-rl:TerminationTime" />
--->	
 						<xsd:element ref="wsrf-sg:Entry"/>
 						<xsd:element ref="wsrf-sg:MembershipContentRule"/>
-						<xsd:element
-							ref="wsrf-rp:QueryExpressionDialect" minOccurs="0"
-							maxOccurs="unbounded" />
-						
+						<xsd:element ref="wsrf-rp:QueryExpressionDialect" minOccurs="0" maxOccurs="unbounded"
/>
 						<xsd:element ref="wsnt:FixedTopicSet" />
 						<xsd:element ref="wst:TopicSet" minOccurs="0" />
 						<xsd:element ref="wsnt:TopicExpression" minOccurs="0" maxOccurs="unbounded" />
 						<xsd:element ref="wsnt:TopicExpressionDialect" minOccurs="0" maxOccurs="unbounded"
/>
-<!-- 
-						<xsd:element ref="muws1:ResourceId" />
-						<xsd:element ref="muws1:ManageabilityCapability"
-							minOccurs="0" maxOccurs="unbounded" />
-						<xsd:element ref="muws2:Caption" minOccurs="0"
-							maxOccurs="unbounded" />
-						<xsd:element ref="muws2:Description"
-							minOccurs="0" maxOccurs="unbounded" />
-						<xsd:element ref="muws2:Version" minOccurs="0" />
-						<xsd:element ref="muws2:OperationalStatus" />
--->						
 					</xsd:sequence>
 				</xsd:complexType>
 			</xsd:element>

Modified: qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.rmd
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.rmd?rev=744885&r1=744884&r2=744885&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.rmd (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.rmd Mon Feb 16
10:40:39 2009
@@ -1,13 +1,17 @@
 <?xml version="1.0"?>
 <Definitions xmlns="http://docs.oasis-open.org/wsrf/rmd-1" >
 	<MetadataDescriptor 
-						xmlns:wsrl="http://docs.oasis-open.org/wsrf/rl-2" 
-                        xmlns:qman="http://amqp.apache.org/qpid/management/qman" 
+						xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
+						xmlns:wsrl="http://docs.oasis-open.org/wsrf/rl-2" 	
+					    xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" 
+					    xmlns:wst="http://docs.oasis-open.org/wsn/t-1" 
+					    xmlns:muws1="http://docs.oasis-open.org/wsdm/muws1-2.xsd" 
+					    xmlns:muws2="http://docs.oasis-open.org/wsdm/muws2-2.xsd"
+						xmlns:qman="http://amqp.apache.org/qpid/management/qman"                        
                         name="QManWsResourceMetadata" 
 	                    interface="qman:QManWsResourcePortType" 
 	                    wsdlLocation="http://ws.apache.org/muse/test/wsrf QManWsResource.wsdl"
>
-		<Property name="wsrl:CurrentTime" modifiability="read-only" mutability="mutable" />
-		<Property name="wsrl:TerminationTime" modifiability="read-only" mutability="mutable"
/>
+		<Property name="wsrf-rp:QueryExpressionDialect" modifiability="read-only" mutability="constant"
/>
 	</MetadataDescriptor>
 	
 </Definitions>
\ No newline at end of file

Modified: qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.wsdl
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.wsdl?rev=744885&r1=744884&r2=744885&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.wsdl (original)
+++ qpid/trunk/qpid/java/management/client/src/main/java/wsdl/QManWsResource.wsdl Mon Feb
16 10:40:39 2009
@@ -54,9 +54,7 @@
 			<xsd:element name="QManWsResourceProperties">
 				<xsd:complexType>
 					<xsd:sequence>
-						<xsd:element ref="wsrf-rl:CurrentTime" />
-						<xsd:element ref="wsrf-rl:TerminationTime" />
-						<xsd:element ref="wsrf-rp:QueryExpressionDialect" minOccurs="0" maxOccurs="unbounded"/>
+						<xsd:element ref="wsrf-rp:QueryExpressionDialect" minOccurs="0" maxOccurs="unbounded"
/>
 					</xsd:sequence>
 				</xsd:complexType>
 			</xsd:element>
@@ -118,17 +116,14 @@
 	<wsdl:message name="ResourceUnavailableFault">
 		<wsdl:part name="ResourceUnavailableFault" element="wsrf-r:ResourceUnavailableFault"
/>
 	</wsdl:message>
-	<wsdl:message name="SetTerminationTimeRequest">
-		<wsdl:part name="SetTerminationTimeRequest" element="wsrf-rl:SetTerminationTime" />
+	<wsdl:message name="UnableToPutResourcePropertyDocumentFault">
+		<wsdl:part name="UnableToPutResourcePropertyDocumentFault" element="wsrf-rp:UnableToPutResourcePropertyDocumentFault"
/>
 	</wsdl:message>
-	<wsdl:message name="SetTerminationTimeResponse">
-		<wsdl:part name="SetTerminationTimeResponse" element="wsrf-rl:SetTerminationTimeResponse"
/>
+	<wsdl:message name="PutResourcePropertyDocumentRequest">
+		<wsdl:part name="PutResourcePropertyDocumentRequest" element="wsrf-rp:PutResourcePropertyDocument"/>
 	</wsdl:message>
-	<wsdl:message name="UnableToSetTerminationTimeFault">
-		<wsdl:part name="UnableToSetTerminationTimeFault" element="wsrf-rl:UnableToSetTerminationTimeFault"
/>
-	</wsdl:message>
-	<wsdl:message name="TerminationTimeChangeRejectedFault">
-		<wsdl:part name="TerminationTimeChangeRejectedFault" element="wsrf-rl:TerminationTimeChangeRejectedFault"
/>
+	<wsdl:message name="PutResourcePropertyDocumentResponse">
+		<wsdl:part name="PutResourcePropertyDocumentResponse" element="wsrf-rp:PutResourcePropertyDocumentResponse"/>
 	</wsdl:message>
 	<wsdl:message name="GetResourcePropertyDocumentRequest">
 		<wsdl:part name="GetResourcePropertyDocumentRequest" element="wsrf-rp:GetResourcePropertyDocument"/>
@@ -196,33 +191,6 @@
 				name="GetMetadataResponseMsg" 
 				message="qman:GetMetadataResponseMsg"/>
 		</wsdl:operation>
-		<wsdl:operation name="Destroy">
-			<wsdl:input 
-				wsa:Action="http://docs.oasis-open.org/wsrf/rlw-2/ImmediateResourceTermination/DestroyRequest"

-			    name="DestroyRequest" 
-			    message="qman:DestroyRequest" />
-			<wsdl:output 
-				wsa:Action="http://docs.oasis-open.org/wsrf/rlw-2/ImmediateResourceTermination/DestroyResponse"

-				name="DestroyResponse" 
-				message="qman:DestroyResponse" />
-			<wsdl:fault name="ResourceNotDestroyedFault" message="qman:ResourceNotDestroyedFault"
/>
-			<wsdl:fault name="ResourceUnknownFault" message="qman:ResourceUnknownFault" />
-			<wsdl:fault name="ResourceUnavailableFault" message="qman:ResourceUnavailableFault"/>
-		</wsdl:operation>
-		<wsdl:operation name="SetTerminationTime">
-			<wsdl:input 
-				wsa:Action="http://docs.oasis-open.org/wsrf/rlw-2/ScheduledResourceTermination/SetTerminationTimeRequest"

-			    name="SetTerminationTimeRequest" 
-			    message="qman:SetTerminationTimeRequest" />
-			<wsdl:output 
-				wsa:Action="http://docs.oasis-open.org/wsrf/rlw-2/ScheduledResourceTermination/SetTerminationTimeResponse"

-			    name="SetTerminationTimeResponse" 
-			    message="qman:SetTerminationTimeResponse" />
-			<wsdl:fault name="UnableToSetTerminationTimeFault" message="qman:UnableToSetTerminationTimeFault"
/>
-			<wsdl:fault name="ResourceUnknownFault" message="qman:ResourceUnknownFault" />
-			<wsdl:fault name="ResourceUnavailableFault" message="qman:ResourceUnavailableFault"/>
-			<wsdl:fault name="TerminationTimeChangeRejectedFault" message="qman:TerminationTimeChangeRejectedFault"
/>
-		</wsdl:operation>
 		<wsdl:operation name="GetResourcePropertyDocument">
 			<wsdl:input 
 				wsa:Action="http://docs.oasis-open.org/wsrf/rpw-2/GetResourcePropertyDocument/GetResourcePropertyDocumentRequest"

@@ -235,6 +203,19 @@
 			<wsdl:fault name="ResourceUnknownFault" message="qman:ResourceUnknownFault"/>
 			<wsdl:fault name="ResourceUnavailableFault" message="qman:ResourceUnavailableFault"/>
 		</wsdl:operation>
+			<wsdl:operation name="PutResourcePropertyDocument">
+			<wsdl:input 
+				wsa:Action="http://docs.oasis-open.org/wsrf/rpw-2/PutResourcePropertyDocument/PutResourcePropertyDocumentRequest"

+			    name="PutResourcePropertyDocumentRequest" 
+			    message="qman:PutResourcePropertyDocumentRequest"/>
+			<wsdl:output 
+				wsa:Action="http://docs.oasis-open.org/wsrf/rpw-2/PutResourcePropertyDocument/PutResourcePropertyDocumentResponse"

+				name="PutResourcePropertyDocumentResponse" 
+				message="qman:PutResourcePropertyDocumentResponse"/>
+			<wsdl:fault name="ResourceUnknownFault" message="qman:ResourceUnknownFault"/>
+			<wsdl:fault name="ResourceUnavailableFault" message="qman:ResourceUnavailableFault"/>
+			<wsdl:fault name="UnableToPutResourcePropertyDocumentFault" message="qman:UnableToPutResourcePropertyDocumentFault"/>
+		</wsdl:operation>
 		<wsdl:operation name="GetResourceProperty">
 			<wsdl:input 
 				wsa:Action="http://docs.oasis-open.org/wsrf/rpw-2/GetResourceProperty/GetResourcePropertyRequest"

@@ -308,50 +289,18 @@
 					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
 			</wsdl:output>
 		</wsdl:operation>
-        <wsdl:operation name="Destroy">
-        	<wsdl-soap:operation soapAction="Destroy"/>
-        	<wsdl:input name="DestroyRequest">
+        <wsdl:operation name="PutResourcePropertyDocument">
+        	<wsdl-soap:operation soapAction="PutResourcePropertyDocument"/>
+        	<wsdl:input name="PutResourcePropertyDocumentRequest">
         		<wsdl-soap:body 
         			use="literal"
 					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
         	</wsdl:input>
-        	<wsdl:output name="DestroyResponse">
-        		<wsdl-soap:body 
-        			use="literal"
-					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
-        	</wsdl:output>
-        	<wsdl:fault name="ResourceNotDestroyedFault">
-        		<wsdl-soap:fault 
-        			use="literal" 
-        			name="ResourceNotDestroyedFault"/>
-        	</wsdl:fault>
-        	<wsdl:fault name="ResourceUnknownFault">
-        		<wsdl-soap:fault 
-        			use="literal" 
-        			name="ResourceUnknownFault"/>
-        	</wsdl:fault>
-        	<wsdl:fault name="ResourceUnavailableFault">
-        		<wsdl-soap:fault 
-        			use="literal" 
-        			name="ResourceUnavailableFault"/>
-        	</wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="SetTerminationTime">
-        	<wsdl-soap:operation soapAction="SetTerminationTime"/>
-        	<wsdl:input name="SetTerminationTimeRequest">
-        		<wsdl-soap:body 
-        			use="literal"
-					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
-        	</wsdl:input><wsdl:output name="SetTerminationTimeResponse">
+        		<wsdl:output name="PutResourcePropertyDocumentResponse">
         		<wsdl-soap:body 
         			use="literal" 
 					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
         	</wsdl:output>
-        	<wsdl:fault name="UnableToSetTerminationTimeFault">
-        		<wsdl-soap:fault 
-        			use="literal" 
-        			name="UnableToSetTerminationTimeFault"/>
-        	</wsdl:fault>
         	<wsdl:fault name="ResourceUnknownFault">
         		<wsdl-soap:fault 
         			use="literal" 
@@ -362,10 +311,10 @@
         			use="literal" 
         			name="ResourceUnavailableFault"/>
         	</wsdl:fault>
-        	<wsdl:fault name="TerminationTimeChangeRejectedFault">
+        	<wsdl:fault name="UnableToPutResourcePropertyDocumentFault">
         		<wsdl-soap:fault 
         			use="literal" 
-        			name="TerminationTimeChangeRejectedFault"/>
+        			name="UnableToPutResourcePropertyDocumentFault"/>
         	</wsdl:fault>
         </wsdl:operation>
         <wsdl:operation name="GetResourcePropertyDocument">
@@ -523,16 +472,6 @@
         			name="SetResourcePropertyRequestFailedFault"/>
         	</wsdl:fault>
         </wsdl:operation>
-        <wsdl:operation name="GetMetadata">
-        	<wsdl-soap:operation
-        		soapAction="http://ws.apache.org/muse/test/wsrf/GetMetadata" />
-        	<wsdl:input name="GetMetadataMsg">
-        		<wsdl-soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
-        	</wsdl:input>
-        	<wsdl:output name="GetMetadataResponseMsg">
-        		<wsdl-soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
-        	</wsdl:output>
-        </wsdl:operation>
 	</wsdl:binding>
 	<wsdl:service name="QManWsResourceService">
     	<wsdl:port name="QManWsResourcePort" binding="qman:QManWsResourceBinding">

Modified: qpid/trunk/qpid/java/management/client/src/test/java/org/apache/qpid/management/wsdm/WsDmAdapterTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/client/src/test/java/org/apache/qpid/management/wsdm/WsDmAdapterTest.java?rev=744885&r1=744884&r2=744885&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/client/src/test/java/org/apache/qpid/management/wsdm/WsDmAdapterTest.java
(original)
+++ qpid/trunk/qpid/java/management/client/src/test/java/org/apache/qpid/management/wsdm/WsDmAdapterTest.java
Mon Feb 16 10:40:39 2009
@@ -46,6 +46,7 @@
 import org.apache.muse.core.proxy.ProxyHandler;
 import org.apache.muse.core.proxy.ReflectionProxyHandler;
 import org.apache.muse.core.serializer.SerializerRegistry;
+import org.apache.muse.util.xml.XmlUtils;
 import org.apache.muse.ws.addressing.EndpointReference;
 import org.apache.muse.ws.addressing.soap.SoapFault;
 import org.apache.muse.ws.resource.remote.WsResourceClient;
@@ -366,27 +367,75 @@
 			
 		}
 	}
+
+	/**
+	 * Tests the WS-RP PutResourcePropertyDocument interface of the WS-DM adapter.
+	 * 
+	 * <br>precondition : a ws resource exists and is registered. 
+	 * <br>postcondition : A read / write property is correctly set according to WSRP
interface.
+	 */
+	public void testGetAndPutResourcePropertyDocumentOK() throws Exception
+	{	
+		String expectedMgmtPubIntervalValue = "4321";
+		String propertyName = "MgmtPubInterval";
+		
+		Element propertiesDocument = _resourceClient.getResourcePropertyDocument();
+		Element [] properties = XmlUtils.getAllElements(propertiesDocument);
+		
+		for (Element element : properties)
+		{
+			if (propertyName.equals(element.getLocalName())) {
+				element.setTextContent(expectedMgmtPubIntervalValue);
+			} else {
+				propertiesDocument.removeChild(element);
+			}
+		}
+		
+		_resourceClient.putResourcePropertyDocument(propertiesDocument);
+		
+		Element newProperties = _resourceClient.getResourcePropertyDocument();
+		
+		Element mgmtPubInterval = XmlUtils.getElement(
+				newProperties, new QName(
+						Names.NAMESPACE_URI,
+						propertyName,
+						Names.PREFIX));
+
+		assertEquals(expectedMgmtPubIntervalValue,mgmtPubInterval.getTextContent());		
+	}
 	
-//	public void testGetAndPutResourcePropertyDocumentOK() throws Exception
-//	{	
-//		Element properties = _resourceClient.getResourcePropertyDocument();
-//		
-//		Element mgmtPubInterval = XmlUtils.getElement(properties, new QName(Names.NAMESPACE_URI,"MgmtPubInterval",Names.PREFIX));
-//		mgmtPubInterval.setTextContent(String.valueOf(Long.MAX_VALUE));
-//		
-//		Element durable = XmlUtils.getElement(properties, new QName(Names.NAMESPACE_URI,"Durable",Names.PREFIX));
-//		durable.setTextContent(String.valueOf(Boolean.FALSE));
-//		
-//		Element consumerCount = XmlUtils.getElement(properties, new QName(Names.NAMESPACE_URI,"ConsumerCount",Names.PREFIX));
-//		consumerCount.setTextContent(String.valueOf(13));		
-//		
-//		fail("PutResourcePropertyDocument not yet implemented!");
-////		_resourceClient.putResourcePropertyDocument(properties);
-////		
-////		Element newProperties = _resourceClient.getResourcePropertyDocument();
-////		
-////		assertEquals(properties,newProperties);
-//	}
+	/**
+	 * Tests the WS-RP PutResourcePropertyDocument interface of the WS-DM adapter.
+	 * Specifically it tries to update the value of a read-only property.
+	 * 
+	 * <br>precondition : a ws resource exists, it is registered and has at least one
read-only property. 
+	 * <br>postcondition : An exception is thrown indicating the failure.
+	 */
+	public void testGetAndPutResourcePropertyDocumentKO_WithReadOnlyProperty() throws Exception
+	{	
+		String propertyName = "Name";
+		
+		Element propertiesDocument = _resourceClient.getResourcePropertyDocument();
+		Element [] properties = XmlUtils.getAllElements(propertiesDocument);
+		
+		for (Element element : properties)
+		{
+			if (propertyName.equals(element.getLocalName())) {
+				element.setTextContent("ThisIsTheNewValueOfNameProperty");
+			} else {
+				propertiesDocument.removeChild(element);
+			}
+		}
+
+		try 
+		{
+			_resourceClient.putResourcePropertyDocument(propertiesDocument);
+			fail("It's not possible to update the value of a read-only property.");
+		} catch (SoapFault expected) 
+		{
+			
+		}
+	}	
 	
 	/**
 	 * Test the WS-RP GetResourceProperties interface of the WS-DM adapter.



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message