Propchange:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactoryImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactoryImpl.java?rev=573429&view=auto
==============================================================================
---
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactoryImpl.java
(added)
+++
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactoryImpl.java
Thu Sep 6 19:44:44 2007
@@ -0,0 +1,78 @@
+/**
+ * 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.cxf.jaxrs.provider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.ws.rs.ext.EntityProvider;
+import javax.ws.rs.ext.HeaderProvider;
+import javax.ws.rs.ext.ProviderFactory;
+
+
+//NOTE: ProviderFactory should provide a method that can pass in media types
+public class ProviderFactoryImpl extends ProviderFactory {
+ protected List<EntityProvider> entityProviders = new
ArrayList<EntityProvider>();
+ protected List<HeaderProvider> headerProviders = new
ArrayList<HeaderProvider>();
+
+ public ProviderFactoryImpl() {
+ //TODO: search for EntityProviders from classpath or config file.
+ entityProviders.add(new JAXBElementProvider());
+ //sort();
+ }
+
+ public <T> T createInstance(Class<T> type) {
+ //TODO:
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> EntityProvider<T> createEntityProvider(Class<T> type) {
+ for (EntityProvider<T> ep : entityProviders) {
+ if (ep.supports(type)) {
+ return ep;
+ }
+ }
+
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> HeaderProvider<T> createHeaderProvider(Class<T> type) {
+ for (HeaderProvider<T> hp : headerProviders) {
+ if (hp.supports(type)) {
+ return hp;
+ }
+ }
+
+ return null;
+ }
+
+ /*
+ * sorts the available providers according to the media types they declare
support for.
+ * Sorting of media types follows the general rule: x/y < * x < *, i.e. a
provider that
+ * explicitly lists a media types is sorted before a provider that lists
*.
+ * Quality parameter values are also used such that x/y;q=1.0 < x/y;q=0.7.
+ */
+ protected void sort() {
+
+ }
+
+}
Propchange:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactoryImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactoryImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/bus-extensions.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/bus-extensions.xml?rev=573429&view=auto
==============================================================================
---
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/bus-extensions.xml
(added)
+++
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/bus-extensions.xml
Thu Sep 6 19:44:44 2007
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<extensions xmlns="http://cxf.apache.org/bus/extension">
+
+ <extension class="org.apache.cxf.jaxrs.JAXRSBindingFactory"
+ interface="org.apache.cxf.binding.BindingFactory" deferred="true">
+ <namespace>http://apache.org/cxf/binding/jaxrs</namespace>
+ </extension>
+
+</extensions>
Propchange:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/bus-extensions.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/bus-extensions.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/bus-extensions.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf-extension-jaxrs-binding.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf-extension-jaxrs-binding.xml?rev=573429&view=auto
==============================================================================
---
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf-extension-jaxrs-binding.xml
(added)
+++
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf-extension-jaxrs-binding.xml
Thu Sep 6 19:44:44 2007
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:foo="http://cxf.apache.org/configuration/foo"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean class="org.apache.cxf.jaxrs.JAXRSBindingFactory" lazy-init="true">
+ <property name="activationNamespaces">
+ <set>
+ <value>http://apache.org/cxf/binding/jaxrs</value>
+ </set>
+ </property>
+ <property name="bus" ref="cxf"/>
+ </bean>
+</beans>
Propchange:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf-extension-jaxrs-binding.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf-extension-jaxrs-binding.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf-extension-jaxrs-binding.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf.extension
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf.extension?rev=573429&view=auto
==============================================================================
---
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf.extension
(added)
+++
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf.extension
Thu Sep 6 19:44:44 2007
@@ -0,0 +1 @@
+META-INF/cxf/cxf-extension-jaxrs-binding.xml
\ No newline at end of file
Added:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/services/javax.ws.rs.ext.ProviderFactory
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/services/javax.ws.rs.ext.ProviderFactory?rev=573429&view=auto
==============================================================================
---
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/services/javax.ws.rs.ext.ProviderFactory
(added)
+++
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/resources/META-INF/services/javax.ws.rs.ext.ProviderFactory
Thu Sep 6 19:44:44 2007
@@ -0,0 +1 @@
+org.apache.cxf.jaxrs.provider.ProviderFactoryImpl
\ No newline at end of file
Modified:
incubator/cxf/branches/jliu/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractServiceFactory.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractServiceFactory.java?rev=573429&r1=573428&r2=573429&view=diff
==============================================================================
---
incubator/cxf/branches/jliu/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractServiceFactory.java
(original)
+++
incubator/cxf/branches/jliu/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractServiceFactory.java
Thu Sep 6 19:44:44 2007
@@ -23,7 +23,8 @@
import org.apache.cxf.service.ServiceBuilder;
import org.apache.cxf.service.model.ServiceInfo;
-public abstract class AbstractServiceFactory extends AbstractEndpointFactory
implements ServiceBuilder {
+public abstract class AbstractServiceFactory extends
AbstractWSDLBasedEndpointFactory implements
+ ServiceBuilder {
public ServiceInfo createService() {
try {
return createEndpoint().getEndpointInfo().getService();
Modified:
incubator/cxf/branches/jliu/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java?rev=573429&r1=573428&r2=573429&view=diff
==============================================================================
---
incubator/cxf/branches/jliu/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
(original)
+++
incubator/cxf/branches/jliu/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
Thu Sep 6 19:44:44 2007
@@ -31,7 +31,7 @@
import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
import org.apache.cxf.service.factory.ServiceConstructionException;
-public class ClientFactoryBean extends AbstractEndpointFactory {
+public class ClientFactoryBean extends AbstractWSDLBasedEndpointFactory {
private Client client;
public ClientFactoryBean() {
Modified:
incubator/cxf/branches/jliu/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java?rev=573429&r1=573428&r2=573429&view=diff
==============================================================================
---
incubator/cxf/branches/jliu/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
(original)
+++
incubator/cxf/branches/jliu/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
Thu Sep 6 19:44:44 2007
@@ -78,7 +78,7 @@
* sf.create();
* </pre>
*/
-public class ServerFactoryBean extends AbstractEndpointFactory {
+public class ServerFactoryBean extends AbstractWSDLBasedEndpointFactory {
private static final Logger LOG =
LogUtils.getL7dLogger(ServerFactoryBean.class);
private Server server;
Modified: incubator/cxf/branches/jliu/rt/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/rt/pom.xml?rev=573429&r1=573428&r2=573429&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/rt/pom.xml (original)
+++ incubator/cxf/branches/jliu/rt/pom.xml Thu Sep 6 19:44:44 2007
@@ -39,6 +39,7 @@
<module>bindings</module>
<module>frontend/simple</module>
<module>frontend/jaxws</module>
+ <module>frontend/jaxrs</module>
<module>frontend/js</module>
<module>transports/http</module>
<module>transports/http-jetty</module>
Modified: incubator/cxf/branches/jliu/systests/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/systests/pom.xml?rev=573429&r1=573428&r2=573429&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/systests/pom.xml (original)
+++ incubator/cxf/branches/jliu/systests/pom.xml Thu Sep 6 19:44:44 2007
@@ -289,6 +289,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-integration-jca</artifactId>
<version>${project.version}</version>
Added:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/Book.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/Book.java?rev=573429&view=auto
==============================================================================
---
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/Book.java
(added)
+++
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/Book.java
Thu Sep 6 19:44:44 2007
@@ -0,0 +1,48 @@
+/**
+ * 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.cxf.systest.jaxrs;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+
[EMAIL PROTECTED](name = "Book")
+public class Book {
+ private String name;
+ private long id;
+
+ public Book() {
+ }
+
+ public void setName(String n) {
+ name = n;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setId(long i) {
+ id = i;
+ }
+ public long getId() {
+ return id;
+ }
+
+}
Propchange:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/Book.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/Book.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java?rev=573429&view=auto
==============================================================================
---
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
(added)
+++
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
Thu Sep 6 19:44:44 2007
@@ -0,0 +1,49 @@
+/**
+ * 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.cxf.systest.jaxrs;
+
+
+import org.apache.cxf.jaxrs.JAXRSBindingFactory;
+import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class BookServer extends AbstractBusTestServerBase {
+
+ protected void run() {
+ JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
+ sf.setResourceClasses(BookStore.class);
+ sf.setBindingId(JAXRSBindingFactory.JAXRS_BINDING_ID);
+ sf.setAddress("http://localhost:9080/xml/");
+
+ sf.create();
+ }
+
+ public static void main(String[] args) {
+ try {
+ BookServer s = new BookServer();
+ s.start();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ System.exit(-1);
+ } finally {
+ System.out.println("done!");
+ }
+ }
+}
Propchange:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=573429&view=auto
==============================================================================
---
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
(added)
+++
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
Thu Sep 6 19:44:44 2007
@@ -0,0 +1,81 @@
+/**
+ * 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.cxf.systest.jaxrs;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.ws.rs.HttpMethod;
+import javax.ws.rs.UriParam;
+import javax.ws.rs.UriTemplate;
+import javax.ws.rs.core.HttpContext;
+import javax.ws.rs.core.UriInfo;
+
+
[EMAIL PROTECTED]("/bookstore/")
+public class BookStore {
+
+ @HttpContext UriInfo uriInfo;
+
+ public BookStore() {
+ }
+
+ @HttpMethod("GET")
+ public List<Book> getBooks() {
+ System.out.println("----invoking getBooks");
+ List<Book> books = new ArrayList<Book>(1);
+ Book book = new Book();
+ book.setId(123);
+ book.setName("CXF in Action");
+ books.add(book);
+/*
+ Book book1 = new Book();
+ book1.setId(124);
+ book1.setName("CXF in Action - 2");
+ books.add(book1);*/
+
+ return books;
+ }
+
+ @HttpMethod("GET")
+ @UriTemplate("/{bookId}/")
+ public Book getBook(@UriParam("bookId") String bookId) {
+ System.out.println("----invoking getBook with bookId: " + bookId);
+
+ Book book = new Book();
+ book.setId(123);
+ book.setName("CXF in Action");
+
+ return book;
+ }
+
+ @UriTemplate("/cd/{CDId}/")
+ public CD getCD(@UriParam("CDId") String cdId) {
+ System.out.println("----invoking getCD with cdId: " + cdId);
+ CD cd = new CD();
+ cd.setId(223);
+ cd.setName("BOHEMIAN RHAYSODY");
+
+ return cd;
+ }
+
+}
Propchange:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/CD.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/CD.java?rev=573429&view=auto
==============================================================================
---
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/CD.java
(added)
+++
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/CD.java
Thu Sep 6 19:44:44 2007
@@ -0,0 +1,48 @@
+/**
+ * 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.cxf.systest.jaxrs;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
[EMAIL PROTECTED](name = "CD")
+public class CD {
+ private String name;
+ private long id;
+
+ public CD() {
+ }
+
+ public void setName(String n) {
+ name = n;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setId(long i) {
+ id = i;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+}
Propchange:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/CD.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/CD.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=573429&view=auto
==============================================================================
---
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(added)
+++
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Thu Sep 6 19:44:44 2007
@@ -0,0 +1,65 @@
+/**
+ * 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.cxf.systest.jaxrs;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.logging.Logger;
+
+
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.io.CachedOutputStream;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase
{
+
+ @BeforeClass
+ public static void startServers() throws Exception {
+ assertTrue("server did not launch correctly",
launchServer(BookServer.class));
+ }
+
+ @Test
+ public void testGetBookWrapped() throws Exception {
+ String endpointAddress =
+ "http://localhost:9080/xmlwrapped/books/123";
+ URL url = new URL(endpointAddress);
+ InputStream in = url.openStream();
+ assertNotNull(in);
+
+ InputStream expected = getClass()
+
.getResourceAsStream("resources/expected_get_book123_xmlwrapped.txt");
+
+ //System.out.println("---" + getStringFromInputStream(in));
+ assertEquals(getStringFromInputStream(expected),
getStringFromInputStream(in));
+ }
+
+ private String getStringFromInputStream(InputStream in) throws Exception {
+ CachedOutputStream bos = new CachedOutputStream();
+ IOUtils.copy(in, bos);
+ in.close();
+ bos.close();
+ //System.out.println(bos.getOut().toString());
+ return bos.getOut().toString();
+ }
+
+}
Propchange:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date