geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r884982 - in /geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests: ejb-ear/src/test/java/org/apache/geronimo/testsuite/enterprise/ejb/ ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ ejb-ejb/src/main/java/org/apa...
Date Fri, 27 Nov 2009 20:18:47 GMT
Author: djencks
Date: Fri Nov 27 20:18:46 2009
New Revision: 884982

URL: http://svn.apache.org/viewvc?rev=884982&view=rev
Log:
GERONIMO-4937 singleton ejb test, thanks Quintin Beukes

Added:
    geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/
    geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/
    geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonBean.java
  (with props)
    geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonLocal.java
  (with props)
    geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonRemote.java
  (with props)
    geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonBean.java
  (with props)
    geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonLocal.java
  (with props)
    geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/
    geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/
    geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet1.java
  (with props)
    geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet2.java
  (with props)
Modified:
    geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ear/src/test/java/org/apache/geronimo/testsuite/enterprise/ejb/EJBTest.java
    geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/webapp/WEB-INF/web.xml

Modified: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ear/src/test/java/org/apache/geronimo/testsuite/enterprise/ejb/EJBTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ear/src/test/java/org/apache/geronimo/testsuite/enterprise/ejb/EJBTest.java?rev=884982&r1=884981&r2=884982&view=diff
==============================================================================
--- geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ear/src/test/java/org/apache/geronimo/testsuite/enterprise/ejb/EJBTest.java
(original)
+++ geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ear/src/test/java/org/apache/geronimo/testsuite/enterprise/ejb/EJBTest.java
Fri Nov 27 20:18:46 2009
@@ -32,6 +32,7 @@
 import org.testng.annotations.Test;
 
 import org.apache.geronimo.test.hello.ejb.HelloRemote;
+import org.apache.geronimo.test.singleton.ejb.SingletonRemote;
 
 public class EJBTest extends TestSupport {
 
@@ -60,6 +61,46 @@
     }
 
     @Test
+    public void testClientSingletonInvocation() throws Exception {
+        Properties p = new Properties();
+    
+        p.put("java.naming.factory.initial", 
+              "org.apache.openejb.client.RemoteInitialContextFactory");
+        p.put("java.naming.provider.url", 
+              "127.0.0.1:4201");   
+        
+        InitialContext ctx = new InitialContext(p);
+        
+	SingletonRemote bean = (SingletonRemote)ctx.lookup("/SingletonBeanRemote");
+	
+	String response = bean.sayHi("foo bar");
+
+	System.out.println(response);
+
+	assertEquals("Singleton Hello foo bar", response);
+    }
+
+    @Test
+    public void testSingletonStartup() throws Exception {
+        Properties p = new Properties();
+    
+        p.put("java.naming.factory.initial", 
+              "org.apache.openejb.client.RemoteInitialContextFactory");
+        p.put("java.naming.provider.url", 
+              "127.0.0.1:4201");   
+        
+        InitialContext ctx = new InitialContext(p);
+        
+	SingletonRemote bean = (SingletonRemote)ctx.lookup("/SingletonBeanRemote");
+	
+	boolean startupInvoked = bean.isStartupInvoked();
+
+	System.out.println("Singleton Startup Invoked: " + startupInvoked);
+
+	assertTrue(startupInvoked);
+    }
+
+    @Test
     public void testInvocation1() throws Exception {
         testInvocation("/servlet1", "Hello foo");
     }
@@ -69,6 +110,16 @@
         testInvocation("/servlet2", "Hello bar");
     }
 
+    @Test
+    public void testSingletonInvocation1() throws Exception {
+        testInvocation("/singleton-servlet1", "Hello foo");
+    }
+
+    @Test
+    public void testSingletonInvocation2() throws Exception {
+        testInvocation("/singleton-servlet2", "Hello bar");
+    }
+
     private void testInvocation(String servlet, String expectedOutput) throws Exception {
         URL url = new URL(baseURL + servlet);
         HttpURLConnection conn = (HttpURLConnection) url.openConnection();

Added: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonBean.java?rev=884982&view=auto
==============================================================================
--- geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonBean.java
(added)
+++ geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonBean.java
Fri Nov 27 20:18:46 2009
@@ -0,0 +1,44 @@
+/*
+ *  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.geronimo.test.singleton.ejb;
+
+import javax.annotation.Resource;
+import javax.ejb.Singleton;
+
+@Singleton
+public class SingletonBean implements SingletonLocal, SingletonRemote {
+    /**
+     * Updated by the StartupSingletonBean's @PostConstruct
+     * If we read this value before lookup of the StartupSingletonBean we can
+     * determine if the PostConstruct was called
+     */
+    private boolean startupInvoked = false;
+
+    public String sayHi(String name) {
+        return "Singleton Hello " + name;
+    }
+
+    public boolean isStartupInvoked()
+    {
+    	return startupInvoked;
+    }
+
+    public void setStartupInvoked() {
+        startupInvoked = true;
+    }
+}

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonLocal.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonLocal.java?rev=884982&view=auto
==============================================================================
--- geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonLocal.java
(added)
+++ geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonLocal.java
Fri Nov 27 20:18:46 2009
@@ -0,0 +1,32 @@
+/**
+ * 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.geronimo.test.singleton.ejb;
+
+import javax.ejb.Local;
+
+@Local
+public interface SingletonLocal {
+
+    public String sayHi(String name);
+
+    public boolean isStartupInvoked();
+
+    public void setStartupInvoked();
+}
+
+

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonLocal.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonLocal.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonLocal.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonRemote.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonRemote.java?rev=884982&view=auto
==============================================================================
--- geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonRemote.java
(added)
+++ geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonRemote.java
Fri Nov 27 20:18:46 2009
@@ -0,0 +1,31 @@
+/**
+ * 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.geronimo.test.singleton.ejb;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface SingletonRemote {
+
+    public String sayHi(String name);
+
+    public boolean isStartupInvoked();
+    
+}
+
+

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonRemote.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonRemote.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/SingletonRemote.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonBean.java?rev=884982&view=auto
==============================================================================
--- geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonBean.java
(added)
+++ geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonBean.java
Fri Nov 27 20:18:46 2009
@@ -0,0 +1,37 @@
+/*
+ *  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.geronimo.test.singleton.ejb;
+
+import javax.annotation.PostConstruct;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.ejb.EJB;
+import javax.ejb.DependsOn;
+
+@Singleton
+@Startup
+@DependsOn({"SingletonBean"})
+public class StartupSingletonBean implements StartupSingletonLocal {
+    @EJB
+    private SingletonLocal singletonBean;
+
+    @PostConstruct
+    public void startup() {
+        singletonBean.setStartupInvoked();
+    }
+}

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonLocal.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonLocal.java?rev=884982&view=auto
==============================================================================
--- geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonLocal.java
(added)
+++ geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonLocal.java
Fri Nov 27 20:18:46 2009
@@ -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.geronimo.test.singleton.ejb;
+
+import javax.ejb.Local;
+
+@Local
+public interface StartupSingletonLocal {
+}
+
+

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonLocal.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonLocal.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-ejb/src/main/java/org/apache/geronimo/test/singleton/ejb/StartupSingletonLocal.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet1.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet1.java?rev=884982&view=auto
==============================================================================
--- geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet1.java
(added)
+++ geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet1.java
Fri Nov 27 20:18:46 2009
@@ -0,0 +1,44 @@
+/*
+ *  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.geronimo.test.singleton.web;
+
+import java.io.IOException;
+
+import javax.ejb.EJB;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.geronimo.test.singleton.ejb.SingletonLocal;
+
+public class Servlet1 extends HttpServlet {
+
+    @EJB
+    private SingletonLocal bm = null;
+	
+    protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException,
IOException {
+        String msg = bm.sayHi("foo");
+        res.getWriter().println(msg);
+    }
+
+    protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException,
IOException {
+        doGet(req,res);
+    }
+	
+}

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet1.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet1.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet1.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet2.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet2.java?rev=884982&view=auto
==============================================================================
--- geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet2.java
(added)
+++ geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet2.java
Fri Nov 27 20:18:46 2009
@@ -0,0 +1,44 @@
+/*
+ *  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.geronimo.test.singleton.web;
+
+import java.io.IOException;
+
+import javax.ejb.EJB;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.geronimo.test.singleton.ejb.SingletonLocal;
+
+public class Servlet2 extends HttpServlet {
+
+    @EJB
+    private SingletonLocal bm = null;
+	
+    protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException,
IOException {
+        String msg = bm.sayHi("bar");
+        res.getWriter().println(msg);
+    }
+
+    protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException,
IOException {
+        doGet(req,res);
+    }
+	
+}

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet2.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/java/org/apache/geronimo/test/singleton/web/Servlet2.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/webapp/WEB-INF/web.xml?rev=884982&r1=884981&r2=884982&view=diff
==============================================================================
--- geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/server/branches/2.2/testsuite/enterprise-testsuite/ejb-tests/ejb-war/src/main/webapp/WEB-INF/web.xml
Fri Nov 27 20:18:46 2009
@@ -34,6 +34,18 @@
 		<servlet-class>org.apache.geronimo.test.hello.web.Servlet2</servlet-class>
 	</servlet>
   	
+	<servlet>
+		<display-name>SingletonServlet1</display-name>
+		<servlet-name>SingletonServlet1</servlet-name>
+		<servlet-class>org.apache.geronimo.test.singleton.web.Servlet1</servlet-class>
+	</servlet>
+	
+	<servlet>
+		<display-name>SingletonServlet2</display-name>
+		<servlet-name>SingletonServlet2</servlet-name>
+		<servlet-class>org.apache.geronimo.test.singleton.web.Servlet2</servlet-class>
+	</servlet>
+  	
 	<servlet-mapping>
 		<servlet-name>Servlet1</servlet-name>
 		<url-pattern>/servlet1</url-pattern>
@@ -43,4 +55,14 @@
 		<servlet-name>Servlet2</servlet-name>
 		<url-pattern>/servlet2</url-pattern>
 	</servlet-mapping>
+
+	<servlet-mapping>
+		<servlet-name>SingletonServlet1</servlet-name>
+		<url-pattern>/singleton-servlet1</url-pattern>
+	</servlet-mapping>
+	
+	<servlet-mapping>
+		<servlet-name>SingletonServlet2</servlet-name>
+		<url-pattern>/singleton-servlet2</url-pattern>
+	</servlet-mapping>
 </web-app>



Mime
View raw message