Author: scamp
Date: Wed Jun 8 08:14:54 2005
New Revision: 189590
URL: http://svn.apache.org/viewcvs?rev=189590&view=rev
Log: (empty)
Modified:
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/InteropRequestUtils.java
incubator/muse/trunk/src/ieeedemo/src/test/IEEEDemoTest.java
Modified:
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/InteropRequestUtils.java
URL:
http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/InteropRequestUtils.java?rev=189590&r1=189589&r2=189590&view=diff
==============================================================================
---
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/InteropRequestUtils.java
(original)
+++
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/InteropRequestUtils.java
Wed Jun 8 08:14:54 2005
@@ -2,7 +2,6 @@
import org.apache.axis.message.addressing.Constants;
import org.apache.ws.XmlObjectWrapper;
-import org.apache.ws.resource.properties.ResourceProperty;
import org.apache.ws.addressing.EndpointReference;
import org.apache.ws.addressing.XmlBeansEndpointReference;
import org.apache.ws.muws.v1_0.capability.IdentityCapability;
@@ -167,18 +166,19 @@
GetResourcePropertyDocument getResourcePropertyDocument =
GetResourcePropertyDocument.Factory.newInstance();
getResourcePropertyDocument.setGetResourceProperty(IdentityCapability.PROP_NAME_RESOURCE_ID);
XmlObject xmlObject = sendRequest(getResourcePropertyDocument,
"http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl/GetResourceProperty",
new XmlBeansEndpointReference(endpointReferenceType));
+ String resourceID = null;
if (xmlObject instanceof
GetResourcePropertyResponseDocument.GetResourcePropertyResponse)
{
GetResourcePropertyResponseDocument.GetResourcePropertyResponse
getResourcePropertyResponse =
(GetResourcePropertyResponseDocument.GetResourcePropertyResponse) xmlObject;
XmlObject[] childElements =
XmlBeanUtils.getChildElements(getResourcePropertyResponse);
- XmlAnyUriImpl childElement = (XmlAnyUriImpl) childElements[0];
- String resourceid = childElement.getStringValue();
- return resourceid;
- }
- else
- {
- return null;
+ if (childElements.length == 1)
+ {
+ XmlAnyUriImpl childElement = (XmlAnyUriImpl) childElements[0];
+ resourceID = childElement.getStringValue();
+ }
}
+ return resourceID;
+
}
public static RelationshipType createRelationshipType(RelationshipType
relationshipType)
@@ -196,5 +196,5 @@
}
return relationshipType;
}
-
+
}
Modified: incubator/muse/trunk/src/ieeedemo/src/test/IEEEDemoTest.java
URL:
http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/src/test/IEEEDemoTest.java?rev=189590&r1=189589&r2=189590&view=diff
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/src/test/IEEEDemoTest.java (original)
+++ incubator/muse/trunk/src/ieeedemo/src/test/IEEEDemoTest.java Wed Jun 8
08:14:54 2005
@@ -78,11 +78,7 @@
XmlObject getMultResp2 =
InteropRequestUtils.sendRequest(getMultipleResourcePropertiesDocument,"http://wsdmdemo.org/service/weather-station-dir/GetMultipleResourceProperties",new
XmlBeansEndpointReference(weatherStationEprDoc.addNewEndpointReference()));
*/
- //get relationships from dir > 0
- getResourcePropertyDocument =
GetResourcePropertyDocument.Factory.newInstance();
-
getResourcePropertyDocument.setGetResourceProperty(WeatherStationDirPropertyQNames.RELATIONSHIP);
//need epr
- XmlObject getRelResp =
InteropRequestUtils.sendRequest(getResourcePropertyDocument,
"http://wsdmdemo.org/service/weather-station-dir/GetResourceProperties",
WEATHER_STATION_DIR_SERVICE_URL);
- //todo assert we get both relationships
+ testgetRelationships();
//check the OpStatus prop is PartiallyAvail .....also need to check
notif
getResourcePropertyDocument =
GetResourcePropertyDocument.Factory.newInstance();
@@ -106,6 +102,16 @@
//todo test notifs....???are there notifs anymore??
}
+ public void testgetRelationships()
+ {
+ GetResourcePropertyDocument getResourcePropertyDocument;
+ //get relationships from dir > 0
+ getResourcePropertyDocument =
GetResourcePropertyDocument.Factory.newInstance();
+
getResourcePropertyDocument.setGetResourceProperty(WeatherStationDirPropertyQNames.RELATIONSHIP);
//need epr
+ XmlObject getRelResp =
InteropRequestUtils.sendRequest(getResourcePropertyDocument,
"http://wsdmdemo.org/service/weather-station-dir/GetResourceProperties",
WEATHER_STATION_DIR_SERVICE_URL);
+ //todo assert we get both relationships
+ }
+
public void testSetWeatherStation() throws Exception
{
EndpointReferenceDocument weatherStationEprDoc =
WEATHER_STATION_2_EPR_DOC;
@@ -131,4 +137,6 @@
addWeatherStation.setEndpointReference(weatherStationEprDoc.getEndpointReference());
XmlObject addResponse =
InteropRequestUtils.sendRequest(addWeatherStationDocument,
"http://wsdmdemo.org/service/weather-station-dir/AddWeatherStation",
WEATHER_STATION_DIR_SERVICE_URL);
}
+
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]