Source Code Cross Referenced for TestPersistenceLifetimeCMTransaction00.java in  » J2EE » ow2-easybeans » org » ow2 » easybeans » tests » persistence » lifetime » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » ow2 easybeans » org.ow2.easybeans.tests.persistence.lifetime 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * EasyBeans
003:         * Copyright (C) 2006 Bull S.A.S.
004:         * Contact: easybeans@ow2.org
005:         *
006:         * This library is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU Lesser General Public
008:         * License as published by the Free Software Foundation; either
009:         * version 2.1 of the License, or any later version.
010:         *
011:         * This library is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this library; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
019:         * USA
020:         *
021:         * --------------------------------------------------------------------------
022:         * $Id: TestPersistenceLifetimeCMTransaction00.java 1970 2007-10-16 11:49:25Z benoitf $
023:         * --------------------------------------------------------------------------
024:         */package org.ow2.easybeans.tests.persistence.lifetime;
025:
026:        import static org.ow2.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance;
027:
028:        import org.ow2.easybeans.tests.common.ejbs.base.persistencectxlife.BasePctxLifeCMTTester00;
029:        import org.ow2.easybeans.tests.common.ejbs.base.persistencectxlife.ItfPCtxLifetime00;
030:        import org.ow2.easybeans.tests.common.ejbs.stateful.containermanaged.persistencectxlife.SFSBPCtxLifeCMT00;
031:        import org.testng.annotations.AfterMethod;
032:        import org.testng.annotations.BeforeMethod;
033:        import org.testng.annotations.Test;
034:
035:        /**
036:         * Tests container-managed transaction-scoped persistence context. It uses this test class as client and a
037:         * Stateful with transaction-scoped persistence context.
038:         * In this scope, the lifecycle of a persistence context ends when the associated transaction ends.
039:         * @reference JSR 220 - Persistence API - FINAL DRAFT - 5.6.1
040:         * @requirement Application Server must be running; the package
041:         *              org.ow2.easybeans.tests.common.ejbs.stateful.containermanaged.persistencectxlife
042:         *              must be deployed
043:         * @setup gets the reference of the bean.
044:         * @author Eduardo Studzinski Estima de Castro
045:         * @author Gisele Pinheiro Souza
046:         */
047:        public class TestPersistenceLifetimeCMTransaction00 extends
048:                BasePctxLifeCMTTester00 {
049:
050:            /**
051:             * Gets bean instances used in the tests.
052:             * @throws Exception if there is a problem with the bean initialization.
053:             */
054:            @BeforeMethod
055:            public void startUp() throws Exception {
056:                ItfPCtxLifetime00 bean00 = getBeanRemoteInstance(
057:                        SFSBPCtxLifeCMT00.class, ItfPCtxLifetime00.class);
058:                super .setBean(bean00);
059:            }
060:
061:            /**
062:             * This test begins a transaction, creates an entity and rolls back the transaction.
063:             * The entity must not exists after the rollback and the entity instance must become detached.
064:             * A rollback in a transaction, which is used with the persistence context,
065:             * always turns detached all entities associated with the persistence context.
066:             * @input UserTransaction and entity.
067:             * @output After the rollback, the bean must not exists.
068:             * @throws Exception if a problem occurs.
069:             */
070:            @Override
071:            @Test
072:            public void test00() throws Exception {
073:                super .test00();
074:            }
075:
076:            /**
077:             * This test begins a transaction, creates an entity and commits the transaction. The entity must
078:             * exists after the commit and it must become detached, because it is an transaction persistence context.
079:             * @input With a client transaction, invocation of a bean method which creates an entity.
080:             * @output After the commit, the bean must become detached.
081:             * @throws Exception if a problem occurs.
082:             */
083:            @Override
084:            @Test
085:            public void test01() throws Exception {
086:                super .test01();
087:            }
088:
089:            /**
090:             * This test begins a transaction and creates an entity. As it uses an transaction
091:             * persistence context and the transaction is still open,
092:             * the entity remains managed after its creation. After this step,
093:             * the test rolls back the transaction and the entity must be removed.
094:             * @input With a client transaction, invocation of a bean method which creates an entity.
095:             * @output The entity must be removed.
096:             * @throws Exception if a problem occurs.
097:             */
098:            @Override
099:            @Test
100:            public void test02() throws Exception {
101:                super .test02();
102:            }
103:
104:            /**
105:             * Tests if an entity manager with a stateful can manage a
106:             * transaction-scoped persistence context.
107:             * @throws Exception if a problem occurs.
108:             */
109:            @Override
110:            @Test
111:            public void test03() throws Exception {
112:                super .test03();
113:            }
114:
115:            /**
116:             * Tests if an entity manager with a stateful can manage a
117:             * transaction-scoped persistence context.
118:             * @throws Exception if a problem occurs.
119:             */
120:            @Override
121:            @Test
122:            public void test04() throws Exception {
123:                super .test04();
124:            }
125:
126:            /**
127:             * Cleans the test results.
128:             * @throws Exception if a problem occurs
129:             */
130:            @Override
131:            @AfterMethod
132:            public void tearDown() throws Exception {
133:                super.tearDown();
134:            }
135:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.