You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2010/04/27 23:42:59 UTC
svn commit: r938685 - in /tuscany/sca-java-2.x/trunk/modules/binding-rest:
META-INF/
src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/
src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/
src/main/java/org/apach...
Author: lresende
Date: Tue Apr 27 21:42:59 2010
New Revision: 938685
URL: http://svn.apache.org/viewvc?rev=938685&view=rev
Log:
Adding model for JAX-RS operation selector
Added:
tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/
tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/
tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelector.java (with props)
tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelectorFactory.java (with props)
tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/
tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorFactoryImpl.java (with props)
tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorImpl.java (with props)
tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelectorFactory
tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/operationselector/
tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/
tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/
tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorProcessorTestCase.java
- copied, changed from r938684, tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatProcessorTestCase.java
Modified:
tuscany/sca-java-2.x/trunk/modules/binding-rest/META-INF/MANIFEST.MF
tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatProcessorTestCase.java
Modified: tuscany/sca-java-2.x/trunk/modules/binding-rest/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/META-INF/MANIFEST.MF?rev=938685&r1=938684&r2=938685&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/META-INF/MANIFEST.MF (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/META-INF/MANIFEST.MF Tue Apr 27 21:42:59 2010
@@ -1,5 +1,6 @@
Manifest-Version: 1.0
Export-Package: org.apache.tuscany.sca.binding.rest;version="2.0.0";uses:="org.apache.tuscany.sca.assembly,javax.xml.namespace,javax.servlet.http",
+ org.apache.tuscany.sca.binding.rest.operationselector.jaxrs,
org.apache.tuscany.sca.binding.rest.wireformat.json;version="2.0.0"
Bundle-Name: Apache Tuscany SCA REST Binding Model
Bundle-Vendor: The Apache Software Foundation
Added: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelector.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelector.java?rev=938685&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelector.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelector.java Tue Apr 27 21:42:59 2010
@@ -0,0 +1,43 @@
+/*
+ * 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();
+}
Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelector.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelector.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelectorFactory.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelectorFactory.java?rev=938685&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelectorFactory.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelectorFactory.java Tue Apr 27 21:42:59 2010
@@ -0,0 +1,35 @@
+/*
+ * 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();
+}
Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelectorFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/JAXRSOperationSelectorFactory.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorFactoryImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorFactoryImpl.java?rev=938685&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorFactoryImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorFactoryImpl.java Tue Apr 27 21:42:59 2010
@@ -0,0 +1,36 @@
+/*
+ * 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();
+ }
+
+}
Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorFactoryImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorFactoryImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorImpl.java?rev=938685&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorImpl.java Tue Apr 27 21:42:59 2010
@@ -0,0 +1,45 @@
+/*
+ * 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) {
+
+ }
+}
Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelectorFactory
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelectorFactory?rev=938685&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelectorFactory (added)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelectorFactory Tue Apr 27 21:42:59 2010
@@ -0,0 +1,19 @@
+# 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
Modified: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor?rev=938685&r1=938684&r2=938685&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor Tue Apr 27 21:42:59 2010
@@ -19,4 +19,5 @@
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
\ No newline at end of file
+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#operationSelector.jaxrs,model=org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelector,factory=org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.JAXRSOperationSelectorFactory
\ No newline at end of file
Copied: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorProcessorTestCase.java (from r938684, tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatProcessorTestCase.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorProcessorTestCase.java?p2=tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorProcessorTestCase.java&p1=tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatProcessorTestCase.java&r1=938684&r2=938685&rev=938685&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatProcessorTestCase.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/operationselector/jaxrs/impl/JAXRSOperationSelectorProcessorTestCase.java Tue Apr 27 21:42:59 2010
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.tuscany.sca.binding.rest.wireformat.json.impl;
+package org.apache.tuscany.sca.binding.rest.operationselector.jaxrs.impl;
import java.io.ByteArrayOutputStream;
import java.io.StringReader;
@@ -26,9 +26,9 @@ 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.assembly.OperationSelector;
import org.apache.tuscany.sca.binding.rest.RESTBinding;
-import org.apache.tuscany.sca.binding.rest.wireformat.json.JSONWireFormat;
+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;
@@ -44,11 +44,10 @@ import org.junit.Test;
*
* @version $Rev$ $Date$
*/
-public class JSONWireFormatProcessorTestCase {
-
- public static final String BINDING_WITH_WIRE_FORMAT =
+public class JAXRSOperationSelectorProcessorTestCase {
+ public static final String BINDING_WITH_OPERATION_SELECTOR =
"<binding.rest xmlns=\"http://tuscany.apache.org/xmlns/sca/1.1\" uri=\"http://localhost:8080/uri\">"
- + "<wireFormat.json />"
+ + "<operationSelector.jaxrs />"
+ "</binding.rest>";
private static XMLInputFactory inputFactory;
@@ -71,28 +70,24 @@ public class JSONWireFormatProcessorTest
/**
* Tests the APIs:
- * public WireFormat getRequstWireFormat();
- * public WireFormat getResponseWireFormat();
+ * public OperationSelector getRequstOperationSelector();
*
* @throws Exception
*/
@Test
public void testWireFormat() throws Exception {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(BINDING_WITH_WIRE_FORMAT));
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(BINDING_WITH_OPERATION_SELECTOR));
RESTBinding binding = (RESTBinding)staxProcessor.read(reader, context);
Assert.assertNotNull(binding);
- WireFormat requestWireFormat = binding.getRequestWireFormat();
- Assert.assertEquals(JSONWireFormat.class, requestWireFormat.getClass().getInterfaces()[0]);
-
- WireFormat responseWireFormat = binding.getResponseWireFormat();
- Assert.assertEquals(JSONWireFormat.class, responseWireFormat.getClass().getInterfaces()[0]);
+ 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_WIRE_FORMAT));
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(BINDING_WITH_OPERATION_SELECTOR));
RESTBinding binding = (RESTBinding)staxProcessor.read(reader, context);
Assert.assertNotNull(binding);
@@ -102,10 +97,11 @@ public class JSONWireFormatProcessorTest
staxProcessor.write(binding, bos, context);
// used for debug comparison
- System.out.println(BINDING_WITH_WIRE_FORMAT);
- System.out.println(bos.toString());
+ // System.out.println(BINDING_WITH_OPERATION_SELECTOR);
+ // System.out.println(bos.toString());
- Assert.assertEquals(BINDING_WITH_WIRE_FORMAT, bos.toString());
+ Assert.assertEquals(BINDING_WITH_OPERATION_SELECTOR, bos.toString());
}
+
}
Modified: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatProcessorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatProcessorTestCase.java?rev=938685&r1=938684&r2=938685&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatProcessorTestCase.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatProcessorTestCase.java Tue Apr 27 21:42:59 2010
@@ -102,8 +102,8 @@ public class JSONWireFormatProcessorTest
staxProcessor.write(binding, bos, context);
// used for debug comparison
- System.out.println(BINDING_WITH_WIRE_FORMAT);
- System.out.println(bos.toString());
+ // System.out.println(BINDING_WITH_WIRE_FORMAT);
+ // System.out.println(bos.toString());
Assert.assertEquals(BINDING_WITH_WIRE_FORMAT, bos.toString());