geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1041298 [1/2] - in /geronimo/server/trunk/testsuite/javaee6-testsuite: ./ jpa2.0-test/ jpa2.0-test/src/ jpa2.0-test/src/main/ jpa2.0-test/src/main/java/ jpa2.0-test/src/main/java/org/ jpa2.0-test/src/main/java/org/apache/ jpa2.0-test/src/m...
Date Thu, 02 Dec 2010 07:53:11 GMT
Author: xiaming
Date: Thu Dec  2 07:53:09 2010
New Revision: 1041298

URL: http://svn.apache.org/viewvc?rev=1041298&view=rev
Log:
GERONIMO-5720 some tests for jpa 2.0 new feature, provided by LiWenQin

Added:
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/pom.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CommentAdd.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseAdd.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseDelete.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseSelect.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseUnselect.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentAdd.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentDelete.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/listQuery.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/nullIfJPQL.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/queryCourseByName.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllComments.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllCourse.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllStudents.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewCourses.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewSelect_CourseRelation.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewStudents.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/bean/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/bean/Facade.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Address.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/BasicInfo.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Course.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Student.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/eclipselink_persistence.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence_openjpa.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/geronimo-web.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/web.xml   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addCourse.jsp   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addStudent.jsp   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/index.jsp   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/queryCourseByName.jsp   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/selectCourse.jsp   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/testComment.jsp   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewAllComments.jsp   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewCourses.jsp   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/org/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/org/apache/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/org/apache/geronimo/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/org/apache/geronimo/javaee6/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/org/apache/geronimo/javaee6/jpa20/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/org/apache/geronimo/javaee6/jpa20/tests/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/org/apache/geronimo/javaee6/jpa20/tests/JPATest.java   (with props)
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/resources/
    geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/resources/testng.xml   (with props)
Modified:
    geronimo/server/trunk/testsuite/javaee6-testsuite/pom.xml

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/pom.xml?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/pom.xml (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/pom.xml Thu Dec  2 07:53:09 2010
@@ -0,0 +1,177 @@
+<?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.
+-->
+
+<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>jpa2.0-test</artifactId>
+    <name>Geronimo TestSuite :: Java EE 6 Testsuite :: jpa2.0-test</name>
+   <description>
+    </description>
+    <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-annotation_1.1_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-jpa_2.0_spec</artifactId>
+			<scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa</artifactId>
+            <scope>provided</scope>
+        </dependency>	
+		<dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-ejb_3.1_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>net.sourceforge.serp</groupId>
+            <artifactId>serp</artifactId>
+            <version>1.13.1</version>
+	        <scope>provided</scope>	
+        </dependency>
+
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.5</version>
+	        <scope>provided</scope>	
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jta_1.1_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies> 
+	
+	<build>
+		<plugins>
+			<plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <configuration>
+                    <archiveClasses>false</archiveClasses>
+					<webResources>						
+						<resource>
+							<directory>${project.build.outputDirectory}</directory>
+							<includes>
+								<include>META-INF/LICENSE*</include>
+								<include>META-INF/NOTICE*</include>
+								<include>META-INF/DISCLAIMER*</include>
+							</includes>
+						</resource>
+						<resource>
+							<directory>${pom.basedir}/src/main/webapp/WEB-INF</directory>
+							<targetPath>WEB-INF</targetPath>
+							<filtering>true</filtering>
+							<includes>
+								<include>*.xml</include>								
+							</includes>
+						</resource>
+					</webResources>
+                </configuration>
+            </plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>2.3.2</version>
+				<configuration>
+					<compilerArgument>-Aopenjpa.metamodel=true</compilerArgument>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	
+	<profiles>
+    <profile>
+        <id>it</id>
+        <activation>
+            <property>
+                <name>it</name>
+            </property>
+        </activation>
+    <build>        
+        <plugins>   
+		    <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <configuration>
+                    <suiteXmlFiles>
+                        <suiteXmlFile>
+							${project.build.testOutputDirectory}/testng.xml
+						</suiteXmlFile>
+                    </suiteXmlFiles>.
+					<systemPropertyVariables>
+                         <appContext>${project.artifactId}</appContext>
+                    </systemPropertyVariables>
+                </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}/war</moduleId>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    </profile>
+</profiles>
+</project>

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

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

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

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CommentAdd.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CommentAdd.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CommentAdd.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CommentAdd.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,76 @@
+/**
+ *  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.javaee6.jpa20.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import javax.ejb.EJB;
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+
+@WebServlet(name="CommentAdd", urlPatterns={"/CommentAdd"})
+public class CommentAdd extends HttpServlet {
+     @EJB
+     private Facade facade = null;
+  
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        response.setContentType("text/html;charset=8859_1");
+        PrintWriter out = response.getWriter();
+        try {
+            String cidString=request.getParameter("cid");
+            int cid=Integer.parseInt(cidString);
+            String comment="comment";
+            for (int i=0;i<1;i++)
+            {
+                facade.addComment(cid,comment+i);
+            }
+            //RequestDispatcher dispatcher=request.getRequestDispatcher("testComment.jsp");
+            //dispatcher.forward(request, response);
+        } 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/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CommentAdd.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CommentAdd.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CommentAdd.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseAdd.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseAdd.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseAdd.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseAdd.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,84 @@
+/**
+ *  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.javaee6.jpa20.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.ejb.EJB;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+import org.apache.geronimo.javaee6.jpa20.entities.Course;
+
+
+@WebServlet(name="CourseAdd", urlPatterns={"/CourseAdd"})
+public class CourseAdd extends HttpServlet {
+    @EJB
+    private Facade coursefacade = null;
+
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        response.setContentType("text/html;charset=8859_1");
+        PrintWriter out = response.getWriter();
+        try {
+            String cid=request.getParameter("cid");
+            String cname=request.getParameter("cname");
+            String classroom=request.getParameter("classroom");
+            String teacher=request.getParameter("teacher");
+            String assistTeacher=request.getParameter("assistTeacher");
+            Course course=new Course();
+            course.setCid(Integer.parseInt(cid));
+            course.setCname(cname);
+            course.setClassroom(classroom);
+            course.setTeacher(teacher);
+            course.setAssistTeacher(assistTeacher);
+//            System.out.println("in CourseAdd, cname is:"+cname);
+            coursefacade.createCourse(course);
+            RequestDispatcher dispatcher=request.getRequestDispatcher("viewCourses");
+            dispatcher.forward(request, response);
+        } 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";
+    }// </editor-fold>
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseAdd.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseAdd.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseAdd.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseDelete.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseDelete.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseDelete.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseDelete.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,75 @@
+/**
+ *  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.javaee6.jpa20.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+import org.apache.geronimo.javaee6.jpa20.entities.Course;
+
+@WebServlet(name="CourseDelete", urlPatterns={"/CourseDelete"})
+public class CourseDelete extends HttpServlet {
+
+    private Facade facade = null;
+    
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        response.setContentType("text/html;charset=8859_1");
+        PrintWriter out = response.getWriter();
+        try {
+//            System.out.println("Preparing delete course.!!!");
+            facade=new Facade();
+            String cidString=request.getParameter("cid");
+            int cid=Integer.parseInt(cidString);
+            Course course=facade.findCourse(cid);
+            System.out.println("The course ID is:"+cid);
+            facade.removeCourse(course);
+            RequestDispatcher dispatcher=request.getRequestDispatcher("viewCourses.jsp");
+            dispatcher.forward(request, response);
+        } 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/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseDelete.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseDelete.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseDelete.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseSelect.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseSelect.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseSelect.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseSelect.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,89 @@
+/**
+ *  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.javaee6.jpa20.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+import org.apache.geronimo.javaee6.jpa20.entities.Course;
+import org.apache.geronimo.javaee6.jpa20.entities.Student;
+import javax.ejb.EJB;
+
+@WebServlet(name="CourseSelect", urlPatterns={"/CourseSelect"})
+public class CourseSelect extends HttpServlet {
+    @EJB
+    private Facade facade = null;
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        response.setContentType("text/html;charset=8859_1");
+        PrintWriter out = response.getWriter();
+        try {
+			out.println("<html>");
+            out.println("<head>");
+            out.println("<title>Servlet CourseSelect</title>");
+            out.println("</head>");
+            out.println("<body>");
+            String cid=request.getParameter("cid");
+            String sid=request.getParameter("sid");
+//            double score = 3.0;
+           
+            int intsid = Integer.parseInt(sid);
+            Student student = facade.findStudent(intsid);
+			out.println("<a>Get student name is:"+student.getInfo().getName()+"</a>\n");
+			///
+            int intcid = Integer.parseInt(cid);
+            Course course=facade.findCourse(intcid);
+			out.println("<a>course name:"+course.getCname()+"</a>\n");
+			
+            facade.selectCourse(student, course);
+			out.println("<a>after selectCourse op. </a>\n");
+			out.println("</body>");
+			out.println("</html>");
+            RequestDispatcher dispatcher=request.getRequestDispatcher("viewSelect_CourseRelation?sid="+student.getId());
+            dispatcher.forward(request, response);
+        } 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/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseSelect.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseSelect.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseSelect.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseUnselect.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseUnselect.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseUnselect.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseUnselect.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,75 @@
+/**
+ *  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.javaee6.jpa20.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+import org.apache.geronimo.javaee6.jpa20.entities.Course;
+import org.apache.geronimo.javaee6.jpa20.entities.Student;
+import javax.ejb.EJB;
+
+@WebServlet(name="CourseUnselect", urlPatterns={"/CourseUnselect"})
+public class CourseUnselect extends HttpServlet {
+    @EJB
+    private Facade facade = null;
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        response.setContentType("text/html;charset=8859_1");
+        PrintWriter out = response.getWriter();
+        try {
+            String cid=request.getParameter("cid");
+            String sid=request.getParameter("sid");
+            int intsid = Integer.parseInt(sid);
+            int intcid = Integer.parseInt(cid);
+            Student student=facade.findStudent(intsid);
+            Course course=facade.findCourse(intcid);
+            facade.unselectCourse(student, course);
+            RequestDispatcher dispatcher=request.getRequestDispatcher("viewSelect_CourseRelation?sid="+sid);
+            dispatcher.forward(request, response);
+        } 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/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseUnselect.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseUnselect.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/CourseUnselect.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentAdd.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentAdd.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentAdd.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentAdd.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,94 @@
+/**
+ *  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.javaee6.jpa20.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+import org.apache.geronimo.javaee6.jpa20.entities.Address;
+import org.apache.geronimo.javaee6.jpa20.entities.BasicInfo;
+import org.apache.geronimo.javaee6.jpa20.entities.Student;
+import javax.ejb.EJB;
+
+@WebServlet(name="StudentAdd", urlPatterns={"/StudentAdd"})
+public class StudentAdd extends HttpServlet {
+    @EJB
+    private Facade facade =null ;
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        response.setContentType("text/html;charset=8859_1");
+        PrintWriter out = response.getWriter();
+        try {
+            String sid=request.getParameter("sid");
+            String sname=request.getParameter("sname");
+            String country=request.getParameter("country");
+            String city=request.getParameter("city");
+            String street=request.getParameter("street");
+            String telephone=request.getParameter("telephone");
+            String age=request.getParameter("age");
+            String score=request.getParameter("score");
+            double sco = Double.parseDouble(score);
+            Address address=new Address();
+            address.setCity(city);
+            address.setCountry(country);
+            address.setStreet(street);
+            BasicInfo basicInfo=new BasicInfo();
+            basicInfo.setAddress(address);
+            basicInfo.setAge(Integer.parseInt(age));
+            basicInfo.setName(sname);
+            basicInfo.setTelephone(telephone);
+            Student student=new Student();
+            student.setId(Integer.parseInt(sid));
+            student.setInfo(basicInfo);
+            student.setRank("N/A");
+            student.setTotalScore(sco+student.getTotalScore());
+            
+//            System.out.println("student info before em.persist:sname:"+sname+",Address.city"+address.getCity()+",BasicInfo.TEL:"+basicInfo.getTelephone());
+            facade.createStudent(student);
+            RequestDispatcher dispatcher=request.getRequestDispatcher("viewAllStudents");
+            dispatcher.forward(request, response);
+        } 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/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentAdd.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentAdd.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentAdd.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentDelete.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentDelete.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentDelete.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentDelete.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,68 @@
+/**
+ *  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.javaee6.jpa20.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+import javax.ejb.EJB;
+@WebServlet(name="StudentDelete", urlPatterns={"/StudentDelete"})
+public class StudentDelete extends HttpServlet {
+    @EJB
+    private Facade facade = null;
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        response.setContentType("text/html;charset=8859_1");
+        PrintWriter out = response.getWriter();
+        try {
+            String sid=request.getParameter("sid");
+            int intsid = Integer.parseInt(sid);
+            facade.removeStudent(facade.findStudent(intsid));
+//            RequestDispatcher dispatcher=request.getRequestDispatcher("viewStudents.jsp");
+//            dispatcher.forward(request, response);
+        } 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/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentDelete.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentDelete.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/StudentDelete.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/listQuery.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/listQuery.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/listQuery.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/listQuery.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,76 @@
+/**
+ *  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.javaee6.jpa20.action;
+
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import java.io.IOException;
+import java.io.PrintWriter;
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+import org.apache.geronimo.javaee6.jpa20.entities.Course;
+import javax.ejb.EJB;
+
+@WebServlet(name="ListQuery", urlPatterns={"/ListQuery"})
+public class listQuery extends HttpServlet {
+    @EJB
+    private Facade cfacade = null;
+
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        String cname = request.getParameter("cname");
+        Course c  = cfacade.findCourseByName(cname);
+        String cn = c.getClassroom();
+        PrintWriter out = response.getWriter();
+        try {
+            out.println("<html>");
+            out.println("<head>");
+            out.println("<title>listQuery</title>");
+            out.println("</head>");
+            out.println("<body>");
+            out.println("<p>course name is :"+cn+" from listQuery. </p>");
+            out.println("</body>");
+            out.println("</html>");
+
+        }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/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/listQuery.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/listQuery.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/listQuery.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/nullIfJPQL.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/nullIfJPQL.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/nullIfJPQL.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/nullIfJPQL.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,77 @@
+/**
+ *  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.javaee6.jpa20.action;
+
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import java.io.IOException;
+import java.io.PrintWriter;
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+
+import javax.ejb.EJB;
+
+@WebServlet(name="nullIfJPQL", urlPatterns={"/nullIfJPQL"})
+public class nullIfJPQL extends HttpServlet {
+    @EJB
+    private Facade facade = null;
+
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+    	PrintWriter out = response.getWriter();
+    	String studentId = request.getParameter("sid");
+    	int sid = Integer.parseInt(studentId);
+        try {
+            out.println("<html>");
+            out.println("<head>");
+            out.println("<title>JPQL</title>");
+            out.println("</head>");
+            out.println("<body>");
+            String result = new String();
+            result = facade.nullIf(sid);
+            out.println("<p>Nullif is "+result+".</p>");
+            out.println("</body>");
+            out.println("</html>");
+        }
+        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/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/nullIfJPQL.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/nullIfJPQL.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/nullIfJPQL.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/queryCourseByName.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/queryCourseByName.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/queryCourseByName.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/queryCourseByName.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,104 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.geronimo.javaee6.jpa20.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import javax.ejb.EJB;
+import java.util.List;
+import org.apache.geronimo.javaee6.jpa20.entities.Student;
+import org.apache.geronimo.javaee6.jpa20.entities.Course;
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+
+@WebServlet(name="queryCourseByName", urlPatterns={"/queryCourseByName"})
+public class queryCourseByName extends HttpServlet {
+    @EJB
+    private Facade facade = null;
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        response.setContentType("text/html;charset=8859_1");
+        PrintWriter out = response.getWriter();
+        try {
+            String cname = request.getParameter("cname");
+            Course c = facade.findCourseByName(cname);
+            out.println("<html>");
+            out.println("<head>");
+            out.println("<title>Servlet queryCourseByName</title>");  
+            out.println("</head>");
+            out.println("<body>");
+            out.println(" Query Information is:");
+            out.println("<ol>");
+            out.println("<li>");
+            out.println("Course ID:"+c.getCid());
+            out.println("<br/>");
+            out.println("Course NAME:"+c.getCname());
+            out.println("</li>");
+            out.println("</ol>");
+            out.println("</body>");
+            out.println("</html>");
+
+        } finally { 
+            out.close();
+        }
+    } 
+
+    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
+    /** 
+     * Handles the HTTP <code>GET</code> method.
+     * @param request servlet request
+     * @param response servlet response
+     * @throws ServletException if a servlet-specific error occurs
+     * @throws IOException if an I/O error occurs
+     */
+    @Override
+    protected void doGet(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        processRequest(request, response);
+    } 
+
+    /** 
+     * Handles the HTTP <code>POST</code> method.
+     * @param request servlet request
+     * @param response servlet response
+     * @throws ServletException if a servlet-specific error occurs
+     * @throws IOException if an I/O error occurs
+     */
+    @Override
+    protected void doPost(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        processRequest(request, response);
+    }
+
+    /** 
+     * Returns a short description of the servlet.
+     * @return a String containing servlet description
+     */
+    @Override
+    public String getServletInfo() {
+        return "Short description";
+    }// </editor-fold>
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/queryCourseByName.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/queryCourseByName.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/queryCourseByName.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllComments.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllComments.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllComments.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllComments.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,88 @@
+/**
+ *  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.javaee6.jpa20.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import java.util.List;
+import javax.ejb.EJB;
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+import org.apache.geronimo.javaee6.jpa20.entities.Course;
+
+
+@WebServlet(name="viewAllComments", urlPatterns={"/viewAllComments"})
+public class viewAllComments extends HttpServlet {
+
+    @EJB
+    private Facade facade = null;
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        PrintWriter out = response.getWriter();
+        try {
+            out.println("<html>");
+            out.println("<head>");
+            out.println("<title>Servlet viewAllComments</title>");  
+            out.println("</head>");
+            out.println("<body>");
+            out.println("This page displays comments on Course.<br>");
+            String cidString = request.getParameter("cid");
+            int cid = Integer.parseInt(cidString);
+            Course course = facade.findCourse(cid);
+            out.println("<hr>");
+            out.println("Course Name:"+course.getCname()+",totally there are "+course.getEvaluation().size()+" comments.<br>");
+            List<String> all = course.getEvaluation();
+            out.println("<h2>All Comments</h2><hr>");
+            out.println("<ol>");
+            for (String e : all) {
+                //System.out.println("in viewAllComments!!!!!!!!"+e.getComment());
+                out.println("<li>Comment:"+e+" from viewAllComments</li>");
+            }
+            out.println("</ol>");
+            out.println("</body>");
+            out.println("</html>");
+        } 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/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllComments.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllComments.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllComments.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllCourse.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllCourse.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllCourse.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllCourse.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,95 @@
+/**
+ *  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.javaee6.jpa20.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import javax.ejb.EJB;
+import java.util.List;
+import java.util.ArrayList;
+import org.apache.geronimo.javaee6.jpa20.entities.Student;
+import org.apache.geronimo.javaee6.jpa20.entities.Course;
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+
+@WebServlet(name="viewAllCourse", urlPatterns={"/viewAllCourse"})
+public class viewAllCourse extends HttpServlet {
+    @EJB
+    private Facade facade = null ;
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        response.setContentType("text/html;charset=8859_1");
+        PrintWriter out = response.getWriter();
+        try {
+            String sid = request.getParameter("sid");
+            int intsid = Integer.parseInt(sid);
+            Student student = facade.findStudent(intsid);
+
+            out.println("<html>");
+            out.println("<head>");
+            out.println("<title>Servlet viewAllCourse</title>");  
+            out.println("</head>");
+            out.println("<body>");
+            out.println("<a>Welcome!Student Name:"+student.getInfo().getName()+"</a>");
+			
+			List<Course> courses = facade.findAllCourse();
+			if(courses==null){
+				out.println("<p>error occur! can not findallcourse()! it is empty!</p>");
+				out.println("</body>");
+				out.println("</html>");
+				return;
+			}
+			else{
+			    out.println("<h2>All Courses:</h2>");
+				out.println("<ol>");
+				for(Course course: courses){
+					out.println("<li>Course name:All courses includes "+course.getCname()+" from selectCourse<br/></li>");
+				}
+				out.println("</ol>");
+			}
+			out.println("</body>");
+			out.println("</html>");
+		} 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/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllCourse.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllCourse.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllCourse.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllStudents.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllStudents.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllStudents.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllStudents.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,84 @@
+/**
+ *  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.javaee6.jpa20.action;
+
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import java.util.List;
+import javax.ejb.EJB;
+
+import org.apache.geronimo.javaee6.jpa20.entities.Course;
+import org.apache.geronimo.javaee6.jpa20.entities.Student;
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+
+@WebServlet(name="viewAllStudents", urlPatterns={"/viewAllStudents"})
+public class viewAllStudents extends HttpServlet {
+    @EJB
+    private Facade facade = null;
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        response.setContentType("text/html;charset=8859_1");
+        PrintWriter out = response.getWriter();
+        try {
+           
+            out.println("<html>");
+            out.println("<head>");
+            out.println("<title>Servlet viewAllStudents</title>");  
+            out.println("</head>");
+            out.println("<body>");
+            out.println("<table border=\"1px\"><tr><td>Student ID</td><td>Student Name</td><td>Delete</td><tr>");
+            List<Student> students = facade.findAllStudent();
+                   for (Student stu : students) {
+                       out.println("<tr>");
+                       out.println("<td>"+stu.getId()+"</td>");
+                       out.println("<td>"+stu.getInfo().getName()+"</td>");
+                       out.println("<td><a href=\"StudentDelete?sid="+stu.getId()+"\">Delete</a>");
+                       out.println(" </td></tr>");
+                   }
+            out.println("</table>");
+            out.println("</body>");
+            out.println("</html>");
+            
+        } 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);
+    }
+
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllStudents.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllStudents.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewAllStudents.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewCourses.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewCourses.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewCourses.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewCourses.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,90 @@
+/**
+ *  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.javaee6.jpa20.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import java.util.List;
+import javax.ejb.EJB;
+
+import org.apache.geronimo.javaee6.jpa20.entities.Student;
+import org.apache.geronimo.javaee6.jpa20.entities.Course;
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+
+@WebServlet(name="viewCourses", urlPatterns={"/viewCourses"})
+public class viewCourses extends HttpServlet {
+    @EJB
+    private Facade facade = null;
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        response.setContentType("text/html;charset=8859_1");
+        PrintWriter out = response.getWriter();
+        try {
+           
+            out.println("<html>");
+            out.println("<head>");
+            out.println("<title>Servlet viewCourses</title>");  
+            out.println("</head>");
+            out.println("<body>");
+            out.println("<table border=\"1px\"><tr><td>Course Name</td><td>Classroom</td>"+
+                "<td>Teacher</td><td>Assist Teacher</td><td>actions</td></tr>");
+            List<Course> courses = facade.findAllCourse();
+                   for (Course course : courses) {
+                       out.println("<tr>");
+                       out.println("<td>"+course.getCname()+"</td>");
+                       out.println("<td>"+course.getClassroom()+"</td>");
+                       out.println("<td>"+course.getTeacher()+"</td>");
+                       out.println("<td>"+course.getAssistTeacher()+"</td>");
+                       out.println("<td>");
+                       out.println("<a href=\"testComment.jsp?cid="+course.getCid()+"\">Comments</a>");
+                       out.println("<a href=\"queryCourseByName.jsp?cname="+course.getCname()+"\">Query Course By Name</a>");
+                       out.println("<a href=\"CourseDelete?cid="+course.getCid()+"\">Delete</a>");
+                       out.println(" </td></tr>");
+                   }
+            out.println("</table>");
+            out.println("<a href=\"addCourse.jsp\">Add Course</a>");
+            out.println("</body>");
+            out.println("</html>");
+            
+        } 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);
+    }
+
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewCourses.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewCourses.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewCourses.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewSelect_CourseRelation.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewSelect_CourseRelation.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewSelect_CourseRelation.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewSelect_CourseRelation.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,114 @@
+/**
+ *  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.javaee6.jpa20.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import javax.ejb.EJB;
+import java.util.List;
+import java.util.ArrayList;
+import org.apache.geronimo.javaee6.jpa20.entities.Student;
+import org.apache.geronimo.javaee6.jpa20.entities.Course;
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+
+@WebServlet(name="viewSelect_CourseRelation", urlPatterns={"/viewSelect_CourseRelation"})
+public class viewSelect_CourseRelation extends HttpServlet {
+    @EJB
+    private Facade facade = null ;
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        response.setContentType("text/html;charset=8859_1");
+        PrintWriter out = response.getWriter();
+        try {
+            String sid = request.getParameter("sid");
+            int intsid = Integer.parseInt(sid);
+            Student student = facade.findStudent(intsid);
+
+            out.println("<html>");
+            out.println("<head>");
+            out.println("<title>Servlet selectCourse</title>");  
+            out.println("</head>");
+            out.println("<body>");
+            out.println("<a>Welcome!Student Name:"+student.getInfo().getName()+"</a>");
+			
+			List<Course> courses = facade.findAllCourse();
+
+			out.println("<h2>Want to Select Course?</h2>");
+            List<Course> selectedCourses = new ArrayList<Course>();
+			selectedCourses = student.getCourses();
+			{
+				out.println("</ol>");
+				for (Course course : courses) {
+					if (selectedCourses==null || !selectedCourses.contains(course)){
+						out.println("<li>Course name:");
+						out.println("Click Here to Select "+course.getCname()+" from selectCourse ");
+						out.println("<a href=\"CourseSelect?cid="+course.getCid()+"&sid="+student.getId()+"\">Select This Course</a>");
+						out.println("</li>");
+						}
+				}
+				out.println("</ol>");
+			}
+			
+            out.println("<h2>Want to Cancel selected Course?</h2>");
+			if(student.getCourses()==null){
+				out.println("<p>INFO:Student has no course selected.</p>");
+			}
+			else
+			{
+				selectedCourses = student.getCourses();
+				out.println("<ol>");
+				for (Course course : selectedCourses) {
+					out.println("<li>Course name:");
+					out.println("Click Here to Unselect "+course.getCname()+" from selectCourse");
+					out.println("<a href=\"CourseUnselect?cid="+course.getCid()+"&sid="+student.getId()+"\">Unselect This Course</a>");
+					out.println("</li>");
+				}
+				out.println("</ol>");
+			}
+
+        } 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/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewSelect_CourseRelation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewSelect_CourseRelation.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewSelect_CourseRelation.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message