geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r987403 - in /geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test: ./ webbean-servlet-test/ webbean-servlet-test/src/ webbean-servlet-test/src/main/ webbean-servlet-test/src/main/java/ webbean-servlet-test/src/main/java/org/ w...
Date Fri, 20 Aug 2010 08:31:46 GMT
Author: xiaming
Date: Fri Aug 20 08:31:45 2010
New Revision: 987403

URL: http://svn.apache.org/viewvc?rev=987403&view=rev
Log:
GERONIMO-5538 add test for webbean+servlet, provided by Lu Jiang

Added:
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/pom.xml
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/CurrentDateProvider.java
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/InjectorServlet.java
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyDefault.java
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyFilter.java
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/beans.xml
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/geronimo-web.xml
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/web.xml
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/index.jsp
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/org/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/org/apache/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/org/apache/webbean/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/org/apache/webbean/sample/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/org/apache/webbean/sample/servlet/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/org/apache/webbean/sample/servlet/test/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/org/apache/webbean/sample/servlet/test/TestWebbeanServlet.java
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/resources/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/resources/testng.xml
  (with props)
Modified:
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/pom.xml

Modified: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/pom.xml?rev=987403&r1=987402&r2=987403&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/pom.xml (original)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/pom.xml Fri Aug 20 08:31:45
2010
@@ -44,6 +44,7 @@
 
     <modules>
         <module>conversation-test</module>
-        <module>webbean-ejb-test</module>			
+        <module>webbean-ejb-test</module>
+        <module>webbean-servlet-test</module>			
     </modules>
 </project>

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/pom.xml?rev=987403&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/pom.xml
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/pom.xml
Fri Aug 20 08:31:45 2010
@@ -0,0 +1,129 @@
+<?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.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.testsuite</groupId>
+        <artifactId>webbean1.0-test</artifactId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+
+
+    <artifactId>webbean-servlet-test</artifactId>
+    <name>Geronimo TestSuite :: Java EE 6 Testsuite :: Web Bean :: webbean-servlet-test</name>
+    <packaging>war</packaging>
+	<dependencies>       
+
+        <!-- JSR-299 API - Web Beans 1.0-->
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jcdi_1.0_spec</artifactId>
+			<scope>provided</scope>
+        </dependency>
+
+        <!-- JSR-330 API - Dependency Injection for Java 1.0-->
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-atinject_1.0_spec</artifactId>
+			<scope>provided</scope>
+        </dependency>
+		
+		<dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-servlet_3.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+      </dependencies>
+
+	  <build>
+		<plugins>
+			<plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-war-plugin</artifactId>
+                    <configuration>
+                        <archiveClasses>false</archiveClasses>
+                    </configuration>
+                </plugin>
+			</plugins>
+	  </build>
+     
+       <profiles>
+        <profile>
+            <id>it</id>
+            <activation>
+                <property>
+                    <name>it</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>selenium-maven-plugin</artifactId>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.geronimo.buildsupport</groupId>
+                        <artifactId>geronimo-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>deploy-wars</id>
+                                <phase>pre-integration-test</phase>
+                                <goals>
+                                    <goal>deploy-module</goal>
+                                </goals>
+                                <configuration>
+                                    <moduleArchive>${project.build.directory}/${project.artifactId}-${project.version}.war</moduleArchive>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>undeploy-war-as-moduleId</id>
+                                <phase>post-integration-test</phase>
+                                <goals>
+                                    <goal>undeploy-module</goal>
+                                </goals>
+                                <configuration>
+                                    <moduleId>${project.groupId}/${project.artifactId}/${project.version}/war</moduleId>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+					<plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>      
                     
+                        <configuration>                                
+                            <suiteXmlFiles>
+                                <suiteXmlFile>${project.build.testOutputDirectory}/testng.xml</suiteXmlFile>
+                            </suiteXmlFiles>
+							<testFailureIgnore>true</testFailureIgnore>
+                            <systemPropertyVariables>
+                                <appContext>${project.artifactId}</appContext>
+                            </systemPropertyVariables>
+                        </configuration>                            
+                    </plugin>
+                </plugins>
+            </build>
+	    </profile>
+       </profiles>
+</project>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/CurrentDateProvider.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/CurrentDateProvider.java?rev=987403&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/CurrentDateProvider.java
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/CurrentDateProvider.java
Fri Aug 20 08:31:45 2010
@@ -0,0 +1,41 @@
+/*
+ * 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.webbeans.samples.tomcat;
+
+import java.security.Principal;
+import java.util.Date;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+public class CurrentDateProvider
+{
+    private @Inject Principal principal;
+    
+    @Produces
+    public Date getCurrentDate()
+    {
+        return new Date();
+    }
+    
+    public Principal getPrincipal()
+    {
+        return principal;
+    }
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/CurrentDateProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/CurrentDateProvider.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/CurrentDateProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/InjectorServlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/InjectorServlet.java?rev=987403&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/InjectorServlet.java
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/InjectorServlet.java
Fri Aug 20 08:31:45 2010
@@ -0,0 +1,61 @@
+/*
+ * 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.webbeans.samples.tomcat;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class InjectorServlet extends HttpServlet
+{
+    private static final long serialVersionUID = 1L;
+
+    private @Inject CurrentDateProvider dateProvider;
+    
+    private @Inject BeanManager beanManager;
+         
+    @Override
+    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
IOException
+    {
+        PrintWriter writer = resp.getWriter();
+        writer.write("<p id='a'>==================Injection of Bean Instance into Servlet==================</p>");
+        writer.write("<p id='b'>Caller Principal name injection into DateProvider instance
: " + dateProvider.getPrincipal().getName() + "\n\n");
+        writer.write("<p id='c'>Current Date : " + dateProvider.toString());      

+        
+        writer.write("<p id='d'>==================Injection of BeanManager into Servlet==================</p>");
+        if(beanManager != null)
+        {
+            writer.write("<p id='e'>Injection of @Inject BeanManager into servlet is
successfull</p>");
+        }
+        else
+        {
+            writer.write("<p id='e'>Injection of @Inject BeanManager into servlet has
failed</p>");
+        }
+        
+    }
+    
+    
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/InjectorServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/InjectorServlet.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/InjectorServlet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyDefault.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyDefault.java?rev=987403&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyDefault.java
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyDefault.java
Fri Aug 20 08:31:45 2010
@@ -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.webbeans.samples.tomcat;
+
+import javax.enterprise.inject.Default;
+import javax.enterprise.util.AnnotationLiteral;
+/**
+ * Copy from org.apache.webbeans.annotation.DefaultLiteral
+ * to remove dependency on openwebbean impl. library.
+ */
+
+public class MyDefault extends AnnotationLiteral<Default> implements Default
+{
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyDefault.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyDefault.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyDefault.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyFilter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyFilter.java?rev=987403&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyFilter.java
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyFilter.java
Fri Aug 20 08:31:45 2010
@@ -0,0 +1,70 @@
+/*
+ * 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.webbeans.samples.tomcat;
+
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+import org.apache.webbeans.samples.tomcat.MyDefault;
+
+public class MyFilter implements Filter
+{
+    private @Inject BeanManager manager;
+
+    @Override
+    public void destroy()
+    {
+        
+        
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) throws
IOException, ServletException
+    {
+        Set<Bean<?>> beans = manager.getBeans(CurrentDateProvider.class, new
Annotation[]{new MyDefault()});        
+        System.out.println("Total found beans : " + beans.size());
+        Bean<CurrentDateProvider> provider = (Bean<CurrentDateProvider>)beans.iterator().next();
+        CurrentDateProvider instance = (CurrentDateProvider) manager.getReference(provider,
CurrentDateProvider.class, manager.createCreationalContext(provider));
+        
+        System.out.println("Current time is : " + instance.getCurrentDate());
+        
+        arg2.doFilter(arg0, arg1);
+        
+    }
+
+    @Override
+    public void init(FilterConfig arg0) throws ServletException
+    {
+        
+        
+    }
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyFilter.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/java/org/apache/webbeans/samples/tomcat/MyFilter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/beans.xml?rev=987403&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/beans.xml
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/beans.xml
Fri Aug 20 08:31:45 2010
@@ -0,0 +1,20 @@
+<?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/>
\ No newline at end of file

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/beans.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/beans.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/beans.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/geronimo-web.xml?rev=987403&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/geronimo-web.xml
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/geronimo-web.xml
Fri Aug 20 08:31:45 2010
@@ -0,0 +1,39 @@
+<?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.
+-->
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
+         xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
+         xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
+         xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
+
+  <sys:environment>
+    <sys:moduleId>
+      <sys:groupId>${project.groupId}</sys:groupId>
+      <sys:artifactId>${project.artifactId}</sys:artifactId>
+      <sys:version>${project.version}</sys:version>
+      <sys:type>war</sys:type>
+    </sys:moduleId>
+    <sys:dependencies/>
+    <sys:hidden-classes/>
+    <sys:non-overridable-classes/>
+  </sys:environment>
+
+  <context-root>/${project.artifactId}</context-root>
+
+</web-app>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/web.xml?rev=987403&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/web.xml
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/web.xml
Fri Aug 20 08:31:45 2010
@@ -0,0 +1,37 @@
+<?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.
+-->
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <filter>
+  <filter-name>injectorfilter</filter-name>
+  <filter-class>org.apache.webbeans.samples.tomcat.MyFilter</filter-class>
+ </filter>
+ <filter-mapping>
+  <filter-name>injectorfilter</filter-name>
+  <servlet-name>injector</servlet-name>
+  <dispatcher>REQUEST</dispatcher>
+ </filter-mapping>
+ <servlet>
+  <servlet-name>injector</servlet-name>
+  <servlet-class>org.apache.webbeans.samples.tomcat.InjectorServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+  <servlet-name>injector</servlet-name>
+  <url-pattern>/injector</url-pattern>
+ </servlet-mapping>
+</web-app>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/index.jsp?rev=987403&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/index.jsp
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/index.jsp
Fri Aug 20 08:31:45 2010
@@ -0,0 +1,29 @@
+<!--
+	
+	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.
+-->
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+    	               "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+  <head>
+    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    	<title>Test calling webbeans from servelet</title>
+  </head>
+  <body>
+    <a id="i" href="./injector">Test calling webbeans from servelet</a>
+  </body>
+</html> 

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/org/apache/webbean/sample/servlet/test/TestWebbeanServlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/org/apache/webbean/sample/servlet/test/TestWebbeanServlet.java?rev=987403&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/org/apache/webbean/sample/servlet/test/TestWebbeanServlet.java
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/org/apache/webbean/sample/servlet/test/TestWebbeanServlet.java
Fri Aug 20 08:31:45 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.webbean.sample.servlet.test;
+
+import org.testng.annotations.Test;
+import org.apache.geronimo.testsupport.SeleniumTestSupport;
+
+public class TestWebbeanServlet extends SeleniumTestSupport {
+
+	@Test
+	public void testCallWebbeansInServlet() throws Exception {
+		String appContextStr = System.getProperty("appContext");
+		selenium.open(appContextStr);
+		selenium.click("link=Test calling webbeans from servelet");
+		waitForPageLoad();
+		assertTrue(selenium
+				.isTextPresent("Injection of Bean Instance into Servlet"));
+		assertTrue(selenium.isTextPresent("Caller Principal name injection into DateProvider instance
: ANONYMOUS"));
+		assertTrue(selenium
+				.isTextPresent("Current Date : org.apache.webbeans.samples.tomcat.CurrentDateProvider"));
+		assertTrue(selenium
+				.isTextPresent("Injection of BeanManager into Servlet"));
+		assertTrue(selenium
+				.isTextPresent("Injection of @Inject BeanManager into servlet is successfull"));
+	}
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/org/apache/webbean/sample/servlet/test/TestWebbeanServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/org/apache/webbean/sample/servlet/test/TestWebbeanServlet.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/java/org/apache/webbean/sample/servlet/test/TestWebbeanServlet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/resources/testng.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/resources/testng.xml?rev=987403&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/resources/testng.xml
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/resources/testng.xml
Fri Aug 20 08:31:45 2010
@@ -0,0 +1,25 @@
+<!--
+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.
+-->
+<suite name="Suite" parallel="false">
+  <test name="Test">
+    <classes>
+      <class name="org.apache.webbean.sample.servlet.test.TestWebbeanServlet"/>
+    </classes>
+  </test>
+</suite>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/resources/testng.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/resources/testng.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-servlet-test/src/test/resources/testng.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message