You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by sc...@apache.org on 2006/06/02 19:33:13 UTC
svn commit: r411218 [28/34] - in /webservices/muse: branches/1.0/
branches/1.0/src/examples/broker/ branches/1.0/src/examples/broker/WEB-INF/
branches/1.0/src/examples/consumer/ branches/1.0/src/examples/consumer/epr/
branches/1.0/src/examples/consumer...
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/metadataexchange/v2004_09/FileSystem.wsdl
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/metadataexchange/v2004_09/FileSystem.wsdl?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/metadataexchange/v2004_09/FileSystem.wsdl (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/metadataexchange/v2004_09/FileSystem.wsdl Fri Jun 2 10:32:46 2006
@@ -0,0 +1,382 @@
+<?xml version="1.0"?>
+
+<definitions name="FileSystemResourceDefinition"
+ targetNamespace="http://ws.apache.org/resource/example/filesystem"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://ws.apache.org/resource/example/filesystem"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"
+ xmlns:wsrpw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
+ xmlns:wsrlw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl"
+ xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
+
+ <import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
+ location="../spec/wsrf/WS-ResourceProperties-1_2-Draft_01.wsdl"/>
+
+ <import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl"
+ location="../spec/wsrf/WS-ResourceLifetime-1_2-Draft_01.wsdl"/>
+
+ <import namespace="http://schemas.xmlsoap.org/ws/2004/09/mex"
+ location="../spec/wsx/Metadataexchange-2004_09.wsdl"/>
+
+ <types>
+ <schema elementFormDefault="qualified"
+ targetNamespace="http://ws.apache.org/resource/example/filesystem"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsrl="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
+ xmlns:wsbf="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd">
+
+ <xsd:import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd"
+ schemaLocation="../spec/wsrf/WS-BaseFaults-1_2-Draft_01.xsd"/>
+
+ <xsd:import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
+ schemaLocation="../spec/wsrf/WS-ResourceLifetime-1_2-Draft_01.xsd"/>
+
+ <element name="DeviceSpecialFile" type="xsd:string"/>
+ <element name="MountPointDirectory" type="xsd:string"/>
+ <element name="Type" type="xsd:string"/>
+ <element name="Options">
+ <complexType>
+ <sequence>
+ <element name="Option" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="BackupFrequency" type="xsd:int"/>
+ <element name="FsckPassNumber" type="xsd:int"/>
+ <element name="Comment" type="xsd:string"/>
+
+ <!-- Resource Properties Document Schema -->
+ <element name="FileSystemProperties">
+ <complexType>
+ <sequence>
+ <!-- props for wsrl:ScheduledResourceTermination portType -->
+ <element ref="wsrl:CurrentTime"/>
+ <element ref="wsrl:TerminationTime"/>
+
+ <!-- props for tns:FileSystemPortType portType -->
+ <element ref="tns:DeviceSpecialFile"/>
+ <element ref="tns:MountPointDirectory"/>
+ <element ref="tns:Type"/>
+ <element ref="tns:Options"/>
+ <element ref="tns:BackupFrequency"/>
+ <element ref="tns:FsckPassNumber"/>
+ <element ref="tns:Comment" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- ====== Message Types for Custom Operations ======= -->
+
+ <element name="Mount">
+ <complexType />
+ </element>
+
+ <element name="MountResponse">
+ <complexType />
+ </element>
+
+ <element name="Unmount">
+ <complexType />
+ </element>
+
+ <element name="UnmountResponse">
+ <complexType />
+ </element>
+
+ <element name="MountDeviceBusyFault">
+ <complexType>
+ <complexContent>
+ <extension base="wsbf:BaseFaultType" />
+ </complexContent>
+ </complexType>
+ </element>
+
+ </schema>
+ </types>
+
+ <!-- ============= Message Definitions for Custom Operations ============= -->
+ <message name="MountRequest">
+ <part name="MountRequest" element="tns:Mount"/>
+ </message>
+
+ <message name="MountResponse">
+ <part name="MountResponse" element="tns:MountResponse"/>
+ </message>
+
+ <message name="UnmountRequest">
+ <part name="UnmountRequest" element="tns:Unmount"/>
+ </message>
+
+ <message name="UnmountResponse">
+ <part name="UnmountResponse" element="tns:UnmountResponse"/>
+ </message>
+
+ <message name="MountDeviceBusyFault">
+ <part name="MountDeviceBusyFault" element="tns:MountDeviceBusyFault"/>
+ </message>
+
+ <portType name="FileSystemPortType" wsrp:ResourceProperties="tns:FileSystemProperties">
+
+ <!-- wsrp:* operations -->
+ <operation name="GetResourceProperty">
+ <input name="GetResourcePropertyRequest" message="wsrpw:GetResourcePropertyRequest"/>
+ <output name="GetResourcePropertyResponse" message="wsrpw:GetResourcePropertyResponse"/>
+ <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/>
+ <fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/>
+ </operation>
+
+ <operation name="GetMultipleResourceProperties">
+ <input name="GetMultipleResourcePropertiesRequest" message="wsrpw:GetMultipleResourcePropertiesRequest"/>
+ <output name="GetMultipleResourcePropertiesResponse" message="wsrpw:GetMultipleResourcePropertiesResponse"/>
+ <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/>
+ <fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/>
+ </operation>
+
+ <operation name="SetResourceProperties">
+ <input name="SetResourcePropertiesRequest" message="wsrpw:SetResourcePropertiesRequest"/>
+ <output name="SetResourcePropertiesResponse" message="wsrpw:SetResourcePropertiesResponse"/>
+ <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/>
+ <fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/>
+ <fault name="InvalidSetResourcePropertiesRequestContentFault" message="wsrpw:InvalidSetResourcePropertiesRequestContentFault"/>
+ <fault name="UnableToModifyResourcePropertyFault" message="wsrpw:UnableToModifyResourcePropertyFault"/>
+ <fault name="SetResourcePropertyRequestFailedFault" message="wsrpw:SetResourcePropertyRequestFailedFault"/>
+ </operation>
+
+ <operation name="QueryResourceProperties">
+ <input name="QueryResourcePropertiesRequest" message="wsrpw:QueryResourcePropertiesRequest"/>
+ <output name="QueryResourcePropertiesResponse" message="wsrpw:QueryResourcePropertiesResponse"/>
+ <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/>
+ <fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/>
+ <fault name="UnknownQueryExpressionDialectFault" message="wsrpw:UnknownQueryExpressionDialectFault"/>
+ <fault name="InvalidQueryExpressionFault" message="wsrpw:InvalidQueryExpressionFault"/>
+ <fault name="QueryEvaluationErrorFault" message="wsrpw:QueryEvaluationErrorFault"/>
+ </operation>
+
+ <!-- wsrl:ImmediateResourceTermination operation -->
+ <operation name="Destroy">
+ <input message="wsrlw:DestroyRequest"/>
+ <output message="wsrlw:DestroyResponse"/>
+ <fault name="ResourceUnknownFault" message="wsrlw:ResourceUnknownFault"/>
+ <fault name="ResourceNotDestroyedFault" message="wsrlw:ResourceNotDestroyedFault"/>
+ </operation>
+
+ <!-- wsrl:ScheduledResourceTermination operation -->
+ <operation name="SetTerminationTime">
+ <input message="wsrlw:SetTerminationTimeRequest"/>
+ <output message="wsrlw:SetTerminationTimeResponse"/>
+ <fault name="ResourceUnknownFault" message="wsrlw:ResourceUnknownFault"/>
+ <fault name="UnableToSetTerminationTimeFault" message="wsrlw:UnableToSetTerminationTimeFault"/>
+ <fault name="TerminationTimeChangeRejectedFault" message="wsrlw:TerminationTimeChangeRejectedFault"/>
+ </operation>
+
+ <!-- custom operations -->
+ <operation name="Mount">
+ <input name="MountRequest" message="tns:MountRequest" />
+ <output name="MountResponse" message="tns:MountResponse" />
+ <fault name="MountDeviceBusyFault" message="tns:MountDeviceBusyFault" />
+ </operation>
+
+ <operation name="Unmount">
+ <input name="UnmountRequest" message="tns:UnmountRequest" />
+ <output name="UnmountResponse" message="tns:UnmountResponse" />
+ <fault name="MountDeviceBusyFault" message="tns:MountDeviceBusyFault" />
+ </operation>
+
+ <operation name='GetMetadata' >
+ <input name="GetMetadataMsg" message='wsx:GetMetadataMsg' />
+ <output name="GetMetadataResponseMsg" message='wsx:GetMetadataResponseMsg' />
+ </operation>
+
+ <operation name='Get' >
+ <input name="GetMsg" message='wsx:GetMsg' />
+ <output name="GetResponseMsg" message='wsx:GetResponseMsg' />
+ </operation>
+
+ </portType>
+
+ <binding name="FileSystemSoapHttpBinding" type="tns:FileSystemPortType">
+
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <!-- wsrp:* operations -->
+ <operation name="GetResourceProperty">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="InvalidResourcePropertyQNameFault">
+ <soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
+ </fault>
+ </operation>
+
+ <operation name="GetMultipleResourceProperties">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="InvalidResourcePropertyQNameFault">
+ <soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
+ </fault>
+ </operation>
+
+ <operation name="SetResourceProperties">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="InvalidResourcePropertyQNameFault">
+ <soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
+ </fault>
+ <fault name="UnableToModifyResourcePropertyFault">
+ <soap:fault name="UnableToModifyResourcePropertyFault" use="literal"/>
+ </fault>
+ <fault name="InvalidSetResourcePropertiesRequestContentFault">
+ <soap:fault name="InvalidSetResourcePropertiesRequestContentFault" use="literal"/>
+ </fault>
+ <fault name="SetResourcePropertyRequestFailedFault">
+ <soap:fault name="SetResourcePropertyRequestFailedFault" use="literal"/>
+ </fault>
+ </operation>
+
+ <operation name="QueryResourceProperties">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="InvalidResourcePropertyQNameFault">
+ <soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
+ </fault>
+ <fault name="UnknownQueryExpressionDialectFault">
+ <soap:fault name="UnknownQueryExpressionDialectFault" use="literal"/>
+ </fault>
+ <fault name="InvalidQueryExpressionFault">
+ <soap:fault name="InvalidQueryExpressionFault" use="literal"/>
+ </fault>
+ <fault name="QueryEvaluationErrorFault">
+ <soap:fault name="QueryEvaluationErrorFault" use="literal"/>
+ </fault>
+ </operation>
+
+ <!-- wsrl:ImmediateResourceTermination operation -->
+ <operation name="Destroy">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="ResourceNotDestroyedFault">
+ <soap:fault name="ResourceNotDestroyedFault" use="literal"/>
+ </fault>
+ </operation>
+
+ <!-- wsrl:ScheduledResourceTermination operation -->
+ <operation name="SetTerminationTime">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="ResourceUnknownFault">
+ <soap:fault name="ResourceUnknownFault" use="literal"/>
+ </fault>
+ <fault name="UnableToSetTerminationTimeFault">
+ <soap:fault name="UnableToSetTerminationTimeFault" use="literal"/>
+ </fault>
+ <fault name="TerminationTimeChangeRejectedFault">
+ <soap:fault name="TerminationTimeChangeRejectedFault" use="literal"/>
+ </fault>
+ </operation>
+
+ <!-- wsx:GetMetadata operation -->
+ <operation name='GetMetadata' >
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+
+ <!-- wsx:Get operation -->
+ <operation name='Get' >
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+
+ <!-- custom operations -->
+ <operation name="Mount">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="MountDeviceBusyFault">
+ <soap:fault name="MountDeviceBusyFault" use="literal"/>
+ </fault>
+ </operation>
+
+ <operation name="Unmount">
+ <soap:operation style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="MountDeviceBusyFault">
+ <soap:fault name="MountDeviceBusyFault" use="literal"/>
+ </fault>
+ </operation>
+
+ </binding>
+
+ <service name="FileSystemService">
+ <!-- Note: the port name becomes the service name in the wsdd generated by Axis Wsdl2Java -->
+ <port name="filesystem" binding="tns:FileSystemSoapHttpBinding">
+ <soap:address location="http://localhost:8080/wsrf/services/filesystem"/>
+ </port>
+ </service>
+
+</definitions>
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/metadataexchange/v2004_09/MetadataExchangePortTypeTest.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/metadataexchange/v2004_09/MetadataExchangePortTypeTest.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/metadataexchange/v2004_09/MetadataExchangePortTypeTest.java (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/metadataexchange/v2004_09/MetadataExchangePortTypeTest.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,67 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.resource.metadataexchange.v2004_09;
+
+import org.apache.ws.resource.properties.v2004_06.porttype.impl.AbstractWsrpPortTypeImplTestCase;
+import org.apache.ws.util.jndi.XmlBeanJndiUtils;
+
+/**
+ * @author Sal Campana
+ */
+public class MetadataExchangePortTypeTest
+ extends AbstractWsrpPortTypeImplTestCase
+{
+ /**
+ * DOCUMENT_ME
+ */
+ public void testGet( )
+ { /*
+ SushiResourceContext context = new SushiResourceContext();
+ MetadataExchangePortTypeImpl portTypeImpl = new MetadataExchangePortTypeImpl(context);
+
+ AnyXmlType anyXmlType = portTypeImpl.get();
+ assertNotNull(anyXmlType);
+ */
+ assertTrue( true );
+ }
+
+ //todo figure out how to do this test with url, epr and filesystem in junit
+ public void testGetMetadata( )
+ {
+ /*SushiResourceContext context = new SushiResourceContext();
+ MetadataExchangePortTypeImpl portTypeImpl = new MetadataExchangePortTypeImpl(context);
+ GetMetadataDocument getMetadataDocument = GetMetadataDocument.Factory.newInstance();
+ GetMetadataDocument.GetMetadata request = getMetadataDocument.addNewGetMetadata();
+ request.setDialect("http://schemas.xmlsoap.org/wsdl");
+
+ MetadataDocument metadata = portTypeImpl.getMetadata(getMetadataDocument);
+
+ assertNotNull(metadata);*/
+ assertTrue( true );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ */
+ protected void setUp( )
+ throws Exception
+ {
+ super.setUp( );
+ XmlBeanJndiUtils.initFromInputStream( this.getClass( ).getClassLoader( ).getResourceAsStream( "org/apache/ws/resource/metadataexchange/v2004_09/jndi-config.xml" ) );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/metadataexchange/v2004_09/jndi-config.xml
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/metadataexchange/v2004_09/jndi-config.xml?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/metadataexchange/v2004_09/jndi-config.xml (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/metadataexchange/v2004_09/jndi-config.xml Fri Jun 2 10:32:46 2006
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jndiConfig xmlns="http://www.apache.org/wsfx/wsrf/jndi/config">
+
+ <global>
+
+ <resource name="DefaultParameters" type="org.apache.ws.util.jndi.DefaultParameters">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ <parameter>
+ <name>resourceKeyClassName</name>
+ <value>org.apache.ws.resource.impl.SimpleTypeResourceKey</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ <resource name="timer/ContainerTimer" type="org.apache.ws.util.timer.TimerManagerImpl">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ </global>
+
+<service name="sushi">
+ <resource name="home" type="org.apache.ws.resource.properties.SushiHome">
+ <resourceParams>
+ <parameter>
+ <name>serviceClassName</name>
+ <value>org.apache.ws.resource.properties.SushiService</value>
+ </parameter>
+ <parameter>
+ <name>resourceClassName</name>
+ <value>org.apache.ws.resource.properties.SushiResource</value>
+ </parameter>
+ <parameter>
+ <name>wsdlTargetNamespace</name>
+ <value>http://ws.apache.org/resource/properties/test/sushi</value>
+ </parameter>
+ <parameter>
+ <name>resourceIdentifierReferenceParameterName</name>
+ <value>{http://ws.apache.org/resource/properties/test/sushi}ResourceID</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+ <resource name="metadata" type="org.apache.ws.util.jndi.tools.MetadataConfigImpl">
+ <metadata-config>
+
+ <!-- classpath -->
+ <metadata Dialect="http://www.w3.org/2001/XMLSchema" Identifier="http://ws.apache.org/resource/properties/test/sushi_classpath">
+ <Location>org/apache/resource/properties/SushiProperties.xsd</Location>
+ </metadata>
+ <metadata Dialect="http://schemas.xmlsoap.org/wsdl" Identifier="http://ws.apache.org/resource/example/filesystem_classpath">
+ <Location>org/apache/ws/resource/metadataexchange/v2004_09/FileSystem.wsdl</Location>
+ </metadata>
+
+ <!-- file -->
+ <metadata Dialect="http://www.w3.org/2001/XMLSchema" Identifier="http://ws.apache.org/resource/properties/test/sushi_file">
+ <Location>C:/Projects/apache/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiProperties.xsd</Location>
+ </metadata>
+ <metadata Dialect="http://schemas.xmlsoap.org/wsdl" Identifier="http://ws.apache.org/resource/example/filesystem_file">
+ <Location>C:/Projects/apache/wsrf/trunk/src/test/org/apache/ws/resource/metadataexchange/v2004_09/FileSystem.wsdl</Location>
+ </metadata>
+
+ <!-- http url -->
+ <metadata Dialect="http://www.w3.org/2001/XMLSchema" Identifier="http://ws.apache.org/resource/properties/test/sushi_url">
+ <Location>http://localhost:8080/wsrf/SushiProperties.xsd</Location>
+ </metadata>
+ <metadata Dialect="http://schemas.xmlsoap.org/wsdl" Identifier="http://ws.apache.org/resource/example/filesystem_url">
+ <Location>http://localhost:8080/wsrf/FileSystem.wsdl</Location>
+ </metadata>
+
+ <!-- file url -->
+ <metadata Dialect="http://www.w3.org/2001/XMLSchema" Identifier="http://ws.apache.org/resource/properties/test/sushi_fileurl">
+ <Location>file://C:/Projects/apache/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiProperties.xsd</Location>
+ </metadata>
+ <metadata Dialect="http://schemas.xmlsoap.org/wsdl" Identifier="http://ws.apache.org/resource/example/filesystem_fileurl">
+ <Location>file://C:/Projects/apache/wsrf/trunk/src/test/org/apache/ws/resource/metadataexchange/v2004_09/FileSystem.wsdl</Location>
+ </metadata>
+
+ <!-- EndpointReference -->
+ <metadata Dialect="http://www.w3.org/2001/XMLSchema" Identifier="http://ws.apache.org/resource/properties/test/sushi_epr">
+ <MetadataReference>
+ <Address>http://localhost:8080/wsrf/services/sushi</Address>
+ <ReferenceProperties>
+ <s:ResourceID xmlns:s="http://ws.apache.org/resource/properties/test/sushi">1</s:ResourceID>
+ </ReferenceProperties>
+ </MetadataReference>
+ </metadata>
+
+ <metadata Dialect="http://schemas.xmlsoap.org/wsdl" Identifier="http://ws.apache.org/resource/example/filesystem_epr">
+ <MetadataReference>
+ <Address>http://localhost:8080/wsrf/services/filesystem</Address>
+ <ReferenceProperties>
+ <s:ResourceID xmlns:s="http://ws.apache.org/resource/example/filesystem">1</s:ResourceID>
+ </ReferenceProperties>
+ </MetadataReference>
+ </metadata>
+
+
+ </metadata-config>
+ <resourceParams/>
+ </resource>
+ </service></jndiConfig>
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/AbstractResourcePropertiesTestCase.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/AbstractResourcePropertiesTestCase.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/AbstractResourcePropertiesTestCase.java (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/AbstractResourcePropertiesTestCase.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,174 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.resource.properties;
+
+import junit.framework.TestCase;
+import org.apache.commons.io.CopyUtils;
+import org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet;
+import org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySetMetaData;
+import org.apache.ws.util.jndi.XmlBeanJndiUtils;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.impl.common.XmlErrorPrinter;
+import org.apache.xmlbeans.impl.tool.SchemaCompiler;
+import org.oasisOpen.docs.wsrf.x2004.x10.wsrfWSResourceMetadataDescriptor10Draft01.DefinitionsDocument;
+import org.oasisOpen.docs.wsrf.x2004.x10.wsrfWSResourceMetadataDescriptor10Draft01.MetadataDescriptorType;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+/**
+ * Base class for test cases for WSRP portType impls.
+ *
+ * @author Ian Springer
+ */
+public abstract class AbstractResourcePropertiesTestCase
+ extends TestCase
+{
+ /** DOCUMENT_ME */
+ public static final String NSURI_SUSHI = "http://ws.apache.org/resource/properties/test/sushi";
+
+ /** DOCUMENT_ME */
+ protected static final String RESOURCE_PATH_SUSHI_PROPS_XSD =
+ "org/apache/ws/resource/properties/SushiProperties.xsd";
+
+ /** DOCUMENT_ME */
+ protected static final String RESOURCE_PATH_SUSHI_PROPS_XML =
+ "org/apache/ws/resource/properties/SushiProperties.xml";
+
+ /** DOCUMENT_ME */
+ protected static final String RESOURCE_PATH_SUSHI_METADATA_XML =
+ "org/apache/ws/resource/properties/SushiMetadata.wsrmd";
+
+ /** DOCUMENT_ME */
+ protected static final File BASE_TMP_DIR =
+ new File( System.getProperty( "java.io.tmpdir" ), "ws.apache.org/wsrf" );
+
+ /** DOCUMENT_ME */
+ protected static final File SRC_DIR = new File( BASE_TMP_DIR, "generated_src" );
+
+ /** DOCUMENT_ME */
+ protected static final File CLASSES_DIR = new File( BASE_TMP_DIR, "generated_classes" );
+
+ static
+ {
+ try
+ {
+ XmlBeanJndiUtils.initJNDI( );
+ compileSushiPropsXsd( );
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException( "Failed to either initialize JNDI or compile SushiProperties.xsd.", e );
+ }
+
+ enableSushiPropsTypeClassLoader( );
+ }
+
+ /** DOCUMENT_ME */
+ protected XmlBeansResourcePropertySet m_resourcePropSet;
+
+ /** DOCUMENT_ME */
+ protected SushiResourceContext m_resourceContext;
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ * @throws RuntimeException DOCUMENT_ME
+ */
+ protected static void compileSushiPropsXsd( )
+ throws Exception
+ {
+ InputStream xsdInStream = ClassLoader.getSystemResourceAsStream( RESOURCE_PATH_SUSHI_PROPS_XSD );
+ BASE_TMP_DIR.mkdirs( );
+ File xsdFile = new File( BASE_TMP_DIR, "SushiProperties.xsd" );
+ CopyUtils.copy( xsdInStream,
+ new FileOutputStream( xsdFile ) );
+ if ( !compileSchema( xsdFile ) )
+ {
+ throw new RuntimeException( );
+ }
+ }
+
+ /**
+ * DOCUMENT_ME
+ */
+ protected static void enableSushiPropsTypeClassLoader( )
+ {
+ ClassLoader fileSystemTypeSystemClassLoader = null;
+ try
+ {
+ fileSystemTypeSystemClassLoader = new URLClassLoader( new URL[]
+ {
+ CLASSES_DIR.toURL( )
+ } );
+ }
+ catch ( MalformedURLException mue )
+ {
+ throw new RuntimeException( mue );
+ }
+
+ Thread.currentThread( ).setContextClassLoader( fileSystemTypeSystemClassLoader );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @throws XmlException DOCUMENT_ME
+ * @throws IOException DOCUMENT_ME
+ * @throws MetaDataViolationException DOCUMENT_ME
+ */
+ protected void initResourcePropsDoc( )
+ throws XmlException,
+ IOException,
+ MetaDataViolationException
+ {
+ InputStream in =
+ Thread.currentThread( ).getContextClassLoader( ).getResourceAsStream( RESOURCE_PATH_SUSHI_PROPS_XML );
+ XmlObject propsDocXBean = XmlObject.Factory.parse( in );
+ in.close( );
+ in = Thread.currentThread( ).getContextClassLoader( ).getResourceAsStream( RESOURCE_PATH_SUSHI_METADATA_XML );
+ DefinitionsDocument metadataDocXBean = (DefinitionsDocument) XmlObject.Factory.parse( in );
+ MetadataDescriptorType metadataDesc = metadataDocXBean.getDefinitions( ).getMetadataDescriptorArray( 0 );
+ in.close( );
+ ResourcePropertySetMetaData propSetMetaData =
+ new XmlBeansResourcePropertySetMetaData( propsDocXBean.schemaType( ), metadataDesc );
+ m_resourcePropSet = new XmlBeansResourcePropertySet( propsDocXBean, propSetMetaData );
+ }
+
+ private static boolean compileSchema( File xsdFile )
+ {
+ SchemaCompiler.Parameters scompParams = new SchemaCompiler.Parameters( );
+ scompParams.setSrcDir( SRC_DIR );
+ scompParams.setClassesDir( CLASSES_DIR );
+ scompParams.setXsdFiles( new File[]
+ {
+ xsdFile
+ } );
+ scompParams.setDownload( true );
+ scompParams.setQuiet( true );
+ XmlErrorPrinter errorPrinter = new XmlErrorPrinter( true, null );
+ scompParams.setErrorListener( errorPrinter );
+ SRC_DIR.mkdirs( ); // necessary?
+ CLASSES_DIR.mkdirs( ); // necessary?
+ return SchemaCompiler.compile( scompParams );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/AbstractSushiService.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/AbstractSushiService.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/AbstractSushiService.java (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/AbstractSushiService.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,166 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.resource.properties;
+
+import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.handler.ServiceSoapMethodNameMap;
+import org.apache.ws.resource.handler.SoapMethodNameMap;
+import org.apache.ws.resource.handler.WsrfService;
+import org.apache.ws.resource.properties.v2004_06.porttype.GetMultipleResourcePropertiesPortType;
+import org.apache.ws.resource.properties.v2004_06.porttype.GetResourcePropertyPortType;
+import org.apache.ws.resource.properties.v2004_06.porttype.QueryResourcePropertiesPortType;
+import org.apache.ws.resource.properties.v2004_06.porttype.SetResourcePropertiesPortType;
+import org.apache.ws.resource.properties.v2004_06.porttype.impl.GetMultipleResourcePropertiesPortTypeImpl;
+import org.apache.ws.resource.properties.v2004_06.porttype.impl.GetResourcePropertyPortTypeImpl;
+import org.apache.ws.resource.properties.v2004_06.porttype.impl.QueryResourcePropertiesPortTypeImpl;
+import org.apache.ws.resource.properties.v2004_06.porttype.impl.SetResourcePropertiesPortTypeImpl;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetMultipleResourcePropertiesDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetMultipleResourcePropertiesResponseDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyResponseDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryResourcePropertiesDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryResourcePropertiesResponseDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResourcePropertiesDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResourcePropertiesResponseDocument;
+import javax.xml.namespace.QName;
+
+/**
+ * @author Sal Campana
+ */
+public abstract class AbstractSushiService
+ implements WsrfService,
+ GetResourcePropertyPortType,
+ GetMultipleResourcePropertiesPortType,
+ SetResourcePropertiesPortType,
+ QueryResourcePropertiesPortType
+{
+ /** DOCUMENT_ME */
+ public static final String TARGET_NSURI = "http://ws.apache.org/resource/sushi";
+
+ /** DOCUMENT_ME */
+ public static final String TARGET_NSPREFIX = "fish";
+
+ /**
+ * DOCUMENT_ME
+ */
+ private ServiceSoapMethodNameMap m_methodNameMap;
+
+ /**
+ * DOCUMENT_ME
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestQname DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getMethodName( QName requestQname )
+ {
+ if ( !isInitialized )
+ {
+ init( );
+ }
+
+ return m_methodNameMap.getMethodName( requestQname );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public abstract ResourceContext getResourceContext( );
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public final SoapMethodNameMap getMethodNameMap( )
+ {
+ return m_methodNameMap;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public GetMultipleResourcePropertiesResponseDocument getMultipleResourceProperties( GetMultipleResourcePropertiesDocument requestDoc )
+ {
+ return new GetMultipleResourcePropertiesPortTypeImpl( getResourceContext( ) ).getMultipleResourceProperties( requestDoc );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public SetResourcePropertiesResponseDocument setResourceProperties( SetResourcePropertiesDocument requestDoc )
+ {
+ return new SetResourcePropertiesPortTypeImpl( getResourceContext( ) ).setResourceProperties( requestDoc );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public GetResourcePropertyResponseDocument getResourceProperty( GetResourcePropertyDocument requestDoc )
+ {
+ return new GetResourcePropertyPortTypeImpl( getResourceContext( ) ).getResourceProperty( requestDoc );
+ }
+
+ /**
+ * DOCUMENT_ME
+ */
+ public void init( )
+ {
+ m_methodNameMap = new ServiceSoapMethodNameMap( getResourceContext( ) );
+ isInitialized = true;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public QueryResourcePropertiesResponseDocument queryResourceProperties( QueryResourcePropertiesDocument requestDoc )
+ {
+ return new QueryResourcePropertiesPortTypeImpl( getResourceContext( ) ).queryResourceProperties( requestDoc );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ protected final boolean isInitialized( )
+ {
+ return isInitialized;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/Ebi.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/Ebi.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/Ebi.java (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/Ebi.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,45 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.resource.properties;
+
+
+/**
+ * @author Sal Campana
+ */
+public class Ebi
+{
+ private String m_pieces = "8";
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param value DOCUMENT_ME
+ */
+ public void setNumberOfPieces( String value )
+ {
+ m_pieces = value;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getNumberOfPieces( )
+ {
+ return m_pieces;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiCallback.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiCallback.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiCallback.java (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiCallback.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,170 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.resource.properties;
+
+import org.apache.ws.resource.properties.impl.CallbackFailedException;
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.xmlbeans.XmlInt;
+import org.apache.xmlbeans.XmlObject;
+import javax.xml.namespace.QName;
+
+/**
+ * @author Sal Campana
+ */
+public class SushiCallback
+ implements SetResourcePropertyCallback
+{
+ private SushiPlate m_plate;
+ private boolean m_deleteInvoked;
+ private boolean m_insertInvoked;
+ private boolean m_updateInvoked;
+
+ /**
+ * Creates a new {@link SushiCallback} object.
+ *
+ * @param plate DOCUMENT_ME
+ */
+ public SushiCallback( SushiPlate plate )
+ {
+ m_plate = plate;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public SushiPlate getPlate( )
+ {
+ return m_plate;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param propQName DOCUMENT_ME
+ *
+ * @throws CallbackFailedException DOCUMENT_ME
+ */
+ public void deleteProperty( QName propQName )
+ throws CallbackFailedException
+ {
+ m_deleteInvoked = true;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public boolean deleteWasInvoked( )
+ {
+ return m_deleteInvoked;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param prop DOCUMENT_ME
+ *
+ * @throws CallbackFailedException DOCUMENT_ME
+ */
+ public void insertProperty( Object[] prop )
+ throws CallbackFailedException
+ {
+ m_insertInvoked = true;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public boolean insertWasInvoked( )
+ {
+ return m_insertInvoked;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param prop DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ *
+ * @throws CallbackFailedException DOCUMENT_ME
+ */
+ public ResourceProperty refreshProperty( ResourceProperty prop )
+ throws CallbackFailedException
+ {
+ QName propName = getPropName( prop );
+
+ if ( SushiPropertyQNames.EBI.equals( propName ) )
+ {
+ Ebi ebi = m_plate.getEbi( );
+ String pieces = ebi.getNumberOfPieces( );
+ try
+ {
+ XmlInt ebiElem = (XmlInt) prop.get( 0 );
+ XmlBeanUtils.setValue( ebiElem, pieces );
+ }
+ catch ( Exception e )
+ {
+ e.printStackTrace( );
+ }
+ }
+
+ return prop;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param prop DOCUMENT_ME
+ *
+ * @throws CallbackFailedException DOCUMENT_ME
+ */
+ public void updateProperty( Object[] prop )
+ throws CallbackFailedException
+ {
+ m_updateInvoked = true;
+ Object o = prop[0];
+ if ( o instanceof XmlObject )
+ {
+ XmlObject xmlObject = (XmlObject) o;
+ QName name = XmlBeanUtils.getName( xmlObject );
+ if ( name.getLocalPart( ).equals( "Ebi" ) )
+ {
+ m_plate.getEbi( ).setNumberOfPieces( XmlBeanUtils.getValue( xmlObject ) );
+ }
+ }
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public boolean updateWasInvoked( )
+ {
+ return m_updateInvoked;
+ }
+
+ private QName getPropName( ResourceProperty prop )
+ {
+ return prop.getMetaData( ).getName( );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiHome.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiHome.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiHome.java (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiHome.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,199 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.resource.properties;
+
+import org.apache.ws.resource.PropertiesResource;
+import org.apache.ws.resource.Resource;
+import org.apache.ws.resource.impl.AbstractResourceHome;
+import org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet;
+import org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlOptions;
+import javax.xml.namespace.QName;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * @author Sal Campana
+ */
+public class SushiHome
+ extends AbstractResourceHome
+ implements Serializable
+{
+ /**
+ * The service endpoint name as registered with the SOAP Platform. This is useful for building EPR's. *
+ */
+ public static final QName SERVICE_NAME =
+ javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/resource/properties/test/sushi}sushi" );
+
+ /**
+ * The management PortType associated with this resource. This is useful for building EPR's.*
+ */
+ public static final QName PORT_TYPE =
+ javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/resource/properties/test/sushi}sushi" );
+
+ /**
+ * The WSDL Port name associated with the resource. This is useful for building EPR's. *
+ */
+ public static final String PORT_NAME = "sushi";
+
+ /**
+ * The name of the resource key for this resource. *
+ */
+ public static final QName RESOURCE_ID_REF_PARAM_NAME =
+ javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/resource/properties/test/sushi}ResourceID" );
+
+ /**
+ * DOCUMENT_ME
+ */
+ protected static String RESOURCE_PROPS_RESOURCE_PATH =
+ "org/apache/ws/resource/properties/SushiProperties.xml";
+ private static final NamespaceVersionHolder SPEC_NAMESPACE_SET = new NamespaceVersionHolderImpl( );
+
+ /**
+ * Map containing all SushiResource instances - this map <em>must</em> be static for compatibility with certain JNDI
+ * providers.
+ */
+ private static Map s_resources;
+ private boolean m_isOpenContent;
+
+ /**
+ * Creates a new {@link SushiHome} object.
+ *
+ * @param isOpenContent DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ */
+ public SushiHome( boolean isOpenContent )
+ throws Exception
+ {
+ m_isOpenContent = isOpenContent;
+ setResourceClassName( SushiResource.class.getName( ) );
+ setResourceIdentifierReferenceParameterName( RESOURCE_ID_REF_PARAM_NAME.toString( ) );
+ resetResourceMap( );
+ init( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public QName getPortType( )
+ {
+ return PORT_TYPE;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public QName getResourceIdentifierReferenceParameterQName( )
+ {
+ return RESOURCE_ID_REF_PARAM_NAME;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param propsDoc DOCUMENT_ME
+ */
+ public void setResourcePropsDocPath( String propsDoc )
+ {
+ SushiHome.RESOURCE_PROPS_RESOURCE_PATH = propsDoc;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public QName getServiceName( )
+ {
+ return SERVICE_NAME;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getServicePortName( )
+ {
+ return PORT_NAME;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ */
+ public void init( )
+ throws Exception
+ {
+ super.init( );
+ InputStream in = getClass( ).getClassLoader( ).getResourceAsStream( RESOURCE_PROPS_RESOURCE_PATH );
+ XmlOptions parseOpts = new XmlOptions( ).setLoadStripWhitespace( );
+ if ( !m_isOpenContent )
+ {
+ parseOpts.setLoadReplaceDocumentElement( new QName( AbstractResourcePropertiesTestCase.NSURI_SUSHI,
+ "ClosedSushiProperties", "sushi" ) );
+ }
+
+ XmlObject propsDocXBean = XmlObject.Factory.parse( in, parseOpts );
+ in.close( );
+ ResourcePropertySet propSet = new XmlBeansResourcePropertySet( propsDocXBean );
+ Resource resource = createInstance( SushiResourceContext.ID );
+ ( (PropertiesResource) resource ).setResourcePropertySet( propSet );
+ add( resource );
+ }
+
+ /**
+ * Resets (clears) the resource map.
+ */
+ public final synchronized void resetResourceMap( )
+ {
+ if ( s_resources != null )
+ {
+ s_resources.clear( );
+ }
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public org.apache.ws.resource.properties.NamespaceVersionHolder getNamespaceVersionHolder( )
+ {
+ return SPEC_NAMESPACE_SET;
+ }
+
+ /**
+ * Returns a map of all SushiResource instances. Used by the {@link AbstractResourceHome} superclass.
+ */
+ protected final synchronized Map getResourceMap( )
+ {
+ if ( s_resources == null )
+ {
+ s_resources = AbstractResourceHome.createResourceMap( m_resourceIsPersistent );
+ }
+
+ return s_resources;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiMetadata.wsrmd
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiMetadata.wsrmd?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiMetadata.wsrmd (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiMetadata.wsrmd Fri Jun 2 10:32:46 2006
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+
+<Definitions xmlns="http://docs.oasis-open.org/wsrf/2004/10/wsrf-WSResourceMetadataDescriptor-1.0-draft-01.xsd"
+ xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"
+ xmlns:tns="http://ws.apache.org/resource/properties/test/sushi"
+ targetNamespace="http://ws.apache.org/resource/properties/test/sushi">
+
+ <MetadataDescriptor name="SushiMetadataDescriptor" interface="tns:SushiPortType">
+
+ <Property path="tns:Hamachi" mutability="mutable" modifiability="read-write" />
+ <Property path="tns:Ohtoro" mutability="mutable" modifiability="read-only" />
+
+ </MetadataDescriptor>
+
+</Definitions>
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiPlate.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiPlate.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiPlate.java (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiPlate.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,35 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.resource.properties;
+
+
+/**
+ * @author Sal Campana
+ */
+public class SushiPlate
+{
+ private Ebi m_ebi = new Ebi( );
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Ebi getEbi( )
+ {
+ return m_ebi;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiProperties.xml
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiProperties.xml?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiProperties.xml (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiProperties.xml Fri Jun 2 10:32:46 2006
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+
+<OpenSushiProperties
+ xmlns="http://ws.apache.org/resource/properties/test/sushi"
+ xmlns:wsrl="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd">
+
+ <wsrl:CurrentTime>2004-12-17T09:30:47-05:00</wsrl:CurrentTime>
+ <wsrl:TerminationTime>2005-12-17T09:30:47-05:00</wsrl:TerminationTime>
+ <Akagi>24</Akagi>
+ <Anago>9999999999999999999999999999</Anago>
+ <Ebi>9</Ebi>
+ <Ika>mamamia</Ika>
+ <Hamachi>
+ <Flavor>delicious</Flavor>
+ </Hamachi>
+ <Ohtoro>
+ <Flavor>exquisite</Flavor>
+ </Ohtoro>
+
+</OpenSushiProperties>
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiProperties.xsd
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiProperties.xsd?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiProperties.xsd (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiProperties.xsd Fri Jun 2 10:32:46 2006
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+
+<schema elementFormDefault="qualified"
+ targetNamespace="http://ws.apache.org/resource/properties/test/sushi"
+ xmlns:wsrl="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
+ xmlns:tns="http://ws.apache.org/resource/properties/test/sushi"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
+ schemaLocation="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"/>
+
+ <element name="Akagi" type="xsd:int"/>
+ <element name="Anago" type="xsd:integer"/>
+ <element name="Ebi" type="xsd:int"/>
+ <element name="Ika" type="xsd:string"/>
+ <element name="Uni" type="xsd:anyURI"/>
+ <element name="Hamachi">
+ <complexType>
+ <sequence>
+ <element name="Flavor" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="Ohtoro">
+ <complexType>
+ <sequence>
+ <element name="Flavor" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- a resource properties document type def w/ closed content -->
+ <element name="ClosedSushiProperties">
+ <complexType>
+ <sequence>
+ <!-- props for wsrl:ScheduledResourceTermination portType -->
+ <element ref="wsrl:CurrentTime"/>
+ <element ref="wsrl:TerminationTime"/>
+
+ <!-- custom props -->
+ <element ref="tns:Akagi" />
+ <element ref="tns:Anago" minOccurs="1" maxOccurs="2" />
+ <element ref="tns:Ebi" minOccurs="1" maxOccurs="unbounded" />
+ <element ref="tns:Uni" minOccurs="0" />
+ <element ref="tns:Ika" minOccurs="0" maxOccurs="unbounded" />
+ <element ref="tns:Hamachi" minOccurs="1" maxOccurs="unbounded" />
+ <element ref="tns:Ohtoro" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- a resource properties document type def w/ open content -->
+ <element name="OpenSushiProperties">
+ <complexType>
+ <sequence>
+ <!-- props for wsrl:ScheduledResourceTermination portType -->
+ <element ref="wsrl:CurrentTime"/>
+ <element ref="wsrl:TerminationTime"/>
+
+ <!-- custom props -->
+ <element ref="tns:Akagi" />
+ <element ref="tns:Anago" minOccurs="1" maxOccurs="2" />
+ <element ref="tns:Ebi" minOccurs="1" maxOccurs="unbounded" />
+ <element ref="tns:Uni" minOccurs="0" />
+ <element ref="tns:Ika" minOccurs="0" maxOccurs="unbounded" />
+ <element ref="tns:Hamachi" minOccurs="1" maxOccurs="unbounded" />
+ <element ref="tns:Ohtoro" minOccurs="0" maxOccurs="1" />
+
+ <any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/>
+ </sequence>
+ </complexType>
+ </element>
+
+</schema>
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiPropertyQNames.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiPropertyQNames.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiPropertyQNames.java (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiPropertyQNames.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,55 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.resource.properties;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Constants for QNames of elements defined in SushiProperties.xsd.
+ *
+ * @author Ian P. Springer (Hewlett-Packard Company)
+ */
+public interface SushiPropertyQNames
+{
+ /** DOCUMENT_ME */
+ QName OPEN_SUSHI_PROPERTIES =
+ new QName( "http://ws.apache.org/resource/properties/test/sushi", "OpenSushiProperties", "sushi" );
+
+ /** DOCUMENT_ME */
+ QName CLOSED_SUSHI_PROPERTIES =
+ new QName( "http://ws.apache.org/resource/properties/test/sushi", "ClosedSushiProperties", "sushi" );
+
+ /** DOCUMENT_ME */
+ QName AKAGI = new QName( "http://ws.apache.org/resource/properties/test/sushi", "Akagi", "sushi" );
+
+ /** DOCUMENT_ME */
+ QName HAMACHI = new QName( "http://ws.apache.org/resource/properties/test/sushi", "Hamachi", "sushi" );
+
+ /** DOCUMENT_ME */
+ QName EBI = new QName( "http://ws.apache.org/resource/properties/test/sushi", "Ebi", "sushi" );
+
+ /** DOCUMENT_ME */
+ QName IKA = new QName( "http://ws.apache.org/resource/properties/test/sushi", "Ika", "sushi" );
+
+ /** DOCUMENT_ME */
+ QName OHTORO = new QName( "http://ws.apache.org/resource/properties/test/sushi", "Ohtoro", "sushi" );
+
+ /** DOCUMENT_ME */
+ QName FUGU = new QName( "http://ws.apache.org/resource/properties/test/sushi/blowfish", "Fugu", "fu" );
+
+ /** DOCUMENT_ME */
+ QName UNI = new QName( "http://ws.apache.org/resource/properties/test/sushi", "Uni", "sushi" );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiResource.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiResource.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiResource.java (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiResource.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,157 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.resource.properties;
+
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.resource.PropertiesResource;
+import org.apache.ws.resource.Resource;
+import org.apache.ws.resource.lifetime.ResourceTerminationEvent;
+import org.apache.ws.resource.lifetime.ResourceTerminationListener;
+import org.apache.ws.resource.lifetime.impl.ResourceTerminationEventImpl;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Sal Campana
+ */
+public class SushiResource
+ implements Resource,
+ PropertiesResource
+{
+ /**
+ * The resource ID of the instance.
+ */
+ public String m_id;
+
+ /**
+ * The ResourceProperty Set containing the resource props.
+ */
+ ResourcePropertySet m_propSet;
+
+ /**
+ * A list of termination listeners to be notified when the resource is terminated.
+ */
+ private List m_terminationListeners = new ArrayList( );
+
+ /** The EndpointReference for this resource **/
+ protected EndpointReference m_endpointReference;
+
+ /**
+ * Sets the EndpointReference associated with this Resource.
+ *
+ * @param epr The EndpointReference for the Resource.
+ */
+ public void setEndpointReference( org.apache.ws.addressing.EndpointReference epr )
+ {
+ m_endpointReference = epr;
+ }
+
+ /**
+ * Returns the EndpointReference associated with this Resource.
+ *
+ * @return The Resource's EndpointReference or null if the EndpointReference has not been set.
+ *
+ * Note: It is the responsibility of the Resource creator to set the EndpointReference (i.e. ResourceHome impl)
+ */
+ public org.apache.ws.addressing.EndpointReference getEndpointReference( )
+ {
+ return m_endpointReference;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param id DOCUMENT_ME
+ */
+ public void setID( Object id )
+ {
+ if ( m_id != null )
+ {
+ throw new IllegalStateException( "This resource's ID has already been set." );
+ }
+
+ try
+ {
+ m_id = (String) id;
+ }
+ catch ( ClassCastException cce )
+ {
+ throw new IllegalArgumentException( "Specified ID is not a String." );
+ }
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Object getID( )
+ {
+ return m_id;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param propSet DOCUMENT_ME
+ */
+ public void setResourcePropertySet( ResourcePropertySet propSet )
+ {
+ m_propSet = propSet;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public ResourcePropertySet getResourcePropertySet( )
+ {
+ return m_propSet;
+ }
+
+ /**
+ * Adds a listener to be invoked when the resource has been terminated.
+ *
+ * @param listener
+ */
+ public void addTerminationListener( ResourceTerminationListener listener )
+ {
+ m_terminationListeners.add( listener );
+ }
+
+ /**
+ * DOCUMENT_ME
+ */
+ public void destroy( )
+ {
+ ResourceTerminationEvent rte = new ResourceTerminationEventImpl( getID( ),
+ "Job Destroyed" );
+ for ( int i = 0; i < m_terminationListeners.size( ); i++ )
+ {
+ ResourceTerminationListener resourceTerminationListener =
+ (ResourceTerminationListener) m_terminationListeners.get( i );
+ resourceTerminationListener.terminationOccurred( rte );
+ }
+ }
+
+ /**
+ * DOCUMENT_ME
+ */
+ public void init( )
+ {
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiResourceContext.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiResourceContext.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiResourceContext.java (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiResourceContext.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,220 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.resource.properties;
+
+import org.apache.ws.resource.Resource;
+import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.ResourceException;
+import org.apache.ws.resource.ResourceHome;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.Iterator;
+
+/**
+ * Resource context that serves as part of the unit test fixture.
+ *
+ * @author Sal Campana
+ * @author Ian Springer
+ */
+public class SushiResourceContext
+ implements ResourceContext
+{
+ private static final String SERVICE_NAME = "sushi";
+
+ /** DOCUMENT_ME */
+ public static final String ID = "1212";
+
+ /** DOCUMENT_ME */
+ ResourceHome m_home;
+ private Resource m_resource;
+
+ /**
+ * Creates a new {@link SushiResourceContext} object.
+ */
+ public SushiResourceContext( )
+ throws Exception
+ {
+ this( true );
+ }
+
+ /**
+ * Creates a new {@link SushiResourceContext} object.
+ */
+ public SushiResourceContext( boolean isOpenContent )
+ throws Exception
+ {
+ m_home = new SushiHome( isOpenContent );
+ m_resource = m_home.find( SushiResourceContext.ID );
+ }
+
+ /**
+ * Gets the base URL from which service urls are based.
+ *
+ * @return The String representation of the base url
+ */
+ public String getBaseURL( )
+ {
+ return null;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param name DOCUMENT_ME
+ * @param value DOCUMENT_ME
+ */
+ public void setProperty( String name,
+ Object value )
+ {
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param name DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Object getProperty( String name )
+ {
+ return null;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Iterator getPropertyNames( )
+ {
+ return null;
+ }
+
+ /**
+ * Returns the value of the WS-Addressing Action header
+ *
+ * @return WS-Addressing Action Header value
+ */
+ public String getRequestAction( )
+ {
+ return null;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ *
+ * @throws ResourceException DOCUMENT_ME
+ */
+ public Resource getResource( )
+ throws ResourceException
+ {
+ return m_resource;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public ResourceHome getResourceHome( )
+ {
+ return m_home;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param action DOCUMENT_ME
+ */
+ public void setResponseAction( URI action )
+ {
+ return;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public SOAPMessage getSOAPMessage( )
+ {
+ try
+ {
+ return MessageFactory.newInstance( ).createMessage( );
+ }
+ catch ( SOAPException soape )
+ {
+ throw new JAXRPCException( soape );
+ }
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getServiceName( )
+ {
+ return SERVICE_NAME;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public URL getServiceURL( )
+ {
+ try
+ {
+ return new URL( "http://localhost:8080/muse/" + SERVICE_NAME );
+ }
+ catch ( MalformedURLException murle )
+ {
+ murle.printStackTrace( );
+ }
+
+ return null;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param name DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public boolean containsProperty( String name )
+ {
+ return false;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param name DOCUMENT_ME
+ */
+ public void removeProperty( String name )
+ {
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiService.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiService.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiService.java (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/SushiService.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,48 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.resource.properties;
+
+import org.apache.ws.resource.ResourceContext;
+
+/**
+ * @author Sal Campana
+ */
+public class SushiService
+ extends AbstractSushiService
+{
+ private ResourceContext m_resourceContext;
+
+ /**
+ * Creates a new {@link SushiService} object.
+ *
+ * @param resourceContext DOCUMENT_ME
+ */
+ public SushiService( ResourceContext resourceContext )
+ {
+ m_resourceContext = resourceContext;
+ init( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public ResourceContext getResourceContext( )
+ {
+ return m_resourceContext;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/ThrowsCallback.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/ThrowsCallback.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/ThrowsCallback.java (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/ThrowsCallback.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,89 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.resource.properties;
+
+import org.apache.ws.resource.properties.impl.CallbackFailedException;
+import javax.xml.namespace.QName;
+
+/**
+ * @author Sal Campana
+ */
+public class ThrowsCallback
+ implements SetResourcePropertyCallback
+{
+ /**
+ * DOCUMENT_ME
+ *
+ * @param propQName DOCUMENT_ME
+ *
+ * @throws CallbackFailedException DOCUMENT_ME
+ */
+ public void deleteProperty( QName propQName )
+ throws CallbackFailedException
+ {
+ Exception e = new Exception( "Do we see this message?" );
+ throw new CallbackFailedException( "Delete Failed!", e );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param prop DOCUMENT_ME
+ *
+ * @throws CallbackFailedException DOCUMENT_ME
+ */
+ public void insertProperty( Object[] prop )
+ throws CallbackFailedException
+ {
+ Exception e = new Exception( "Do we see this message?" );
+ throw new CallbackFailedException( "Insert Failed!", e );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param prop DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ *
+ * @throws CallbackFailedException DOCUMENT_ME
+ */
+ public ResourceProperty refreshProperty( ResourceProperty prop )
+ throws CallbackFailedException
+ {
+ Exception e = new Exception( "Do we see this message?" );
+ throw new CallbackFailedException( "Refresh Failed!", e );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param prop DOCUMENT_ME
+ *
+ * @throws CallbackFailedException DOCUMENT_ME
+ */
+ public void updateProperty( Object[] prop )
+ throws CallbackFailedException
+ {
+ Exception e = new Exception( "Do we see this message?" );
+ throw new CallbackFailedException( "Update Failed!", e );
+ }
+
+ private QName getPropName( ResourceProperty prop )
+ {
+ return prop.getMetaData( ).getName( );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/impl/XmlBeansResourcePropertySetMetaDataTestCase.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/impl/XmlBeansResourcePropertySetMetaDataTestCase.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/impl/XmlBeansResourcePropertySetMetaDataTestCase.java (added)
+++ webservices/muse/branches/1.0/src/test/org/apache/ws/resource/properties/impl/XmlBeansResourcePropertySetMetaDataTestCase.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,109 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.resource.properties.impl;
+
+import junit.framework.Test;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+import org.apache.ws.resource.properties.AbstractResourcePropertiesTestCase;
+import org.apache.ws.resource.properties.ResourcePropertyMetaData;
+import org.apache.ws.resource.properties.SushiPropertyQNames;
+
+/**
+ * Test case for {@link XmlBeansResourcePropertySet}.
+ *
+ * @author Ian P. Springer
+ */
+public class XmlBeansResourcePropertySetMetaDataTestCase
+ extends AbstractResourcePropertiesTestCase
+{
+ /**
+ * DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ */
+ public void setUp( )
+ throws Exception
+ {
+ initResourcePropsDoc( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param args DOCUMENT_ME
+ */
+ public static void main( String[] args )
+ {
+ TestResult result = TestRunner.run( XmlBeansResourcePropertySetMetaDataTestCase.suite( ) );
+ if ( !result.wasSuccessful( ) )
+ {
+ System.exit( 1 );
+ }
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public static Test suite( )
+ {
+ return new TestSuite( XmlBeansResourcePropertySetMetaDataTestCase.class );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ */
+ public void testGetName( )
+ throws Exception
+ {
+ assertEquals( SushiPropertyQNames.OPEN_SUSHI_PROPERTIES,
+ m_resourcePropSet.getMetaData( ).getName( ) );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ */
+ public void testIsOpenContent( )
+ throws Exception
+ {
+ assertTrue( m_resourcePropSet.getMetaData( ).isOpenContent( ) );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ */
+ public void testPropertyMetaDatas( )
+ throws Exception
+ {
+ ResourcePropertyMetaData[] propMetaDatas = m_resourcePropSet.getMetaData( ).getPropertyMetaDatas( );
+ assertEquals( 9, propMetaDatas.length );
+ for ( int i = 0; i < propMetaDatas.length; i++ )
+ {
+ boolean expectedReadOnly = propMetaDatas[i].getName( ).equals( SushiPropertyQNames.OHTORO );
+ assertEquals( expectedReadOnly,
+ propMetaDatas[i].isReadOnly( ) );
+ }
+ }
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org