Author: scamp
Date: Tue Jun 7 11:47:03 2005
New Revision: 188843
URL: http://svn.apache.org/viewcvs?rev=188843&view=rev
Log: (empty)
Modified:
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/WeatherStationResource.java
incubator/muse/trunk/src/ieeedemo/src/test/IEEEDemoTest.java
Modified:
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/WeatherStationResource.java
URL:
http://svn.apache.org/viewcvs/incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/WeatherStationResource.java?rev=188843&r1=188842&r2=188843&view=diff
==============================================================================
---
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/WeatherStationResource.java
(original)
+++
incubator/muse/trunk/src/ieeedemo/src/java/org/wsdmdemo/service/weatherStation/WeatherStationResource.java
Tue Jun 7 11:47:03 2005
@@ -135,7 +135,7 @@
// init the {http://wsdmdemo.org/service/weather-station}Name
Resource Property
resourceProperty =
resourcePropertySet.get(WeatherStationPropertyQNames.NAME);
org.wsdmdemo.service.weatherStation.NameDocument prop_name =
org.wsdmdemo.service.weatherStation.NameDocument.Factory.newInstance();
- prop_name.setName(InteropConstants.WS1_KEY);
+ prop_name.setName(InteropConstants.WS2_KEY);
resourceProperty.add(prop_name);
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=188843&r1=188842&r2=188843&view=diff
==============================================================================
--- incubator/muse/trunk/src/ieeedemo/src/test/IEEEDemoTest.java (original)
+++ incubator/muse/trunk/src/ieeedemo/src/test/IEEEDemoTest.java Tue Jun 7
11:47:03 2005
@@ -1,13 +1,18 @@
import junit.framework.TestCase;
import org.apache.ws.addressing.XmlBeansEndpointReference;
+import org.apache.ws.util.XmlBeanUtils;
import org.apache.xmlbeans.XmlObject;
import
org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyDocument;
+import
org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResourcePropertiesDocument;
+import
org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.UpdateType;
import org.wsdmdemo.service.InteropConstants;
import org.wsdmdemo.service.InteropRequestUtils;
import
org.wsdmdemo.service.weatherClientConfig.WeatherClientConfigPropertyQNames;
+import
org.wsdmdemo.service.weatherClientConfig.WeatherStationReferenceDocument;
import org.wsdmdemo.service.weatherStation.RecalibrateDocument;
import org.wsdmdemo.service.weatherStation.WeatherStationPropertyQNames;
+import org.wsdmdemo.service.weatherStationDir.AddWeatherStationDocument;
import org.wsdmdemo.service.weatherStationDir.WeatherStationDirPropertyQNames;
import org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceDocument;
@@ -19,32 +24,35 @@
public class IEEEDemoTest extends TestCase
{
private static final String WEATHER_STATION_1_EPR_URL =
System.getProperty(InteropConstants.SYSPROP_WS1_EPR_URL,
"http://localhost:8080/muse/epr/weather-station-1-epr.xml");
+ private static final String WEATHER_STATION_2_EPR_URL =
System.getProperty(InteropConstants.SYSPROP_WS2_EPR_URL,
"http://localhost:8080/muse/epr/weather-station-2-epr.xml");
private static final String WEATHER_STATION_DIR_SERVICE_URL =
System.getProperty(InteropConstants.SYSPROP_WS_DIR_SERVICE_URL,
"http://localhost:8080/muse/services/WeatherStationDir");
private static final String WEATHER_STATION_CLIENT_CONFIG_EPR_URL =
System.getProperty(InteropConstants.SYSPROP_WS_CLIENT_CONFIG_EPR_URL,
"http://localhost:8080/muse/epr/weather-client-config-epr.xml");;
+ private static EndpointReferenceDocument WEATHER_STATION_1_EPR_DOC;
+ private static EndpointReferenceDocument WEATHER_STATION_2_EPR_DOC;
+ private static EndpointReferenceDocument CLIENT_CONFIG_EPR;
- public void testDemo() throws Exception
+ protected void setUp() throws Exception
{
- EndpointReferenceDocument weatherStationEprDoc =
InteropRequestUtils.getEndpointReference(new URL(WEATHER_STATION_1_EPR_URL));
- EndpointReferenceDocument clientConfigEpr =
InteropRequestUtils.getEndpointReference(new
URL(WEATHER_STATION_CLIENT_CONFIG_EPR_URL));
+ WEATHER_STATION_1_EPR_DOC =
InteropRequestUtils.getEndpointReference(new URL(WEATHER_STATION_1_EPR_URL));
+ WEATHER_STATION_2_EPR_DOC =
InteropRequestUtils.getEndpointReference(new URL(WEATHER_STATION_2_EPR_URL));
+ CLIENT_CONFIG_EPR = InteropRequestUtils.getEndpointReference(new
URL(WEATHER_STATION_CLIENT_CONFIG_EPR_URL));
+ }
+
+ public void testGetConfiguredWeatherStation()
+ {
+ EndpointReferenceDocument clientConfigEpr = CLIENT_CONFIG_EPR;
+
+ //retrieve the epr for weather station 1 from wc
+ GetResourcePropertyDocument getResourcePropertyDocument =
GetResourcePropertyDocument.Factory.newInstance();
+
getResourcePropertyDocument.setGetResourceProperty(WeatherClientConfigPropertyQNames.WEATHERSTATIONREFERENCE);
+ XmlObject getResp =
InteropRequestUtils.sendRequest(getResourcePropertyDocument,
"http://wsdmdemo.org/service/weather-station-dir/GetResourceProperties", new
XmlBeansEndpointReference(clientConfigEpr.getEndpointReference()));
- //set the weatherstation config prop to ws1 resource ..no need
internally configured
- /* SetResourcePropertiesDocument setResourcePropertiesDocument =
SetResourcePropertiesDocument.Factory.newInstance();
- SetResourcePropertiesDocument.SetResourceProperties
setResourceProperties =
setResourcePropertiesDocument.addNewSetResourceProperties();
- UpdateType update = UpdateType.Factory.newInstance();
- WeatherStationReferenceDocument weatherStationReferenceDocument =
WeatherStationReferenceDocument.Factory.newInstance();
-
weatherStationReferenceDocument.setWeatherStationReference(weatherStationEprDoc.getEndpointReference());
- XmlBeanUtils.addChildElement(update,weatherStationReferenceDocument);
- setResourceProperties.setUpdateArray(new UpdateType[]{update});
- XmlObject addResponse =
InteropRequestUtils.sendRequest(setResourcePropertiesDocument,"http://wsdmdemo.org/service/weather-station-dir/SetResourceProperties",new
XmlBeansEndpointReference(clientConfigEpr.getEndpointReference()));
-
- //addweatherstation
- AddWeatherStationDocument addWeatherStationDocument =
AddWeatherStationDocument.Factory.newInstance();
-
org.wsdmdemo.service.weatherStationDir.AddWeatherStationDocument.AddWeatherStation
addWeatherStation = addWeatherStationDocument.addNewAddWeatherStation();
-
-
addWeatherStation.setEndpointReference(weatherStationEprDoc.getEndpointReference());
- addResponse =
InteropRequestUtils.sendRequest(addWeatherStationDocument,"http://wsdmdemo.org/service/weather-station-dir/AddWeatherStation",WEATHER_STATION_DIR_SERVICE_URL);
- */
+ }
+ public void testDemo() throws Exception
+ {
+ EndpointReferenceDocument weatherStationEprDoc =
WEATHER_STATION_1_EPR_DOC;
+ EndpointReferenceDocument clientConfigEpr = CLIENT_CONFIG_EPR;
//retrieve the epr for weather station 1 from wc
GetResourcePropertyDocument getResourcePropertyDocument =
GetResourcePropertyDocument.Factory.newInstance();
@@ -98,5 +106,29 @@
//todo test notifs....???are there notifs anymore??
}
+ public void testSetWeatherStation() throws Exception
+ {
+ EndpointReferenceDocument weatherStationEprDoc =
WEATHER_STATION_2_EPR_DOC;
+ EndpointReferenceDocument clientConfigEpr = CLIENT_CONFIG_EPR;
+ SetResourcePropertiesDocument setResourcePropertiesDocument =
SetResourcePropertiesDocument.Factory.newInstance();
+ SetResourcePropertiesDocument.SetResourceProperties
setResourceProperties =
setResourcePropertiesDocument.addNewSetResourceProperties();
+ UpdateType update = UpdateType.Factory.newInstance();
+ WeatherStationReferenceDocument weatherStationReferenceDocument =
WeatherStationReferenceDocument.Factory.newInstance();
+
weatherStationReferenceDocument.setWeatherStationReference(weatherStationEprDoc.getEndpointReference());
+ XmlBeanUtils.addChildElement(update, weatherStationReferenceDocument);
+ setResourceProperties.setUpdateArray(new UpdateType[]{update});
+ XmlObject addResponse =
InteropRequestUtils.sendRequest(setResourcePropertiesDocument,
"http://wsdmdemo.org/service/weather-station-dir/SetResourceProperties", new
XmlBeansEndpointReference(clientConfigEpr.getEndpointReference()));
+ }
+
+ public void testAddWeatherStation()
+ {
+ EndpointReferenceDocument weatherStationEprDoc =
WEATHER_STATION_2_EPR_DOC;
+ //addweatherstation
+ AddWeatherStationDocument addWeatherStationDocument =
AddWeatherStationDocument.Factory.newInstance();
+
org.wsdmdemo.service.weatherStationDir.AddWeatherStationDocument.AddWeatherStation
addWeatherStation = addWeatherStationDocument.addNewAddWeatherStation();
+
+
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]