From 2f187c12e2ceceb61ca2745463fcd7fbbb438b72 Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 16 Feb 2012 15:39:43 +0000 Subject: Rename beta3 tag to final name git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1245035 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/binding/rest/RESTBinding.java | 38 ---- .../sca/binding/rest/RESTBindingFactory.java | 36 ---- .../binding/rest/impl/RESTBindingFactoryImpl.java | 36 ---- .../sca/binding/rest/impl/RESTBindingImpl.java | 111 ---------- .../jaxrs/JAXRSOperationSelector.java | 43 ---- .../jaxrs/JAXRSOperationSelectorFactory.java | 35 ---- .../impl/JAXRSOperationSelectorFactoryImpl.java | 36 ---- .../jaxrs/impl/JAXRSOperationSelectorImpl.java | 45 ---- .../rpc/RPCOperationSelector.java | 43 ---- .../rpc/RPCOperationSelectorFactory.java | 35 ---- .../rpc/impl/RPCOperationSelectorFactoryImpl.java | 36 ---- .../rpc/impl/RPCOperationSelectorImpl.java | 45 ---- .../rest/wireformat/json/JSONWireFormat.java | 43 ---- .../wireformat/json/JSONWireFormatFactory.java | 34 --- .../json/impl/JSONWireFormatFactoryImpl.java | 36 ---- .../wireformat/json/impl/JSONWireFormatImpl.java | 48 ----- .../binding/rest/wireformat/xml/XMLWireFormat.java | 43 ---- .../rest/wireformat/xml/XMLWireFormatFactory.java | 34 --- .../xml/impl/XMLWireFormatFactoryImpl.java | 37 ---- .../wireformat/xml/impl/XMLWireFormatImpl.java | 48 ----- .../sca/binding/rest/xml/RESTBindingProcessor.java | 232 --------------------- ...che.tuscany.sca.binding.rest.RESTBindingFactory | 20 -- ...ionselector.jaxrs.JAXRSOperationSelectorFactory | 19 -- ...erationselector.rpc.RPCOperationSelectorFactory | 19 -- ...ding.rest.wireformat.json.JSONWireFormatFactory | 19 -- ...inding.rest.wireformat.xml.XMLWireFormatFactory | 19 -- ...ca.contribution.processor.StAXArtifactProcessor | 27 --- .../JAXRSOperationSelectorProcessorTestCase.java | 107 ---------- .../json/impl/JSONWireFormatProcessorTestCase.java | 133 ------------ .../rest/xml/RESTBindingProcessorTestCase.java | 93 --------- 30 files changed, 1550 deletions(-) delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/RESTBinding.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/RESTBindingFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/impl/RESTBindingFactoryImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/impl/RESTBindingImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelector.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelectorFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorFactoryImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/RPCOperationSelector.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/RPCOperationSelectorFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/impl/RPCOperationSelectorFactoryImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/impl/RPCOperationSelectorImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/JSONWireFormat.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/JSONWireFormatFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatFactoryImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/XMLWireFormat.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/XMLWireFormatFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/impl/XMLWireFormatFactoryImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/impl/XMLWireFormatImpl.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/xml/RESTBindingProcessor.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.RESTBindingFactory delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelectorFactory delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.operationselector.rpc.RPCOperationSelectorFactory delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.wireformat.json.JSONWireFormatFactory delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.wireformat.xml.XMLWireFormatFactory delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorProcessorTestCase.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatProcessorTestCase.java delete mode 100644 sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/xml/RESTBindingProcessorTestCase.java (limited to 'sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src') diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/RESTBinding.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/RESTBinding.java deleted file mode 100644 index dd01c37537..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/RESTBinding.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.common.http.HTTPHeader; - -/** - * REST binding model. - * - * @version $Rev$ $Date$ -*/ -public interface RESTBinding extends Binding { - QName TYPE = new QName(SCA11_TUSCANY_NS, "binding.rest"); - - public List getHttpHeaders(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/RESTBindingFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/RESTBindingFactory.java deleted file mode 100644 index 38d68d532a..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/RESTBindingFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest; - - -/** - * Factory for the REST binding model. - * - * @version $Rev$ $Date$ - */ -public interface RESTBindingFactory { - - /** - * Creates a new REST binding. - * @return a new REST binding - */ - RESTBinding createRESTBinding(); - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/impl/RESTBindingFactoryImpl.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/impl/RESTBindingFactoryImpl.java deleted file mode 100644 index 00d5584190..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/impl/RESTBindingFactoryImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.impl; - -import org.apache.tuscany.sca.binding.rest.RESTBinding; -import org.apache.tuscany.sca.binding.rest.RESTBindingFactory; - -/** - * Factory for the REST binding model. - * - * @version $Rev$ $Date$ - */ -public class RESTBindingFactoryImpl implements RESTBindingFactory { - - public RESTBinding createRESTBinding() { - return new RESTBindingImpl(); - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/impl/RESTBindingImpl.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/impl/RESTBindingImpl.java deleted file mode 100644 index 93b59de5a4..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/impl/RESTBindingImpl.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.OperationSelector; -import org.apache.tuscany.sca.assembly.WireFormat; -import org.apache.tuscany.sca.binding.rest.RESTBinding; -import org.apache.tuscany.sca.common.http.HTTPHeader; - - -/** - * Implementation of the HTTP binding model. - * - * @version $Rev$ $Date$ - */ -class RESTBindingImpl implements RESTBinding { - - private String name; - private String uri; - - private List httpHeaders = new ArrayList(); - - private WireFormat requestWireFormat; - private WireFormat responseWireFormat; - private OperationSelector operationSelector; - - public QName getType() { - return TYPE; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } - - public List getHttpHeaders() { - return this.httpHeaders; - } - - public boolean isUnresolved() { - return false; - } - - public void setUnresolved(boolean unresolved) { - // The sample binding is always resolved - } - - // Wireformat and Operation selection - - public WireFormat getRequestWireFormat() { - return requestWireFormat; - } - - public void setRequestWireFormat(WireFormat wireFormat) { - this.requestWireFormat = wireFormat; - } - - public WireFormat getResponseWireFormat() { - return responseWireFormat; - } - - public void setResponseWireFormat(WireFormat wireFormat) { - this.responseWireFormat = wireFormat; - } - - public OperationSelector getOperationSelector() { - return operationSelector; - } - - public void setOperationSelector(OperationSelector operationSelector) { - this.operationSelector = operationSelector; - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelector.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelector.java deleted file mode 100644 index aea3dce7ae..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelector.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.operationselector.jaxrs; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.OperationSelector; -import org.apache.tuscany.sca.assembly.xml.Constants; - -/** - * JAX_RS Operation Selector model - * - * @version $Rev$ $Date$ - */ -public interface JAXRSOperationSelector extends OperationSelector { - /** - * QName representing the REST JAX_RS Operation Selector extension - */ - public static final QName REST_OPERATION_SELECTOR_JAXRS_QNAME = new QName(Constants.SCA11_TUSCANY_NS, "operationSelector.jaxrs"); - - /** - * Return the QName identifying the operation selector - * @return the QName identifying the operation selector - */ - QName getSchemaName(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelectorFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelectorFactory.java deleted file mode 100644 index bdd3eca740..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelectorFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.operationselector.jaxrs; - - -/** - * JAX-RS Operation Selector model factory - * - * @version $Rev$ $Date$ - */ -public interface JAXRSOperationSelectorFactory { - - /** - * Create a new JAX-RS Operation Selector - * @return - */ - JAXRSOperationSelector createJAXRSOperationSelector(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorFactoryImpl.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorFactoryImpl.java deleted file mode 100644 index c47087e660..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorFactoryImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.operationselector.jaxrs.impl; - -import org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelector; -import org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelectorFactory; - -/** - * JAX-RS Operation Selector model factory implementation - * - * @version $Rev$ $Date$ - */ -public class JAXRSOperationSelectorFactoryImpl implements JAXRSOperationSelectorFactory { - - public JAXRSOperationSelector createJAXRSOperationSelector() { - return new JAXRSOperationSelectorImpl(); - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorImpl.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorImpl.java deleted file mode 100644 index ef214c3642..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.operationselector.jaxrs.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelector; - - -/** - * JAX-RS Operation Selector model implementation - * - * @version $Rev$ $Date$ - */ -public class JAXRSOperationSelectorImpl implements JAXRSOperationSelector { - - public QName getSchemaName() { - return JAXRSOperationSelector.REST_OPERATION_SELECTOR_JAXRS_QNAME; - } - - public boolean isUnresolved() { - return false; - } - - public void setUnresolved(boolean unresolved) { - - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/RPCOperationSelector.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/RPCOperationSelector.java deleted file mode 100644 index 7730a1e75e..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/RPCOperationSelector.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.operationselector.rpc; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.OperationSelector; -import org.apache.tuscany.sca.assembly.xml.Constants; - -/** - * RPC Operation Selector model - * - * @version $Rev$ $Date$ - */ -public interface RPCOperationSelector extends OperationSelector { - /** - * QName representing the RPC Operation Selector extension - */ - public static final QName REST_OPERATION_SELECTOR_RPC_QNAME = new QName(Constants.SCA11_TUSCANY_NS, "operationSelector.rpc"); - - /** - * Return the QName identifying the operation selector - * @return the QName identifying the operation selector - */ - QName getSchemaName(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/RPCOperationSelectorFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/RPCOperationSelectorFactory.java deleted file mode 100644 index 27a56c374d..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/RPCOperationSelectorFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.operationselector.rpc; - - -/** - * RPC Operation Selector model factory - * - * @version $Rev$ $Date$ - */ -public interface RPCOperationSelectorFactory { - - /** - * Create a new RPC Operation Selector - * @return - */ - RPCOperationSelector createRPCOperationSelector(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/impl/RPCOperationSelectorFactoryImpl.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/impl/RPCOperationSelectorFactoryImpl.java deleted file mode 100644 index 9e67f35bc0..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/impl/RPCOperationSelectorFactoryImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.operationselector.rpc.impl; - -import org.apache.tuscany.sca.binding.rest.operationselector.rpc.RPCOperationSelector; -import org.apache.tuscany.sca.binding.rest.operationselector.rpc.RPCOperationSelectorFactory; - -/** - * RPC Operation Selector model factory implementation - * - * @version $Rev$ $Date$ - */ -public class RPCOperationSelectorFactoryImpl implements RPCOperationSelectorFactory { - - public RPCOperationSelector createRPCOperationSelector() { - return new RPCOperationSelectorImpl(); - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/impl/RPCOperationSelectorImpl.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/impl/RPCOperationSelectorImpl.java deleted file mode 100644 index bca8218f8d..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/rpc/impl/RPCOperationSelectorImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.operationselector.rpc.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.binding.rest.operationselector.rpc.RPCOperationSelector; - - -/** - * RPC Operation Selector model implementation - * - * @version $Rev$ $Date$ - */ -public class RPCOperationSelectorImpl implements RPCOperationSelector { - - public QName getSchemaName() { - return RPCOperationSelector.REST_OPERATION_SELECTOR_RPC_QNAME; - } - - public boolean isUnresolved() { - return false; - } - - public void setUnresolved(boolean unresolved) { - - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/JSONWireFormat.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/JSONWireFormat.java deleted file mode 100644 index d9136da58e..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/JSONWireFormat.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.wireformat.json; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.WireFormat; - -/** - * JSON Wireformat model for REST Binding - * - * @version $Rev$ $Date$ - */ -public interface JSONWireFormat extends WireFormat { - - /** - * QName representing the JSON Wireformat for REST Binding - */ - public static final QName REST_WIREFORMAT_JSON_QNAME = new QName(SCA11_TUSCANY_NS, "wireFormat.json"); - - /** - * Return the QName identifying the wire format - * @return the QName identifying the wire format - */ - QName getSchemaName(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/JSONWireFormatFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/JSONWireFormatFactory.java deleted file mode 100644 index f297320b39..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/JSONWireFormatFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.wireformat.json; - -/** - * JSON Wireformat factory for REST Binding - * - * @version $Rev$ $Date$ - */ -public interface JSONWireFormatFactory { - - /** - * Create a new JSON wireformat for REST Binding - * @return the new JSON wire format - */ - JSONWireFormat createRESTWireFormatJSON(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatFactoryImpl.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatFactoryImpl.java deleted file mode 100644 index 0ddeb8e557..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatFactoryImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.wireformat.json.impl; - -import org.apache.tuscany.sca.binding.rest.wireformat.json.JSONWireFormat; -import org.apache.tuscany.sca.binding.rest.wireformat.json.JSONWireFormatFactory; - -/** - * JSON Wireformat factory implementation for REST Binding - * - * @version $Rev$ $Date$ - */ -public class JSONWireFormatFactoryImpl implements JSONWireFormatFactory { - - public JSONWireFormat createRESTWireFormatJSON() { - return new JSONWireFormatImpl(); - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatImpl.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatImpl.java deleted file mode 100644 index 0588477e79..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.wireformat.json.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.binding.rest.wireformat.json.JSONWireFormat; - -/** - * JSON Wireformat implementation for REST Binding - * - * @version $Rev$ $Date$ - */ -public class JSONWireFormatImpl implements JSONWireFormat { - - public QName getSchemaName() { - return JSONWireFormat.REST_WIREFORMAT_JSON_QNAME; - } - - public boolean isUnresolved() { - return false; - } - - public void setUnresolved(boolean unresolved) { - // no op - } - - public String toString() { - return "application/json"; - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/XMLWireFormat.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/XMLWireFormat.java deleted file mode 100644 index 7eff067cdc..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/XMLWireFormat.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.wireformat.xml; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.WireFormat; - -/** - * XML Wireformat model for REST Binding - * - * @version $Rev$ $Date$ - */ -public interface XMLWireFormat extends WireFormat { - - /** - * QName representing the XML Wireformat for REST Binding - */ - public static final QName REST_WIREFORMAT_XML_QNAME = new QName(SCA11_TUSCANY_NS, "wireFormat.xml"); - - /** - * Return the QName identifying the wire format - * @return the QName identifying the wire format - */ - QName getSchemaName(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/XMLWireFormatFactory.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/XMLWireFormatFactory.java deleted file mode 100644 index 82d9ad6132..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/XMLWireFormatFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.wireformat.xml; - -/** - * XML Wireformat factory for REST Binding - * - * @version $Rev$ $Date$ - */ -public interface XMLWireFormatFactory { - - /** - * Create a new XML wireformat for REST Binding - * @return the new XML wire format - */ - XMLWireFormat createRESTWireFormatXML(); -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/impl/XMLWireFormatFactoryImpl.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/impl/XMLWireFormatFactoryImpl.java deleted file mode 100644 index b6fd3d6aed..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/impl/XMLWireFormatFactoryImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.wireformat.xml.impl; - -import org.apache.tuscany.sca.binding.rest.wireformat.xml.XMLWireFormat; - -import org.apache.tuscany.sca.binding.rest.wireformat.xml.XMLWireFormatFactory; - -/** - * XML Wireformat factory implementation for REST Binding - * - * @version $Rev$ $Date$ - */ -public class XMLWireFormatFactoryImpl implements XMLWireFormatFactory { - - public XMLWireFormat createRESTWireFormatXML() { - return new XMLWireFormatImpl(); - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/impl/XMLWireFormatImpl.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/impl/XMLWireFormatImpl.java deleted file mode 100644 index c4199081c9..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/impl/XMLWireFormatImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.wireformat.xml.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.binding.rest.wireformat.xml.XMLWireFormat; - -/** - * XML Wireformat implementation for REST Binding - * - * @version $Rev$ $Date$ - */ -public class XMLWireFormatImpl implements XMLWireFormat { - - public QName getSchemaName() { - return XMLWireFormat.REST_WIREFORMAT_XML_QNAME; - } - - public boolean isUnresolved() { - return false; - } - - public void setUnresolved(boolean unresolved) { - // no op - } - - public String toString() { - return "application/xml"; - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/xml/RESTBindingProcessor.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/xml/RESTBindingProcessor.java deleted file mode 100644 index 81463b2889..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/xml/RESTBindingProcessor.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.xml; - -import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; -import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.assembly.Base; -import org.apache.tuscany.sca.assembly.OperationSelector; -import org.apache.tuscany.sca.assembly.WireFormat; -import org.apache.tuscany.sca.binding.rest.RESTBinding; -import org.apache.tuscany.sca.binding.rest.RESTBindingFactory; -import org.apache.tuscany.sca.common.http.HTTPHeader; -import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.ContributionReadException; -import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; -import org.apache.tuscany.sca.contribution.processor.ContributionWriteException; -import org.apache.tuscany.sca.contribution.processor.ProcessorContext; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.FactoryExtensionPoint; - -/** - * REST Binding Artifact Processor - * - * @version $Rev$ $Date$ - */ -public class RESTBindingProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor { - private static final QName HEADERS_QNAME = new QName(Base.SCA11_TUSCANY_NS, "http-headers"); - private static final QName HEADER_QNAME = new QName(Base.SCA11_TUSCANY_NS, "header"); - private static final QName RESPONSE_QNAME = new QName(Base.SCA11_TUSCANY_NS, "response"); - - private static final String NAME = "name"; - private static final String VALUE = "value"; - private static final String URI = "uri"; - - private RESTBindingFactory httpBindingFactory; - private StAXArtifactProcessor extensionProcessor; - - public RESTBindingProcessor(ExtensionPointRegistry extensionPoints, - StAXArtifactProcessor extensionProcessor, - StAXAttributeProcessor extensionAttributeProcessor) { - FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class); - this.httpBindingFactory = modelFactories.getFactory(RESTBindingFactory.class); - this.extensionProcessor = (StAXArtifactProcessor)extensionProcessor; - } - - public QName getArtifactType() { - return RESTBinding.TYPE; - } - - public Class getModelType() { - return RESTBinding.class; - } - - public RESTBinding read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException { - RESTBinding restBinding = httpBindingFactory.createRESTBinding(); - - /** - * - * - * - * - * - * - * - * - * - * - * - * - */ - while(reader.hasNext()) { - QName elementName = null; - int event = reader.getEventType(); - switch (event) { - case START_ELEMENT: - elementName = reader.getName(); - - if(RESTBinding.TYPE.equals(elementName)) { - - // binding attributes - String name = getString(reader, NAME); - if(name != null) { - restBinding.setName(name); - } - - String uri = getURIString(reader, URI); - if (uri != null) { - restBinding.setURI(uri); - } - break; - - } else if (HEADERS_QNAME.equals(elementName)) { - - // ignore wrapper element - break; - - } else if (HEADER_QNAME.equals(elementName)) { - - // header name/value pair - String name = getString(reader, NAME); - String value = getURIString(reader, VALUE); - - if(name != null) { - restBinding.getHttpHeaders().add(new HTTPHeader(name, value)); - } - break; - - } else if (RESPONSE_QNAME.equals(elementName)) { - - // skip response - reader.next(); - // and position to the next start_element event - while (reader.hasNext()) { - int sub_event = reader.getEventType(); - switch (sub_event) { - case START_ELEMENT: - elementName = reader.getName(); - break; - default: reader.next(); - } - break; - } - - // dispatch to read wire format for the response - Object extension = extensionProcessor.read(reader, context); - if (extension != null) { - if (extension instanceof WireFormat) { - restBinding.setResponseWireFormat((WireFormat)extension); - } - } - break; - } else { - // Read an extension element - Object extension = extensionProcessor.read(reader, context); - if (extension != null) { - if (extension instanceof WireFormat) { - restBinding.setRequestWireFormat((WireFormat)extension); - restBinding.setResponseWireFormat((WireFormat)extension); - } else if(extension instanceof OperationSelector) { - restBinding.setOperationSelector((OperationSelector)extension); - } - } - break; - } - - case END_ELEMENT: - elementName = reader.getName(); - - if(RESTBinding.TYPE.equals(elementName)) { - return restBinding; - } - break; - } - - - - // Read the next element - if (reader.hasNext()) { - reader.next(); - } - } - - return restBinding; - } - - public void write(RESTBinding restBinding, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException, XMLStreamException { - - writeStart(writer, RESTBinding.TYPE.getNamespaceURI(), RESTBinding.TYPE.getLocalPart()); - - // Write binding name - if (restBinding.getName() != null) { - writer.writeAttribute(NAME, restBinding.getName()); - } - - // Write binding URI - if (restBinding.getURI() != null) { - writer.writeAttribute(URI, restBinding.getURI()); - } - - // Write operation selectors - if ( restBinding.getOperationSelector() != null ) { - extensionProcessor.write(restBinding.getOperationSelector(), writer, context); - } - - // Write wire formats - if ( restBinding.getRequestWireFormat() != null ) { - extensionProcessor.write(restBinding.getRequestWireFormat(), writer, context); - } - - if ( restBinding.getResponseWireFormat() != null && restBinding.getRequestWireFormat() != restBinding.getResponseWireFormat()) { - writeStart(writer, RESPONSE_QNAME.getNamespaceURI(), RESPONSE_QNAME.getLocalPart()); - extensionProcessor.write(restBinding.getResponseWireFormat(), writer, context); - writeEnd(writer); - } - - - writeEnd(writer); - } - - - public void resolve(RESTBinding model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { - // Should not need to do anything here for now... - - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.RESTBindingFactory b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.RESTBindingFactory deleted file mode 100644 index e228ebc528..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.RESTBindingFactory +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. - -# Implementation class for model factory -org.apache.tuscany.sca.binding.rest.impl.RESTBindingFactoryImpl - diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelectorFactory b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelectorFactory deleted file mode 100644 index e108988ecf..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelectorFactory +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. - -# Implementation class for model factory -org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.impl.JAXRSOperationSelectorFactoryImpl \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.operationselector.rpc.RPCOperationSelectorFactory b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.operationselector.rpc.RPCOperationSelectorFactory deleted file mode 100644 index 7da7b6bf0e..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.operationselector.rpc.RPCOperationSelectorFactory +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. - -# Implementation class for model factory -org.apache.tuscany.sca.binding.rest.operationselector.rpc.impl.RPCOperationSelectorFactoryImpl \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.wireformat.json.JSONWireFormatFactory b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.wireformat.json.JSONWireFormatFactory deleted file mode 100644 index 8cc248c7d1..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.wireformat.json.JSONWireFormatFactory +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. - -# Implementation class for model factory -org.apache.tuscany.sca.binding.rest.wireformat.json.impl.JSONWireFormatFactoryImpl \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.wireformat.xml.XMLWireFormatFactory b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.wireformat.xml.XMLWireFormatFactory deleted file mode 100644 index 54d5635e59..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.wireformat.xml.XMLWireFormatFactory +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. - -# Implementation class for model factory -org.apache.tuscany.sca.binding.rest.wireformat.xml.impl.XMLWireFormatFactoryImpl \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor deleted file mode 100644 index d88cba48f6..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor +++ /dev/null @@ -1,27 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. - -# Implementation class for the artifact processor extension -org.apache.tuscany.sca.binding.rest.xml.RESTBindingProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#binding.rest,model=org.apache.tuscany.sca.binding.rest.RESTBinding,factory=org.apache.tuscany.sca.binding.rest.RESTBindingFactory - -# Implementation class for the wireFormat processor extension -org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#wireFormat.json,model=org.apache.tuscany.sca.binding.rest.wireformat.json.JSONWireFormat,factory=org.apache.tuscany.sca.binding.rest.wireformat.json.JSONWireFormatFactory -org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#wireFormat.xml,model=org.apache.tuscany.sca.binding.rest.wireformat.xml.XMLWireFormat,factory=org.apache.tuscany.sca.binding.rest.wireformat.xml.XMLWireFormatFactory - -# Implementation class for operationSelector processor extension -org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#operationSelector.jaxrs,model=org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelector,factory=org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelectorFactory -org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#operationSelector.rpc,model=org.apache.tuscany.sca.binding.rest.operationselector.rpc.RPCOperationSelector,factory=org.apache.tuscany.sca.binding.rest.operationselector.rpc.RPCOperationSelectorFactory \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorProcessorTestCase.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorProcessorTestCase.java deleted file mode 100644 index e808daff6d..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorProcessorTestCase.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.operationselector.jaxrs.impl; - -import java.io.ByteArrayOutputStream; -import java.io.StringReader; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.assembly.OperationSelector; -import org.apache.tuscany.sca.binding.rest.RESTBinding; -import org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelector; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.ProcessorContext; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * JSON wire format processor tests to verify properly processing of - * wireFormat content in binding configuration in the composite file - * - * @version $Rev$ $Date$ - */ -public class JAXRSOperationSelectorProcessorTestCase { - public static final String BINDING_WITH_OPERATION_SELECTOR = - "" - + "" - + ""; - - private static XMLInputFactory inputFactory; - private static XMLOutputFactory outputFactory; - private static ExtensibleStAXArtifactProcessor staxProcessor; - private static ProcessorContext context; - - @BeforeClass - public static void setUp() throws Exception { - DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry(); - inputFactory = XMLInputFactory.newInstance(); - outputFactory = XMLOutputFactory.newInstance(); - - context = new ProcessorContext(extensionPoints); - - StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory); - - } - - /** - * Tests the APIs: - * public OperationSelector getRequstOperationSelector(); - * - * @throws Exception - */ - @Test - public void testWireFormat() throws Exception { - XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(BINDING_WITH_OPERATION_SELECTOR)); - - RESTBinding binding = (RESTBinding)staxProcessor.read(reader, context); - Assert.assertNotNull(binding); - - OperationSelector operationSelector = binding.getOperationSelector(); - Assert.assertEquals(JAXRSOperationSelector.class, operationSelector.getClass().getInterfaces()[0]); - } - - @Test - public void testWriteWireFormat() throws Exception { - XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(BINDING_WITH_OPERATION_SELECTOR)); - - RESTBinding binding = (RESTBinding)staxProcessor.read(reader, context); - Assert.assertNotNull(binding); - reader.close(); - - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(binding, bos, context); - - // used for debug comparison - // System.out.println(BINDING_WITH_OPERATION_SELECTOR); - // System.out.println(bos.toString()); - - Assert.assertEquals(BINDING_WITH_OPERATION_SELECTOR, bos.toString()); - - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatProcessorTestCase.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatProcessorTestCase.java deleted file mode 100644 index 1528bb2f4f..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatProcessorTestCase.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.wireformat.json.impl; - -import java.io.ByteArrayOutputStream; -import java.io.StringReader; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.assembly.WireFormat; -import org.apache.tuscany.sca.binding.rest.RESTBinding; -import org.apache.tuscany.sca.binding.rest.wireformat.json.JSONWireFormat; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.ProcessorContext; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * JSON wire format processor tests to verify properly processing of - * wireFormat content in binding configuration in the composite file - * - * @version $Rev$ $Date$ - */ -public class JSONWireFormatProcessorTestCase { - - public static final String BINDING_WITH_WIRE_FORMAT = - "" - + "" - + ""; - - public static final String BINDING_WITH_RESPONSE_WIRE_FORMAT = - "" - + "" - + "" - + "" - + ""; - - - private static XMLInputFactory inputFactory; - private static XMLOutputFactory outputFactory; - private static ExtensibleStAXArtifactProcessor staxProcessor; - private static ProcessorContext context; - - @BeforeClass - public static void setUp() throws Exception { - DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry(); - inputFactory = XMLInputFactory.newInstance(); - outputFactory = XMLOutputFactory.newInstance(); - - context = new ProcessorContext(extensionPoints); - - StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory); - - } - - /** - * Tests the APIs: - * public WireFormat getRequstWireFormat(); - * - * @throws Exception - */ - @Test - public void testWireFormat() throws Exception { - XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(BINDING_WITH_WIRE_FORMAT)); - - RESTBinding binding = (RESTBinding)staxProcessor.read(reader, context); - Assert.assertNotNull(binding); - - WireFormat requestWireFormat = binding.getRequestWireFormat(); - Assert.assertEquals(JSONWireFormat.class, requestWireFormat.getClass().getInterfaces()[0]); - } - - /** - * Tests the APIs: - * public WireFormat getResponseWireFormat(); - * - * @throws Exception - */ - @Test - public void testResponseWireFormat() throws Exception { - XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(BINDING_WITH_RESPONSE_WIRE_FORMAT)); - - RESTBinding binding = (RESTBinding)staxProcessor.read(reader, context); - Assert.assertNotNull(binding); - - WireFormat responseWireFormat = binding.getResponseWireFormat(); - Assert.assertEquals(JSONWireFormat.class, responseWireFormat.getClass().getInterfaces()[0]); - } - - - @Test - public void testWriteWireFormat() throws Exception { - XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(BINDING_WITH_WIRE_FORMAT)); - - RESTBinding binding = (RESTBinding)staxProcessor.read(reader, context); - Assert.assertNotNull(binding); - reader.close(); - - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(binding, bos, context); - - // used for debug comparison - // System.out.println(BINDING_WITH_WIRE_FORMAT); - // System.out.println(bos.toString()); - - Assert.assertEquals(BINDING_WITH_WIRE_FORMAT, bos.toString()); - - } -} diff --git a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/xml/RESTBindingProcessorTestCase.java b/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/xml/RESTBindingProcessorTestCase.java deleted file mode 100644 index 55a539044d..0000000000 --- a/sca-java-2.x/tags/2.0-Beta3/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/xml/RESTBindingProcessorTestCase.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.tuscany.sca.binding.rest.xml; - -import java.io.StringReader; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.binding.rest.RESTBinding; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.ProcessorContext; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - - -/** - * @version $Rev$ $Date$ - */ -public class RESTBindingProcessorTestCase { - - private static final String COMPOSITE = - "" - + "" - + " " - + " " - + " " - + " " - + " " - + " " - + " " - + " " - + " " - + " " - + " " - + " " - + " " - + ""; - - private static XMLInputFactory inputFactory; - private static StAXArtifactProcessor staxProcessor; - private static ProcessorContext context; - - @BeforeClass - public static void setUp() throws Exception { - DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry(); - context = new ProcessorContext(extensionPoints); - inputFactory = XMLInputFactory.newInstance(); - - StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null); - } - - /** - * Test parsing valid composite definition. Valid composite populated with correct values expected. - * @throws Exception - */ - @Test - public void testLoadValidComposite() throws Exception { - XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(COMPOSITE)); - - Composite composite = (Composite)staxProcessor.read(reader, context); - RESTBinding binding = (RESTBinding) composite.getComponents().get(0).getServices().get(0).getBindings().get(0); - - Assert.assertNotNull(binding); - Assert.assertEquals(2, binding.getHttpHeaders().size()); - Assert.assertEquals("Cache-Control", binding.getHttpHeaders().get(0).getName()); - Assert.assertEquals("no-cache", binding.getHttpHeaders().get(0).getValue()); - } -} -- cgit v1.2.3