Author: dblevins
Date: Mon Oct  1 05:21:33 2012
New Revision: 1392213

URL: http://svn.apache.org/viewvc?rev=1392213&view=rev
Log:
TOMEE-438 - EJB JAX-RS Resources should work independently of other "views"
Test for when a bean is both an @WebService and @Path (JAX-WS and JAX-RS on the 
same bean)

Added:
    
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/
    
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/
    
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/ExcludedBean.java
   (with props)
    
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/ExcludedLocal.java
   (with props)
    
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/IncludedBean.java
   (with props)
    
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/IncludedLocal.java
   (with props)
    
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/RestEjbBusinessLocalTest.java
   (with props)
    
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/
    
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/ExplicitBean.java
   (with props)
    
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/ImpliedBean.java
   (with props)
    
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/RestEjbLocalBeanTest.java
   (with props)
    
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxws/wsrs/
    
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxws/wsrs/Bean.java
   (with props)
    
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxws/wsrs/WsRsTest.java
   (with props)
Modified:
    
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/ProxyEJB.java
    
openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java

Added: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/ExcludedBean.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/ExcludedBean.java?rev=1392213&view=auto
==============================================================================
--- 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/ExcludedBean.java
 (added)
+++ 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/ExcludedBean.java
 Mon Oct  1 05:21:33 2012
@@ -0,0 +1,34 @@
+/*
+ * 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.openejb.arquillian.tests.jaxrs.ejb.business;
+
+import javax.ejb.Singleton;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Singleton
+@Path("/rs/excluded")
+public class ExcludedBean implements ExcludedLocal{
+
+    @GET
+    public String message() {
+        return "green";
+    }
+}

Propchange: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/ExcludedBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/ExcludedLocal.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/ExcludedLocal.java?rev=1392213&view=auto
==============================================================================
--- 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/ExcludedLocal.java
 (added)
+++ 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/ExcludedLocal.java
 Mon Oct  1 05:21:33 2012
@@ -0,0 +1,26 @@
+/*
+ * 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.openejb.arquillian.tests.jaxrs.ejb.business;
+
+import javax.ejb.Local;
+
+/**
+* @version $Rev$ $Date$
+*/
+@Local
+public interface ExcludedLocal {
+}

Propchange: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/ExcludedLocal.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/IncludedBean.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/IncludedBean.java?rev=1392213&view=auto
==============================================================================
--- 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/IncludedBean.java
 (added)
+++ 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/IncludedBean.java
 Mon Oct  1 05:21:33 2012
@@ -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.openejb.arquillian.tests.jaxrs.ejb.business;
+
+import javax.ejb.Singleton;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Singleton
+@Path("/rs/included")
+public class IncludedBean implements IncludedLocal {
+
+    @GET
+    public String message() {
+        return "orange";
+    }
+
+}

Propchange: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/IncludedBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/IncludedLocal.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/IncludedLocal.java?rev=1392213&view=auto
==============================================================================
--- 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/IncludedLocal.java
 (added)
+++ 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/IncludedLocal.java
 Mon Oct  1 05:21:33 2012
@@ -0,0 +1,27 @@
+/*
+ * 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.openejb.arquillian.tests.jaxrs.ejb.business;
+
+import javax.ejb.Local;
+
+/**
+* @version $Rev$ $Date$
+*/
+@Local
+public interface IncludedLocal {
+    public String message();
+}

Propchange: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/IncludedLocal.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/RestEjbBusinessLocalTest.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/RestEjbBusinessLocalTest.java?rev=1392213&view=auto
==============================================================================
--- 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/RestEjbBusinessLocalTest.java
 (added)
+++ 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/RestEjbBusinessLocalTest.java
 Mon Oct  1 05:21:33 2012
@@ -0,0 +1,46 @@
+/*
+ * 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.openejb.arquillian.tests.jaxrs.ejb.business;
+
+import junit.framework.Assert;
+import org.apache.openejb.arquillian.tests.jaxrs.JaxrsTest;
+import org.apache.ziplock.WebModule;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@RunWith(Arquillian.class)
+public class RestEjbBusinessLocalTest extends JaxrsTest {
+
+    @Deployment(testable = false)
+    public static WebArchive archive() {
+        return new WebModule(RestEjbBusinessLocalTest.class).getArchive();
+    }
+
+    @Test
+    public void invoke() throws Exception {
+        // http://localhost:11080/ScannedApplicationTest/echo/.
+        Assert.assertEquals("orange", get("rs/included"));
+        Assert.assertEquals("green", get("rs/excluded"));
+    }
+
+}

Propchange: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/business/RestEjbBusinessLocalTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/ExplicitBean.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/ExplicitBean.java?rev=1392213&view=auto
==============================================================================
--- 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/ExplicitBean.java
 (added)
+++ 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/ExplicitBean.java
 Mon Oct  1 05:21:33 2012
@@ -0,0 +1,34 @@
+/*
+ * 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.openejb.arquillian.tests.jaxrs.ejb.localbean;
+
+import javax.ejb.Singleton;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Singleton
+@Path("/rs/explicit")
+public class ExplicitBean {
+
+    @GET
+    public String message() {
+        return "green";
+    }
+}

Propchange: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/ExplicitBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/ImpliedBean.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/ImpliedBean.java?rev=1392213&view=auto
==============================================================================
--- 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/ImpliedBean.java
 (added)
+++ 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/ImpliedBean.java
 Mon Oct  1 05:21:33 2012
@@ -0,0 +1,34 @@
+/*
+ * 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.openejb.arquillian.tests.jaxrs.ejb.localbean;
+
+import javax.ejb.Singleton;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Singleton
+@Path("/rs/implied")
+public class ImpliedBean {
+
+    @GET
+    public String message() {
+        return "orange";
+    }
+}

Propchange: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/ImpliedBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/RestEjbLocalBeanTest.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/RestEjbLocalBeanTest.java?rev=1392213&view=auto
==============================================================================
--- 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/RestEjbLocalBeanTest.java
 (added)
+++ 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/RestEjbLocalBeanTest.java
 Mon Oct  1 05:21:33 2012
@@ -0,0 +1,46 @@
+/*
+ * 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.openejb.arquillian.tests.jaxrs.ejb.localbean;
+
+import junit.framework.Assert;
+import org.apache.openejb.arquillian.tests.jaxrs.JaxrsTest;
+import org.apache.ziplock.WebModule;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@RunWith(Arquillian.class)
+public class RestEjbLocalBeanTest extends JaxrsTest {
+
+    @Deployment(testable = false)
+    public static WebArchive archive() {
+        return new WebModule(RestEjbLocalBeanTest.class).getArchive();
+    }
+
+    @Test
+    public void invoke() throws Exception {
+        // http://localhost:11080/ScannedApplicationTest/echo/.
+        Assert.assertEquals("orange", get("rs/implied"));
+        Assert.assertEquals("green", get("rs/explicit"));
+    }
+
+}

Propchange: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ejb/localbean/RestEjbLocalBeanTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxws/wsrs/Bean.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxws/wsrs/Bean.java?rev=1392213&view=auto
==============================================================================
--- 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxws/wsrs/Bean.java
 (added)
+++ 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxws/wsrs/Bean.java
 Mon Oct  1 05:21:33 2012
@@ -0,0 +1,38 @@
+/*
+ * 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.openejb.arquillian.tests.jaxws.wsrs;
+
+import javax.ejb.LocalBean;
+import javax.ejb.Singleton;
+import javax.jws.WebService;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@Singleton
+@WebService
+@Path("/rest/bean")
+@LocalBean
+public class Bean {
+
+    @GET
+    public String hello() {
+        return "hola";
+    }
+}

Propchange: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxws/wsrs/Bean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxws/wsrs/WsRsTest.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxws/wsrs/WsRsTest.java?rev=1392213&view=auto
==============================================================================
--- 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxws/wsrs/WsRsTest.java
 (added)
+++ 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxws/wsrs/WsRsTest.java
 Mon Oct  1 05:21:33 2012
@@ -0,0 +1,104 @@
+/*
+ * 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.openejb.arquillian.tests.jaxws.wsrs;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.ziplock.IO;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URL;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@RunWith(Arquillian.class)
+public class WsRsTest {
+
+    @ArquillianResource
+    private URL url;
+
+    protected HttpClient client = new DefaultHttpClient();
+
+    @Deployment(testable = false)
+    public static WebArchive createDeployment() {
+        return ShrinkWrap.create(WebArchive.class, 
WsRsTest.class.getName().concat(".war"))
+                .addClasses(Bean.class);
+    }
+
+    @Test
+    public void invokeWebService() throws Exception {
+        final URI uri = new URI(url.toExternalForm() + "webservices/Bean");
+
+        final HttpPost post = new HttpPost(uri);
+        post.setEntity(new StringEntity("" +
+                "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
+                "<soap:Envelope 
xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\";>\n" +
+                "  <soap:Body>\n" +
+                "    <ns1:hello 
xmlns:ns1=\"http://wsrs.jaxws.tests.arquillian.openejb.apache.org/\"/>\n" +
+                "  </soap:Body>\n" +
+                "</soap:Envelope>"));
+
+        final HttpResponse response = client.execute(post);
+        final String body = asString(response);
+
+        final String expected = "" +
+                "<soap:Envelope 
xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\";>" +
+                "<soap:Body>" +
+                "<ns2:helloResponse 
xmlns:ns2=\"http://wsrs.jaxws.tests.arquillian.openejb.apache.org/\";>" +
+                "<return>hola</return>" +
+                "</ns2:helloResponse>" +
+                "</soap:Body>" +
+                "</soap:Envelope>";
+
+        Assert.assertEquals(expected, body);
+    }
+
+    @Test
+    public void invokeRest() throws Exception {
+        final URI uri = new URI(url.toExternalForm() + "rest/bean");
+
+        final HttpGet get = new HttpGet(uri);
+        final HttpResponse response = client.execute(get);
+        final String body = asString(response);
+
+        Assert.assertEquals("hola", body);
+    }
+
+    public static String asString(HttpResponse execute) throws IOException {
+        final InputStream in = execute.getEntity().getContent();
+        try {
+            return IO.slurp(in);
+        } finally {
+            in.close();
+        }
+    }
+}

Propchange: 
openejb/trunk/openejb/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxws-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxws/wsrs/WsRsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/ProxyEJB.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/ProxyEJB.java?rev=1392213&r1=1392212&r2=1392213&view=diff
==============================================================================
--- 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/ProxyEJB.java
 (original)
+++ 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/ProxyEJB.java
 Mon Oct  1 05:21:33 2012
@@ -29,17 +29,9 @@ public class ProxyEJB {
         // no-op
     }
 
-    public static Object proxy(final BeanContext beanContext) {
-        if (beanContext.getBusinessLocalInterface() != null) {
-            return proxy(beanContext, new Class<?>[] { 
beanContext.getBusinessLocalInterface() });
-        }
-        if (beanContext.isLocalbean()) {
-            return proxy(beanContext, new 
Class<?>[]{beanContext.getBusinessLocalBeanInterface()});
-        }
-        if (beanContext.getBusinessRemoteInterface() != null) {
-            return proxy(beanContext, new Class<?>[] { 
beanContext.getBusinessRemoteInterface() });
-        }
-        throw new IllegalArgumentException("can't proxy " + 
beanContext.getEjbName());
+    public static Object subclassProxy(final BeanContext beanContext) {
+        final Class beanClass = beanContext.getBeanClass();
+        return 
LocalBeanProxyFactory.newProxyInstance(beanClass.getClassLoader(), new 
Handler(beanContext), beanClass, IntraVmProxy.class, Serializable.class);
     }
 
     public static Object proxy(final BeanContext beanContext, final Class<?>[] 
itfs) {

Modified: 
openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java?rev=1392213&r1=1392212&r2=1392213&view=diff
==============================================================================
--- 
openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
 (original)
+++ 
openejb/trunk/openejb/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
 Mon Oct  1 05:21:33 2012
@@ -97,7 +97,7 @@ public class CxfRsHttpListener implement
 
     @Override
     public void deployEJB(String fullContext, BeanContext beanContext, 
Collection<Object> additionalProviders, ServiceConfiguration configuration) {
-        final Object proxy = ProxyEJB.proxy(beanContext);
+        final Object proxy = ProxyEJB.subclassProxy(beanContext);
         deploy(beanContext.getBeanClass(), fullContext, new 
NoopResourceProvider(beanContext.getBeanClass(), proxy),
                 proxy, null, new OpenEJBEJBInvoker(), additionalProviders, 
configuration);
     }


Reply via email to