geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r979717 - in /geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/geronimo/ src/main/java/org/apache/geronimo/testsuite/ s...
Date Tue, 27 Jul 2010 14:19:36 GMT
Author: xiaming
Date: Tue Jul 27 14:19:35 2010
New Revision: 979717

URL: http://svn.apache.org/viewvc?rev=979717&view=rev
Log:
GERONIMO-5473 commit patch provided by LiWenQin

Added:
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/pom.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/EJBBeans/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/EJBBeans/CalculatorSingleBean.java
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/Servlets/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/Servlets/CalculatorServlet.java
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/geronimo-web.xml
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/web.xml
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/index.jsp
  (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/org/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/org/apache/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/org/apache/geronimo/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/org/apache/geronimo/testsuite/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/org/apache/geronimo/testsuite/javaee6/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/org/apache/geronimo/testsuite/javaee6/tests/
    geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/org/apache/geronimo/testsuite/javaee6/tests/EJBTest.java
  (with props)

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/pom.xml?rev=979717&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/pom.xml (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/pom.xml Tue Jul 27 14:19:35
2010
@@ -0,0 +1,112 @@
+<?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>javaee6-testsuite</artifactId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>ejb3.1lite-test</artifactId>
+    <name>Geronimo TestSuite :: Java EE 6 Testsuite :: Test EJB 3.1 Lite</name>
+    <packaging>war</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-servlet_3.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-ejb_3.1_spec</artifactId>
+			<version>1.0</version>
+		</dependency>
+		<dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.commons-httpclient</artifactId>
+			<version>3.1_4</version>
+        </dependency>
+    </dependencies>
+
+<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.maven.plugins</groupId>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <!--<configuration>
+                    <suiteXmlFiles>
+                        <suiteXmlFile>
+							${project.build.testOutputDirectory}/testng.xml
+						</suiteXmlFile>
+                    </suiteXmlFiles>
+                </configuration>-->
+            </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}/car</moduleId>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    </profile>
+</profiles>
+	
+</project>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/EJBBeans/CalculatorSingleBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/EJBBeans/CalculatorSingleBean.java?rev=979717&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/EJBBeans/CalculatorSingleBean.java
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/EJBBeans/CalculatorSingleBean.java
Tue Jul 27 14:19:35 2010
@@ -0,0 +1,45 @@
+/*
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+*/
+package org.apache.geronimo.testsuite.javaee6.ejbtest.EJBBeans;
+
+import javax.ejb.Singleton;
+import java.text.DecimalFormat;
+@Singleton
+public class CalculatorSingleBean {
+    String output = "Start the calculator process:<br/>";
+    double result = 0;
+    public double add(double d) {
+        double tmp = result + d;
+        this.output += result + " + " + d + " equals " + tmp + "<br/>";
+        result = tmp;
+        return result;
+    }
+
+    public String getOutput() {
+        return this.output;
+    }
+
+    public double sub(double d) {
+        double tmp = result - d;
+        this.output += result + " - " + d + " equals " + tmp + "<br/>";
+        result = tmp;
+        return result;
+    }
+ 
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/EJBBeans/CalculatorSingleBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/EJBBeans/CalculatorSingleBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/EJBBeans/CalculatorSingleBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/Servlets/CalculatorServlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/Servlets/CalculatorServlet.java?rev=979717&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/Servlets/CalculatorServlet.java
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/Servlets/CalculatorServlet.java
Tue Jul 27 14:19:35 2010
@@ -0,0 +1,91 @@
+/*
+    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.testsuite.javaee6.ejbtest.Servlets;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import javax.ejb.EJB;
+import org.apache.geronimo.testsuite.javaee6.ejbtest.EJBBeans.CalculatorSingleBean;
+import java.text.DecimalFormat;
+
+
+
+public class CalculatorServlet extends HttpServlet {
+    // the ejb container will route every request to the same Singleton EJB.
+    @EJB
+    private CalculatorSingleBean calcAdd;
+    @EJB
+    private CalculatorSingleBean calcSub;
+    private String output= new String();
+  protected void processRequest(HttpServletRequest req, HttpServletResponse response)
+  throws ServletException, IOException {
+      response.setContentType("text/html;charset=UTF-8");
+      PrintWriter out = response.getWriter();
+       try {
+          String Number = req.getParameter("NumberValue");
+          String operation = req.getParameter("operation");
+
+          double result = (Number == null) ? 0 : Double.valueOf(Number).doubleValue();
+          DecimalFormat mydf = new DecimalFormat("####.#");
+          if ( "sub".equals(operation) ) {
+              req.setAttribute("result", mydf.format(calcSub.sub(result)));
+          }
+          else if ( "add".equals(operation) ) {
+              req.setAttribute("result", mydf.format(calcAdd.add(result)));
+          }
+          this.output=this.calcSub.getOutput();
+          System.out.println("Result is " + req.getAttribute("result"));
+          System.out.println("Output is: "+this.output);
+          getServletContext().getRequestDispatcher("/index.jsp").forward(req, response);
+
+      }
+      catch ( Exception e ) {
+          e.printStackTrace();
+          throw new ServletException(e);
+      } finally {
+          out.close();
+      }
+  } 
+
+
+  @Override
+  protected void doGet(HttpServletRequest request, HttpServletResponse response)
+  throws ServletException, IOException {
+      processRequest(request, response);
+  } 
+
+  @Override
+  protected void doPost(HttpServletRequest request, HttpServletResponse response)
+  throws ServletException, IOException {
+      processRequest(request, response);
+  }
+
+  @Override
+  public String getServletInfo() {
+      return "Short description";
+  }
+
+}
+

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/Servlets/CalculatorServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/Servlets/CalculatorServlet.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/java/org/apache/geronimo/testsuite/javaee6/ejbtest/Servlets/CalculatorServlet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/geronimo-web.xml?rev=979717&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/geronimo-web.xml
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/geronimo-web.xml
Tue Jul 27 14:19:35 2010
@@ -0,0 +1,28 @@
+<?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-1.1" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1"
xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1">
+    <dep:environment>
+        <dep:moduleId>
+            <dep:groupId>${project.groupId}</dep:groupId>
+            <dep:artifactId>${project.artifactId}</dep:artifactId>
+            <dep:version>${project.version}</dep:version>
+            <dep:type>car</dep:type>
+        </dep:moduleId>
+    </dep:environment>
+    <context-root>/EJB31Lite</context-root>
+</web-app>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/web.xml?rev=979717&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/web.xml
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/web.xml
Tue Jul 27 14:19:35 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="3.0" 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_3_0.xsd">
+    <welcome-file-list>
+        <welcome-file>
+            index.jsp
+        </welcome-file>
+    </welcome-file-list>
+   <servlet>
+        <servlet-name>CalculatorServlet</servlet-name>
+        <servlet-class>org.apache.geronimo.testsuite.javaee6.ejbtest.Servlets.CalculatorServlet</servlet-class>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>CalculatorServlet</servlet-name>
+        <url-pattern>/CalculatorServlet</url-pattern>
+    </servlet-mapping>
+    <session-config>
+        <session-timeout>
+            30
+        </session-timeout>
+    </session-config>
+</web-app>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/index.jsp?rev=979717&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/index.jsp
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/index.jsp
Tue Jul 27 14:19:35 2010
@@ -0,0 +1,74 @@
+
+
+<%-- 
+    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>A Singleton Session Sample - Calculator</title>
+    </head>
+    <body>
+      <h2>A Singleton Session Sample</h2>
+      <h3>Calculator</h3>
+      <font style="font-size:12px">
+      <p>
+      <%
+          String result = String.valueOf(request.getAttribute("result"));
+          result = ("null".equals(result)) ? "0" : result;
+          request.setAttribute("result", null);
+          request.removeAttribute("result");
+      %>
+      </p>
+      
+      <form action="CalculatorServlet" method="get">
+      <table border="3" id="mainTable" cellpadding="0">
+        <thead id="mainTableHead">
+        <tr>
+          <td class="header">Number</td>
+          <td class="header">Operation</td>
+          <td class="header">Result</td>
+        </tr>
+        </thead>
+        <tr>
+          <td class="cell">
+            <input type="text" name="NumberValue" value="0" />
+          </td>
+          <td class="cell">
+            <input type="submit" name="operation" value="add" />
+            <br />
+            <input type="submit" name="operation" value="sub" />
+          </td>
+          <td class="cell">
+            <div id="result" ><%=result%></div></td>
+        </tr>
+      </table>
+    </form>
+    <p>
+        This sample shows an EJB 3.1 Lite Singleton session bean.
+    </p>
+     <p>
+          It also presents "Local/No Interface","no ejb-jar.xml","one war package" features.
+     </p>
+
+      </font>
+    </body>
+</html>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/org/apache/geronimo/testsuite/javaee6/tests/EJBTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/org/apache/geronimo/testsuite/javaee6/tests/EJBTest.java?rev=979717&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/org/apache/geronimo/testsuite/javaee6/tests/EJBTest.java
(added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/org/apache/geronimo/testsuite/javaee6/tests/EJBTest.java
Tue Jul 27 14:19:35 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.geronimo.testsuite.javaee6.tests;
+
+import org.apache.geronimo.testsupport.SeleniumTestSupport;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+import java.util.regex.Pattern;
+
+import junit.framework.Assert;
+
+public class EJBTest extends SeleniumTestSupport {
+	@Test 
+	public void testEJBSingleton() throws Exception {
+		selenium.open("/EJB31Lite/");
+		selenium.type("NumberValue", "1.1");
+		selenium.click("operation");
+		selenium.waitForPageToLoad("30000");
+		Assert.assertEquals("1.1", selenium.getText("//*[@id=\"result\"]"));
+		System.out.println(selenium.getText("result").toString());
+		selenium.type("NumberValue", "2.2");
+		selenium.click("operation");
+		selenium.waitForPageToLoad("30000");
+		Assert.assertEquals("3.3", selenium.getText("//*[@id=\"result\"]"));
+		System.out.println(selenium.getText("result").toString());
+		selenium.type("NumberValue", "0.3");
+		selenium.click("//input[@name='operation' and @value='sub']");
+		selenium.waitForPageToLoad("30000");
+		Assert.assertEquals("3", selenium.getText("//*[@id=\"result\"]"));
+		System.out.println(selenium.getText("result").toString());
+		selenium.type("NumberValue", "3");
+		selenium.click("//input[@name='operation' and @value='sub']");
+		selenium.waitForPageToLoad("30000");
+		Assert.assertEquals("0", selenium.getText("//*[@id=\"result\"]"));
+		System.out.println(selenium.getText("result").toString());
+		selenium.type("NumberValue", "5");
+		selenium.click("//input[@name='operation' and @value='sub']");
+		selenium.waitForPageToLoad("30000");
+		Assert.assertEquals("-5", selenium.getText("//*[@id=\"result\"]"));
+		System.out.println(selenium.getText("result").toString());
+	}
+}
+
+

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/org/apache/geronimo/testsuite/javaee6/tests/EJBTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/org/apache/geronimo/testsuite/javaee6/tests/EJBTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/ejb3.1lite-test/src/test/java/org/apache/geronimo/testsuite/javaee6/tests/EJBTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message