You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by ip...@apache.org on 2005/03/30 01:35:08 UTC
svn commit: r159448 - in
incubator/muse/trunk/src/site/content/interop/src/test/org/apache/ws/muws/interop/client:
AbstractWsdmInteropTestCase.java WebServicesMgmtTestCase.java
Author: ips
Date: Tue Mar 29 15:35:06 2005
New Revision: 159448
URL: http://svn.apache.org/viewcvs?view=rev&rev=159448
Log:
read weather station #2 EPR from separate URL
Modified:
incubator/muse/trunk/src/site/content/interop/src/test/org/apache/ws/muws/interop/client/AbstractWsdmInteropTestCase.java
incubator/muse/trunk/src/site/content/interop/src/test/org/apache/ws/muws/interop/client/WebServicesMgmtTestCase.java
Modified: incubator/muse/trunk/src/site/content/interop/src/test/org/apache/ws/muws/interop/client/AbstractWsdmInteropTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/site/content/interop/src/test/org/apache/ws/muws/interop/client/AbstractWsdmInteropTestCase.java?view=diff&r1=159447&r2=159448
==============================================================================
--- incubator/muse/trunk/src/site/content/interop/src/test/org/apache/ws/muws/interop/client/AbstractWsdmInteropTestCase.java (original)
+++ incubator/muse/trunk/src/site/content/interop/src/test/org/apache/ws/muws/interop/client/AbstractWsdmInteropTestCase.java Tue Mar 29 15:35:06 2005
@@ -124,14 +124,4 @@
return (EndpointReferenceDocument) XmlObject.Factory.parse( url );
}
- protected BigInteger getFCCID(ResourceStub resource)
- throws FaultException
- {
- XmlObject[] resourceFCCIDArray = resource.getResourceProperty(WeatherstationPropertyQNames.FCCID);
- XmlObject resourceFCCID = resourceFCCIDArray[0];
- assertTrue("FCCID was not a xs:positiveInteger", resourceFCCID instanceof XmlPositiveInteger);
- XmlPositiveInteger resFccidInt = (XmlPositiveInteger) resourceFCCID;
- BigInteger resFccidBigIntegerValue = resFccidInt.getBigIntegerValue();
- return resFccidBigIntegerValue;
- }
}
Modified: incubator/muse/trunk/src/site/content/interop/src/test/org/apache/ws/muws/interop/client/WebServicesMgmtTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/muse/trunk/src/site/content/interop/src/test/org/apache/ws/muws/interop/client/WebServicesMgmtTestCase.java?view=diff&r1=159447&r2=159448
==============================================================================
--- incubator/muse/trunk/src/site/content/interop/src/test/org/apache/ws/muws/interop/client/WebServicesMgmtTestCase.java (original)
+++ incubator/muse/trunk/src/site/content/interop/src/test/org/apache/ws/muws/interop/client/WebServicesMgmtTestCase.java Tue Mar 29 15:35:06 2005
@@ -30,6 +30,7 @@
import org.apache.xmlbeans.XmlDateTime;
import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.XmlQName;
+import org.apache.xmlbeans.XmlPositiveInteger;
import org.everestWeather.wsdm.samples.x2005.x04.schema.WeatherstationPropertyQNames;
import org.oasisOpen.docs.wsdm.x2004.x12.mows.wsdmMows.DurationMetric;
import org.oasisOpen.docs.wsdm.x2004.x12.mows.wsdmMows.EndpointDescriptionsDocument;
@@ -63,9 +64,12 @@
{
public static final String SYSPROP_WEATHER_STATION_EPR_URL = "weather_station.epr";
+ public static final String SYSPROP_WEATHER_STATION_2_EPR_URL = "weather_station_2.epr";
private static final String DEFAULT_WEATHER_STATION_EPR_URL = "http://people.apache.org/~ips/interop/weather_station-epr.xml";
+ private static final String DEFAULT_WEATHER_STATION_2_EPR_URL = "http://people.apache.org/~ips/interop/weather_station_2-epr.xml";
private static final String WEATHER_STATION_EPR_URL = System.getProperty( SYSPROP_WEATHER_STATION_EPR_URL, DEFAULT_WEATHER_STATION_EPR_URL );
+ private static final String WEATHER_STATION_2_EPR_URL = System.getProperty( SYSPROP_WEATHER_STATION_2_EPR_URL, DEFAULT_WEATHER_STATION_2_EPR_URL );
private ResourceStub m_resource;
@@ -208,25 +212,21 @@
XmlQName match = (XmlQName) matchElems[0];
assertEquals( WeatherstationPropertyQNames.FCCID, match.getQNameValue() );
- BigInteger res1FccidBigIntegerValue = getFCCID(m_resource);
+ // get weather station resource #2
+ EndpointReferenceDocument weatherStation2EprDoc = getEndpointReference( new URL( WEATHER_STATION_2_EPR_URL ) );
+ ResourceStub resource2 = new ResourceStub(new XmlBeansEndpointReference( weatherStation2EprDoc.getEndpointReference()) ); //resource2
- //get second resource
- //todo this needs to be generic enough to be transparent... ideally there is another epr to reference (we should add a second)
- //this will avoid the need to read one in and modify it
- EndpointReferenceDocument weatherStationEprDoc = getEndpointReference( new URL( WEATHER_STATION_EPR_URL ) );
- org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType endpointReference = weatherStationEprDoc.getEndpointReference();
- ReferencePropertiesType referenceProperties = endpointReference.getReferenceProperties();
-
- //update the ResourceID
- XmlObject[] childElements = XmlBeanUtils.getChildElements(referenceProperties, new QName("http://everest-weather.org/wsdm/samples/2005/04/schema","ResourceID") );
- XmlBeanUtils.setValue(childElements[0],"weather2");
- //end update
-
- ResourceStub resource2 = new ResourceStub(new XmlBeansEndpointReference( endpointReference) ); //resource2
- BigInteger res2FccidBigIntegerValue = getFCCID(resource2);
-
- assertEquals("FCCID's did not match.", res1FccidBigIntegerValue, res2FccidBigIntegerValue);
+ assertEquals("FCCIDs did not match.", getFCCID(m_resource), getFCCID(resource2));
+ }
+ private BigInteger getFCCID(ResourceStub resource)
+ throws FaultException
+ {
+ XmlObject resourceFCCID = getSingleProperty(resource, WeatherstationPropertyQNames.FCCID);
+ assertTrue("FCCID was not a xs:positiveInteger", resourceFCCID instanceof XmlPositiveInteger);
+ XmlPositiveInteger resFccidInt = (XmlPositiveInteger) resourceFCCID;
+ BigInteger resFccidBigIntegerValue = resFccidInt.getBigIntegerValue();
+ return resFccidBigIntegerValue;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org