geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r991501 [1/3] - in /geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test: ./ webbean-jpa-test/ webbean-jpa-test/src/ webbean-jpa-test/src/main/ webbean-jpa-test/src/main/java/ webbean-jpa-test/src/main/java/org/ webbean-jpa-tes...
Date Wed, 01 Sep 2010 11:02:58 GMT
Author: xiaming
Date: Wed Sep  1 11:02:56 2010
New Revision: 991501

URL: http://svn.apache.org/viewvc?rev=991501&view=rev
Log:
GERONIMO-5538 add test case for jsf+webbean+jpa provided by LiWenQin

Added:
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/pom.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LoginBean.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LogoutBean.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/RegisterBean.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminBean.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListBean.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListUser.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserListBean.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserReservationBean.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserUpdateBean.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/DatabaseLogin.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/EntityManagerQualifier.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/intercep/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/intercep/Transactional.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/LoginController.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/RegisterController.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/admin/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/admin/AdminController.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/api/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/api/ILoginController.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/api/IRegisterController.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/user/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/user/UserController.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/entity/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/entity/Hotel.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/entity/Reservation.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/entity/Users.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/events/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/events/LoggedInEvent.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/intercept/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/intercept/LoginDecorator.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/intercept/TransactionalInterceptor.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/model/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/model/ReservationModel.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/security/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/security/JSFSecurityPhaseListener.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/session/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/session/SessionTracker.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/util/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/util/CalendarUtil.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/util/EntityManagerUtil.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/util/JSFUtility.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/resources/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/resources/META-INF/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/resources/META-INF/eclipselink-persistence.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/resources/META-INF/openjpa-persistence.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/resources/META-INF/persistence.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/WEB-INF/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/WEB-INF/beans.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/WEB-INF/faces-config.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/WEB-INF/geronimo-web.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/WEB-INF/web.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/addReservation.xhtml
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/adminMenu.xhtml
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/defineHotel.xhtml
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/index.html   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/listHotels.xhtml
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/listReservations.xhtml
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/listUsers.xhtml
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/login.xhtml
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/main.css   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/register.xhtml
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/updateInfo.xhtml
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/webapp/userMenu.xhtml
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/test/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/test/java/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/test/java/org/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/test/java/org/apache/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/test/java/org/apache/webbeans/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/test/java/org/apache/webbeans/sample/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/test/java/org/apache/webbeans/sample/reservation/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/test/java/org/apache/webbeans/sample/reservation/test/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/test/java/org/apache/webbeans/sample/reservation/test/ReservationTest.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/test/resources/
    geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-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=991501&r1=991500&r2=991501&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 Wed Sep  1 11:02:56 2010
@@ -45,6 +45,7 @@
     <modules>
         <module>conversation-test</module>
         <module>webbean-ejb-test</module>
-        <module>webbean-servlet-test</module>			
+        <module>webbean-servlet-test</module>
+        <module>webbean-jpa-test</module>			
     </modules>
 </project>

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/pom.xml?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/pom.xml (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/pom.xml Wed Sep  1 11:02:56 2010
@@ -0,0 +1,192 @@
+<?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-jpa-test</artifactId>
+    <name>Geronimo TestSuite :: Java EE 6 Testsuite :: webbean-jpa-test</name>
+    <packaging>war</packaging>
+
+    <dependencyManagement>
+        <dependencies>            
+            <dependency>
+                <groupId>org.apache.geronimo.plugins</groupId>
+                <artifactId>myfaces</artifactId>
+                <version>${geronimoVersion}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+		<dependencies>
+		<!--Servlet API-->
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-servlet_3.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+		<!--JPA 2.0-->
+		 <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jpa_2.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+		
+		<!-- JSF -->
+         <dependency>
+            <groupId>org.apache.myfaces.core</groupId>
+            <artifactId>myfaces-api</artifactId>
+			<scope>provided</scope>
+        </dependency>
+		
+		<!--Derby-->
+		<dependency>
+			<groupId>org.apache.geronimo.bundles</groupId>
+			<artifactId>derby-all</artifactId>
+			<version>10.6.1.0_1</version>
+			<scope>provided</scope>
+		</dependency>
+		
+		<!-- Interceptor API -->		
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-interceptor_1.1_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+
+		<!-- EL API -->
+		<dependency>
+		    <groupId>org.apache.geronimo.specs</groupId>
+		    <artifactId>geronimo-el_2.2_spec</artifactId>
+		    <scope>provided</scope>
+		</dependency>
+		
+		<!-- Common Validator -->		
+        <dependency>
+        	<groupId>commons-validator</groupId>
+        	<artifactId>commons-validator</artifactId>
+        	<version>1.3.1</version>
+        </dependency>	
+		
+		<!-- OpenJPA -->
+		<dependency>
+			<groupId>org.apache.openjpa</groupId>
+			<artifactId>openjpa</artifactId>
+			<version>2.0.0</version>
+			<scope>provided</scope>
+		</dependency>
+		
+		 <!-- JSR-299 API -->
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jcdi_1.0_spec</artifactId>
+			<version>1.0</version>
+			<scope>provided</scope>
+        </dependency>
+
+        <!-- JSR-330 API -->
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-atinject_1.0_spec</artifactId>
+			<version>1.0</version>
+			<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>-->
+                        </configuration>                            
+                    </plugin>
+                </plugins>
+            </build>
+	    </profile>
+       </profiles>
+</project>

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

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

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

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LoginBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LoginBean.java?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LoginBean.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LoginBean.java Wed Sep  1 11:02:56 2010
@@ -0,0 +1,134 @@
+/*
+ * 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.reservation.beans;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Any;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.apache.webbeans.reservation.bindings.DatabaseLogin;
+import org.apache.webbeans.reservation.controller.LoginController;
+import org.apache.webbeans.reservation.entity.Users;
+import org.apache.webbeans.reservation.events.LoggedInEvent;
+import org.apache.webbeans.reservation.util.JSFUtility;
+
+import java.io.Serializable;
+/**
+ * Contains login related managed bean functionality.
+ */
+@Named(value="loginBean")
+@RequestScoped
+public class LoginBean implements Serializable
+{
+    /**Users name*/
+    private String userName;
+    
+    /**Password*/
+    private String password;
+
+    /**Inject of the event instance*/
+    private @Inject @Any Event<LoggedInEvent> loggedInEvent;
+    
+    /**Database related login controller*/
+    private @Inject @DatabaseLogin LoginController loginController;
+
+    /**
+     * Check user login.
+     * 
+     * @return navigation result
+     */
+    public String login()
+    {
+        
+        if(userName.equals("") || password.equals(""))
+        {
+            JSFUtility.addErrorMessage("User name and password fields can not be empty", "");
+            return null;
+        }
+        //System.out.println("Enter LoginBean.login()! Will invoke LoginController.checkLogin!");
+        Users result = loginController.checkLogin(userName, password);
+        
+        if(result == null)
+        {
+            JSFUtility.addErrorMessage("Login failed!,User name or password is not correct. Try again!", "");
+            
+            return null;
+        }
+        
+        Users user = result;
+        
+        //Fire Event
+        LoggedInEvent event = new LoggedInEvent(user);
+        loggedInEvent.fire(event);
+        
+        
+        if(user.isAdmin())
+        {
+            return "adminMenu";
+        }
+        
+        return "userMenu";
+    }
+    
+    /**
+     * Check user logout.
+     * 
+     * @return navigation result
+     */
+    public String logout()
+    {
+        return null;
+    }
+
+    /**
+     * @return the userName
+     */
+    public String getUserName()
+    {
+        return userName;
+    }
+
+    /**
+     * @param userName the userName to set
+     */
+    public void setUserName(String userName)
+    {
+        this.userName = userName;
+    }
+
+    /**
+     * @return the password
+     */
+    public String getPassword()
+    {
+        return password;
+    }
+
+    /**
+     * @param password the password to set
+     */
+    public void setPassword(String password)
+    {
+        this.password = password;
+    }
+    
+    
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LoginBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LoginBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LoginBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LogoutBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LogoutBean.java?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LogoutBean.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LogoutBean.java Wed Sep  1 11:02:56 2010
@@ -0,0 +1,53 @@
+/*
+ * 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.reservation.beans;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Named;
+import javax.servlet.http.HttpSession;
+
+import org.apache.webbeans.reservation.util.JSFUtility;
+
+import java.io.Serializable;
+
+@RequestScoped
+@Named
+public class LogoutBean implements Serializable
+{ 
+    
+    /**
+     * Logs out from the system.
+     * 
+     * @return navigate output
+     */
+    public String logout()
+    {
+        HttpSession session =  JSFUtility.getCurrentSession();
+        
+        if(session != null)
+        {
+            session.invalidate();
+        }
+        
+        JSFUtility.addInfoMessage("You have successfully logged out!", "");
+        
+        return "login";
+    }
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LogoutBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LogoutBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/LogoutBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/RegisterBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/RegisterBean.java?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/RegisterBean.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/RegisterBean.java Wed Sep  1 11:02:56 2010
@@ -0,0 +1,174 @@
+/*
+ * 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.reservation.beans;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Default;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.apache.webbeans.reservation.controller.RegisterController;
+import org.apache.webbeans.reservation.util.JSFUtility;
+
+import java.io.Serializable;
+
+@Named(value="register")
+@RequestScoped
+public class RegisterBean implements Serializable
+{
+    
+    private String name;
+    
+    private String surname;
+    
+    private Integer age;
+    
+    private String userName;
+    
+    private String password;
+    
+    private boolean admin;
+    
+    private @Inject @Default RegisterController personController;
+    
+    private @Inject @Default BeanManager manager; 
+    
+    public RegisterBean()
+    {
+        
+    }
+    
+    public String register()
+    {   
+           
+        personController.registerUser(userName, password, name, surname, age, admin);
+        
+        JSFUtility.addInfoMessage("User with name : " + userName + " is registered successfully.", "");
+        
+        return "login";
+
+    }
+
+    @PostConstruct
+    public void init()
+    {
+        //System.out.println("postContruct in RegisterBean.class");
+    }
+    
+    
+    /**
+     * @return the name
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * @param name the name to set
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /**
+     * @return the surname
+     */
+    public String getSurname()
+    {
+        return surname;
+    }
+
+    /**
+     * @param surname the surname to set
+     */
+    public void setSurname(String surname)
+    {
+        this.surname = surname;
+    }
+
+    /**
+     * @return the age
+     */
+    public Integer getAge()
+    {
+        return age;
+    }
+
+    /**
+     * @param age the age to set
+     */
+    public void setAge(Integer age)
+    {
+        this.age = age;
+    }
+
+    /**
+     * @return the userName
+     */
+    public String getUserName()
+    {
+        return userName;
+    }
+
+    /**
+     * @param userName the userName to set
+     */
+    public void setUserName(String userName)
+    {
+        this.userName = userName;
+    }
+
+    /**
+     * @return the password
+     */
+    public String getPassword()
+    {
+        return password;
+    }
+
+    /**
+     * @param password the password to set
+     */
+    public void setPassword(String password)
+    {
+        this.password = password;
+    }
+
+    /**
+     * @return the admin
+     */
+    public boolean isAdmin()
+    {
+        return admin;
+    }
+
+    /**
+     * @param admin the admin to set
+     */
+    public void setAdmin(boolean admin)
+    {
+        this.admin = admin;
+    }
+    
+    
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/RegisterBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/RegisterBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/RegisterBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminBean.java?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminBean.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminBean.java Wed Sep  1 11:02:56 2010
@@ -0,0 +1,132 @@
+/*
+ * 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.reservation.beans.admin;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Default;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.apache.webbeans.reservation.controller.admin.AdminController;
+import org.apache.webbeans.reservation.util.JSFUtility;
+
+/**
+ * Admin JSF Bean.
+ */
+@RequestScoped
+@Named(value="adminBean")
+public class AdminBean
+{
+    private String name;
+    
+    private String city;
+    
+    private String country;
+    
+    private Number star;
+    
+    private @Inject @Default AdminController adminController;
+
+    /**
+     * Add new hotel
+     * 
+     * @return navigation case
+     */
+    public String addNewHotel()
+    {
+        adminController.createNewHotel(name, star.intValue(), city, country);
+        
+        JSFUtility.addInfoMessage("Hotel  '" + name +  "' is successfully created", "");
+        
+        setCity(null);
+        setCountry(null);
+        setName(null);
+        setStar(null);
+        
+        
+        return null;
+        
+    }
+
+    /**
+     * @return the name
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * @param name the name to set
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /**
+     * @return the city
+     */
+    public String getCity()
+    {
+        return city;
+    }
+
+    /**
+     * @param city the city to set
+     */
+    public void setCity(String city)
+    {
+        this.city = city;
+    }
+
+    /**
+     * @return the country
+     */
+    public String getCountry()
+    {
+        return country;
+    }
+
+    /**
+     * @param country the country to set
+     */
+    public void setCountry(String country)
+    {
+        this.country = country;
+    }
+
+    /**
+     * @return the star
+     */
+    public Number getStar()
+    {
+        return star;
+    }
+
+    /**
+     * @param star the star to set
+     */
+    public void setStar(Number star)
+    {
+        this.star = star;
+    }
+    
+    
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListBean.java?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListBean.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListBean.java Wed Sep  1 11:02:56 2010
@@ -0,0 +1,173 @@
+/*
+ * 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.reservation.beans.admin;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Default;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.faces.component.html.HtmlDataTable;
+
+import org.apache.webbeans.reservation.controller.admin.AdminController;
+import org.apache.webbeans.reservation.entity.Hotel;
+import org.apache.webbeans.reservation.util.JSFUtility;
+
+@Named
+@SessionScoped
+public class AdminListBean implements Serializable
+{
+
+    private static final long serialVersionUID = 2552807646330035889L;
+
+    private List<Hotel> hotels = new ArrayList<Hotel>();
+    
+    private HtmlDataTable model;
+    
+    private @Inject @Default AdminController controller;
+    
+    private Hotel selected;
+    
+    private boolean renderedDetailPanel = false;
+    
+    
+    public String update()
+    {
+        //System.out.println("enter AdminListBean.update");
+        if(selected == null)
+        {
+            JSFUtility.addErrorMessage("Pleasee select the hotel to update", "");
+            
+            return null;
+        }
+        
+        controller.updateHotel(selected.getId(), selected.getName(), selected.getStar(), selected.getCity(), selected.getCountry());
+        
+        JSFUtility.addInfoMessage("Hotel with name " + selected.getName()+ " is succesfully updated." , "");
+        
+        
+        return null;
+    }
+    
+    public String delete()
+    {
+        selected = (Hotel)model.getRowData();
+        
+        if(selected == null)
+        {
+            JSFUtility.addErrorMessage("Pleasee select the hotel to delete", "");
+            
+            return null;
+        }
+     
+        controller.deleteHotel(selected.getId());
+        
+        JSFUtility.addInfoMessage("Hotel with name " + selected.getName()+ " is succesfully deleted." , "");
+        
+        this.selected.setCity(null);
+        this.selected.setCountry(null);
+        this.selected.setName(null);
+        this.selected.setStar(0);
+  
+        return null;
+    }
+    
+    public String getForUpdate()
+    {
+        //System.out.println("enter AdminListBean.getForUpdate");
+        Hotel hotel = (Hotel) model.getRowData();
+        
+        this.selected = hotel;
+        
+        setRenderedDetailPanel(true);
+        
+                
+        return null;
+    }
+    
+    /**
+     * @return the hotels
+     */
+    public List<Hotel> getHotels()
+    {
+        hotels = controller.getHotels();
+        
+        return hotels;
+    }
+
+    /**
+     * @param hotels the hotels to set
+     */
+    public void setHotels(List<Hotel> hotels)
+    {
+        this.hotels = hotels;
+    }
+
+    /**
+     * @return the model
+     */
+    public HtmlDataTable getModel()
+    {
+        return model;
+    }
+
+    /**
+     * @param model the model to set
+     */
+    public void setModel(HtmlDataTable model)
+    {
+        this.model = model;
+    }
+
+    /**
+     * @return the selected
+     */
+    public Hotel getSelected()
+    {
+        return selected;
+    }
+
+    /**
+     * @param selected the selected to set
+     */
+    public void setSelected(Hotel selected)
+    {
+        this.selected = selected;
+    }
+
+    /**
+     * @return the renderedDetailPanel
+     */
+    public boolean isRenderedDetailPanel()
+    {
+        return renderedDetailPanel;
+    }
+
+    /**
+     * @param renderedDetailPanel the renderedDetailPanel to set
+     */
+    public void setRenderedDetailPanel(boolean renderedDetailPanel)
+    {
+        this.renderedDetailPanel = renderedDetailPanel;
+    }
+    
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListUser.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListUser.java?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListUser.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListUser.java Wed Sep  1 11:02:56 2010
@@ -0,0 +1,120 @@
+/*
+ * 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.reservation.beans.admin;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Default;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.faces.component.html.HtmlDataTable;
+
+import org.apache.webbeans.reservation.controller.admin.AdminController;
+import org.apache.webbeans.reservation.entity.Hotel;
+import org.apache.webbeans.reservation.entity.Users;
+
+@Named
+@RequestScoped
+public class AdminListUser
+{
+    private List<Users> users = new ArrayList<Users>();
+    
+    private @Inject @Default AdminController controller;
+    
+    private HtmlDataTable model;
+    
+    private List<Hotel> hotels = new ArrayList<Hotel>();
+    
+    public AdminListUser()
+    {
+        
+    }
+
+    public String getReservations()
+    {
+        Users user = (Users) model.getRowData();
+        
+        Set<Hotel> set  = this.controller.getReservationsWithUser(user.getId());
+        for(Hotel hotel : set)
+        {
+            hotels.add(hotel);
+        }
+        
+        return null;
+    }
+    
+    /**
+     * @return the users
+     */
+    public List<Users> getUsers()
+    {   
+        this.users = this.controller.getUsers(); 
+        
+        return this.users; 
+    }
+
+    /**
+     * @param users the users to set
+     */
+    public void setUsers(List<Users> users)
+    {
+        this.users = users;
+    }
+
+    /**
+     * @return the model
+     */
+    public HtmlDataTable getModel()
+    {
+        return model;
+    }
+
+    /**
+     * @param model the model to set
+     */
+    public void setModel(HtmlDataTable model)
+    {
+        this.model = model;
+    }
+
+    /**
+     * @return the hotels
+     */
+    public List<Hotel> getHotels()
+    {
+        
+       return hotels;
+
+    }
+
+    /**
+     * @param hotels the hotels to set
+     */
+    public void setHotels(List<Hotel> hotels)
+    {
+        this.hotels = hotels;
+    }
+
+    
+    
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListUser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListUser.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/admin/AdminListUser.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserListBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserListBean.java?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserListBean.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserListBean.java Wed Sep  1 11:02:56 2010
@@ -0,0 +1,105 @@
+/*
+ * 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.reservation.beans.user;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Default;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.faces.component.html.HtmlDataTable;
+
+import org.apache.webbeans.reservation.controller.user.UserController;
+import org.apache.webbeans.reservation.entity.Reservation;
+import org.apache.webbeans.reservation.session.SessionTracker;
+import org.apache.webbeans.reservation.util.JSFUtility;
+
+@Named("listReservationBean")
+@RequestScoped
+public class UserListBean
+{
+
+    private List<Reservation> reservations = new ArrayList<Reservation>();
+    
+    private HtmlDataTable model = null;
+    
+    private @Inject @Default UserController controller;
+    
+    private @Inject @Default SessionTracker tracker;
+    
+    public UserListBean()
+    {
+        
+    }
+
+    public String delete()
+    {
+        Reservation res = (Reservation)model.getRowData();
+        
+        controller.deleteReservation(res.getId());
+        
+        JSFUtility.addInfoMessage("Reservation is succesfully delete", "");
+        
+        
+        return null;
+    }
+    
+    public String showReservations()
+    {
+        return "listReservations";
+    }
+    
+    /**
+     * @return the reservations
+     */
+    public List<Reservation> getReservations()
+    {
+        this.reservations = this.controller.getReservations(tracker.getUser().getId());
+        
+        return reservations;
+    }
+
+    /**
+     * @param reservations the reservations to set
+     */
+    public void setReservations(List<Reservation> reservations)
+    {
+        this.reservations = reservations;
+    }
+
+    /**
+     * @return the model
+     */
+    public HtmlDataTable getModel()
+    {
+        return model;
+    }
+
+    /**
+     * @param model the model to set
+     */
+    public void setModel(HtmlDataTable model)
+    {
+        this.model = model;
+    }
+    
+    
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserListBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserListBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserListBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserReservationBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserReservationBean.java?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserReservationBean.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserReservationBean.java Wed Sep  1 11:02:56 2010
@@ -0,0 +1,294 @@
+/*
+ * 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.reservation.beans.user;
+
+import java.io.Serializable;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.enterprise.context.Conversation;
+import javax.enterprise.context.ConversationScoped;
+import javax.enterprise.inject.Default;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.faces.component.html.HtmlDataTable;
+import javax.faces.model.SelectItem;
+
+import org.apache.webbeans.reservation.controller.admin.AdminController;
+import org.apache.webbeans.reservation.controller.user.UserController;
+import org.apache.webbeans.reservation.entity.Hotel;
+import org.apache.webbeans.reservation.model.ReservationModel;
+import org.apache.webbeans.reservation.session.SessionTracker;
+import org.apache.webbeans.reservation.util.JSFUtility;
+
+@ConversationScoped
+@Named
+public class UserReservationBean implements Serializable
+{
+    private static final long serialVersionUID = -5860989760497059459L;
+
+    private List<SelectItem> reservations = new ArrayList<SelectItem>();
+    
+    private @Inject @Default UserController controller;
+    
+    private List<Hotel> hotels = new ArrayList<Hotel>();
+    
+    private @Inject @Default AdminController adminController;
+    
+    private String reservationDate;
+    
+    private HtmlDataTable model;
+    
+    private @Inject @Default Conversation conversation;
+    
+    private @Inject @Default SessionTracker tracker;
+        
+    private Integer[] itemSelected = new Integer[0];
+    
+    private Map<String, ReservationModel> models = new HashMap<String, ReservationModel>();
+    
+    public UserReservationBean()
+    {
+    }
+
+    
+    public String addReservation()
+    {
+        if(getReservationDate() == null)
+        {
+            JSFUtility.addErrorMessage("Reservation date can not be empty!", "");
+            return null;
+        }
+             
+        Date date = null;
+        try
+        {
+            date = new SimpleDateFormat("dd/MM/yyyy").parse(getReservationDate());
+            
+        }
+        catch(Exception e)
+        {
+            
+            JSFUtility.addErrorMessage("Please give a date with dd/MM/yyyy", "");
+            return null;
+        }
+        
+        if(conversation.isTransient())
+        {
+            conversation.begin();
+            
+            JSFUtility.addInfoMessage("Reservation conversation with started with id : " + conversation.getId(), "");            
+        }
+        
+        Hotel hotel = (Hotel)model.getRowData();
+        
+        SelectItem item = new SelectItem();
+        item.setValue(hotel.getId());
+        item.setLabel(hotel.getName());
+        
+        if(contains(item.getValue()) != null)
+        {
+            JSFUtility.addErrorMessage("Given hotel is already added", "");
+            
+            return null;
+        }
+                
+        reservations.add(item);
+        
+        
+        ReservationModel model = new ReservationModel(item,date);
+        models.put(item.getValue().toString(), model);
+        
+        return null;
+    }
+    
+    private SelectItem contains(Object id)
+    {
+        for(SelectItem i : reservations)
+        {
+            if(i.getValue().toString().equals(id.toString()))
+            {
+                return i;
+            }
+        }
+        
+        return null;
+        
+    }
+    
+    public String delete()
+    {
+        if(this.itemSelected.length == 0)
+        {
+            JSFUtility.addErrorMessage("Please select reservation to remove", "");
+            
+            return null;
+        }
+        
+        for(Integer i : this.itemSelected)
+        {
+            SelectItem item = contains(i);
+            if(item != null)
+            {
+                this.reservations.remove(item);   
+                
+                this.models.remove(item);
+            }    
+        }
+        
+        
+        return null;
+    }
+    
+    public String checkout()
+    {
+        if(conversation.isTransient())
+        {
+            JSFUtility.addErrorMessage("Conversation is not running! Please add hotel for reservation", "");
+            this.reservations.clear();
+            this.reservationDate = null;
+        }
+        else
+        {
+            this.controller.addReservation(models,tracker.getUser().getId());
+            String conversationid = conversation.getId();
+            conversation.end();
+            JSFUtility.addInfoMessage("Reservation are completed succesfully. Conversation with id "+conversationid + " is ended ", "");
+            this.reservations.clear();
+            
+            this.reservationDate = null;            
+        }        
+        
+        return null;
+    }
+
+
+    /**
+     * @return the reservations
+     */
+    public List<SelectItem> getReservations()
+    {
+        return reservations;
+    }
+
+    
+    public String clear()
+    {
+        this.reservations.clear();
+                
+        this.reservationDate = null;
+        
+        if(!conversation.isTransient())
+        {
+            this.conversation.end();
+            JSFUtility.addInfoMessage("Reservation are deleted succesfully. Conversation with id "+conversation.getId() + "is ended ", "");
+        }
+        
+        return null;
+    }
+
+    /**
+     * @param reservations the reservations to set
+     */
+    public void setReservations(List<SelectItem> reservations)
+    {
+        this.reservations = reservations;
+    }
+
+
+    /**
+     * @return the hotels
+     */
+    public List<Hotel> getHotels()
+    {
+        this.hotels = this.adminController.getHotels();
+        
+        return hotels;
+    }
+
+
+    /**
+     * @param hotels the hotels to set
+     */
+    public void setHotels(List<Hotel> hotels)
+    {
+        this.hotels = hotels;
+    }
+
+
+    /**
+     * @return the reservationDate
+     */
+    public String getReservationDate()
+    {
+        return reservationDate;
+    }
+
+
+    /**
+     * @param reservationDate the reservationDate to set
+     */
+    public void setReservationDate(String reservationDate)
+    {
+        this.reservationDate = reservationDate;
+    }
+
+
+    /**
+     * @return the model
+     */
+    public HtmlDataTable getModel()
+    {
+        return model;
+    }
+
+
+    /**
+     * @param model the model to set
+     */
+    public void setModel(HtmlDataTable model)
+    {
+        this.model = model;
+    }
+
+
+    /**
+     * @return the itemSelected
+     */
+    public Integer[] getItemSelected()
+    {
+        
+        return itemSelected;
+    }
+
+
+    /**
+     * @param itemSelected the itemSelected to set
+     */
+    public void setItemSelected(Integer[] itemSelected)
+    {
+        this.itemSelected = itemSelected;
+    }
+    
+    
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserReservationBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserReservationBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserReservationBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserUpdateBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserUpdateBean.java?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserUpdateBean.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserUpdateBean.java Wed Sep  1 11:02:56 2010
@@ -0,0 +1,169 @@
+/*
+ * 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.reservation.beans.user;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Default;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.apache.webbeans.reservation.controller.user.UserController;
+import org.apache.webbeans.reservation.entity.Users;
+import org.apache.webbeans.reservation.session.SessionTracker;
+import org.apache.webbeans.reservation.util.JSFUtility;
+
+@Named
+@RequestScoped
+public class UserUpdateBean
+{
+    private String name;
+    
+    private String surname;
+    
+    private int age;
+    
+    private String userName;
+    
+    private String password;
+    
+    private @Inject @Default UserController controller;
+    
+    private @Inject @Default SessionTracker tracker;
+    
+    public UserUpdateBean()
+    {
+        
+    }
+
+    public String showInfo()
+    {
+        //Just show how can access session webbeans
+        Users user = this.controller.getUser(tracker.getUser().getId());
+        
+        setName(user.getName());
+        setSurname(user.getSurname());
+        setAge(user.getAge());
+        setUserName(user.getUserName());
+        setPassword(user.getPassword());
+                
+        return "updateInfo";
+    }
+
+    public String clear()
+    {
+        setName("");
+        setSurname("");
+        setAge(0);
+        setUserName("");
+        setPassword("");
+        
+        return null;
+    }
+    
+    public String update()
+    {
+        this.controller.updateUserInfo(tracker.getUser().getId(), name, surname, age, userName, password);
+        
+        JSFUtility.addInfoMessage("Personal information is succesfully updated.", "");
+        
+        return null;
+    }
+    
+    /**
+     * @return the name
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * @param name the name to set
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /**
+     * @return the surname
+     */
+    public String getSurname()
+    {
+        return surname;
+    }
+
+    /**
+     * @param surname the surname to set
+     */
+    public void setSurname(String surname)
+    {
+        this.surname = surname;
+    }
+
+    /**
+     * @return the age
+     */
+    public int getAge()
+    {
+        return age;
+    }
+
+    /**
+     * @param age the age to set
+     */
+    public void setAge(int age)
+    {
+        this.age = age;
+    }
+
+    /**
+     * @return the userName
+     */
+    public String getUserName()
+    {
+        return userName;
+    }
+
+    /**
+     * @param userName the userName to set
+     */
+    public void setUserName(String userName)
+    {
+        this.userName = userName;
+    }
+
+    /**
+     * @return the password
+     */
+    public String getPassword()
+    {
+        return password;
+    }
+
+    /**
+     * @param password the password to set
+     */
+    public void setPassword(String password)
+    {
+        this.password = password;
+    }
+    
+    
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserUpdateBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserUpdateBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/beans/user/UserUpdateBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/DatabaseLogin.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/DatabaseLogin.java?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/DatabaseLogin.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/DatabaseLogin.java Wed Sep  1 11:02:56 2010
@@ -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.webbeans.reservation.bindings;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.PARAMETER;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@Qualifier
+@Retention(RetentionPolicy.RUNTIME)
+@Target( {FIELD, METHOD, TYPE,PARAMETER})
+public @interface DatabaseLogin
+{
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/DatabaseLogin.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/DatabaseLogin.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/DatabaseLogin.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/EntityManagerQualifier.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/EntityManagerQualifier.java?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/EntityManagerQualifier.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/EntityManagerQualifier.java Wed Sep  1 11:02:56 2010
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.reservation.bindings;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.PARAMETER;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+
+@Qualifier
+@Retention(RetentionPolicy.RUNTIME)
+@Target( {FIELD, METHOD, TYPE,PARAMETER})
+public @interface EntityManagerQualifier
+{
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/EntityManagerQualifier.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/EntityManagerQualifier.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/EntityManagerQualifier.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/intercep/Transactional.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/intercep/Transactional.java?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/intercep/Transactional.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/intercep/Transactional.java Wed Sep  1 11:02:56 2010
@@ -0,0 +1,36 @@
+/*
+ * 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.reservation.bindings.intercep;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.interceptor.InterceptorBinding;
+
+@Inherited
+@InterceptorBinding
+@Retention(RetentionPolicy.RUNTIME)
+@Target( { ElementType.TYPE, ElementType.METHOD })
+public @interface Transactional
+{
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/intercep/Transactional.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/intercep/Transactional.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/bindings/intercep/Transactional.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/LoginController.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/LoginController.java?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/LoginController.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/LoginController.java Wed Sep  1 11:02:56 2010
@@ -0,0 +1,83 @@
+/*
+ * 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.reservation.controller;
+
+import java.util.GregorianCalendar;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+
+import org.apache.webbeans.reservation.bindings.DatabaseLogin;
+import org.apache.webbeans.reservation.bindings.EntityManagerQualifier;
+import org.apache.webbeans.reservation.bindings.intercep.Transactional;
+import org.apache.webbeans.reservation.controller.api.ILoginController;
+import org.apache.webbeans.reservation.entity.Users;
+
+@DatabaseLogin
+@RequestScoped
+@Named
+public class LoginController implements ILoginController
+{  
+    /**Injection of the request scope entity manager*/
+    private @Inject @EntityManagerQualifier EntityManager entityManager;
+
+    /**
+     * Returns true if user exist else false
+     * 
+     * @param userName user name
+     * @param password user password
+     * @return true if user exist else false
+     */
+    @Transactional
+    public Users checkLogin(String userName, String password)
+    {
+        //System.out.println("Enter LoginController.checkLogin");
+        if(userName.equals("") || password.equals(""))
+        {  
+            return null;
+        }
+        
+        Query query = entityManager.createQuery("select p from Users p where  " +
+                                                "p.userName=:userName and " +
+                                                "p.password=:password");
+        
+        query.setParameter("userName", userName);
+        query.setParameter("password", password);
+        
+        Users value = null;
+        try
+        {
+            value = (Users)query.getSingleResult();
+            value.setLastLoginDate(GregorianCalendar.getInstance().getTime());
+        }
+        catch(Exception e)
+        {
+            System.out.println("login failed:"+e.getMessage());
+            return null;
+        }
+                
+        
+        return value;
+    }
+    
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/LoginController.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/LoginController.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/LoginController.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/RegisterController.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/RegisterController.java?rev=991501&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/RegisterController.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/RegisterController.java Wed Sep  1 11:02:56 2010
@@ -0,0 +1,64 @@
+package org.apache.webbeans.reservation.controller;
+/*
+ * 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.
+ */
+
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+import javax.persistence.EntityManager;
+
+import org.apache.webbeans.reservation.bindings.EntityManagerQualifier;
+import org.apache.webbeans.reservation.bindings.intercep.Transactional;
+import org.apache.webbeans.reservation.controller.api.IRegisterController;
+import org.apache.webbeans.reservation.entity.Users;
+import org.apache.webbeans.reservation.util.CalendarUtil;
+
+/**
+ * Controller responsible for registering operations.
+ */
+@RequestScoped
+public class RegisterController implements IRegisterController
+{
+    //private @Inject @ApplicationLog Log logger;
+    
+    private @Inject @EntityManagerQualifier EntityManager entityManager;
+
+    /**
+     * Register the user.
+     */
+    @Transactional
+    public Users registerUser(String userName, String password, String name, String surname , int age, boolean admin)
+    {        
+        Users user = new Users();
+        
+        user.setUserName(userName);
+        user.setPassword(password);
+        user.setName(name);
+        user.setSurname(surname);
+        user.setAge(age);
+        user.setRegisterDate(CalendarUtil.getCurrentDate());
+        user.setAdmin(admin);
+        
+        entityManager.persist(user);
+        
+        
+        return user;
+    }
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/RegisterController.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/RegisterController.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/webbean1.0-test/webbean-jpa-test/src/main/java/org/apache/webbeans/reservation/controller/RegisterController.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message