Source Code Cross Referenced for B_BasicHomeInterfaceEC.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas » jtests » clients » entity » 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 » JOnAS 4.8.6 » org.objectweb.jonas.jtests.clients.entity 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JOnAS: Java(TM) Open Application Server
003:         * Copyright (C) 1999 Bull S.A.
004:         * Contact: jonas-team@objectweb.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: B_BasicHomeInterfaceEC.java 4066 2004-01-21 14:51:28Z legrasi $
023:         * --------------------------------------------------------------------------
024:         */
025:
026:        package org.objectweb.jonas.jtests.clients.entity;
027:
028:        import javax.naming.NamingException;
029:        import javax.rmi.PortableRemoteObject;
030:        import junit.framework.Test;
031:        import junit.framework.TestSuite;
032:        import org.objectweb.jonas.jtests.beans.fbasic.SimpleHome;
033:        import org.objectweb.jonas.jtests.beans.fbasic.Simple;
034:        import java.util.Enumeration;
035:
036:        /**
037:         * This set of test are basic tests on CMP entity home interface.
038:         * Only specific tests to CMP are here, all tests common to CMP and BMP
039:         * are in the inherited class A_BasicHomeInterface.
040:         * @author Philippe Coq, Philippe Durieux, Helene Joanin. (jonas team)
041:         */
042:        public abstract class B_BasicHomeInterfaceEC extends
043:                B_BasicHomeInterface {
044:
045:            public B_BasicHomeInterfaceEC(String name) {
046:                super (name);
047:            }
048:
049:            // --------------------------------------------------------------------
050:            // tests on clause where for CMP finder methods
051:            // These tests are specific to CMP 
052:            // ---------------------------------------------------------------------
053:
054:            /**
055:             * testFinderBetween  verify a finder method that return a Enumeration
056:             * whith a where clause :
057:             *  where ?1 <= c_info and c_info <= ?2 and ?1 <= c_numtest and c_numtest <= ?2
058:             * the purpose of this test is to verify the correct interpretation of parameters
059:             * ?1 ?2
060:             */
061:            public void testFinderBetween() throws Exception {
062:                int value = 991959;
063:                getHome().create("991959_1", value, value);
064:                getHome().create("991959_2", value, value);
065:                Simple entity = null;
066:                Enumeration eList = null;
067:                eList = getHome().findInfo_beetwen(value, value);
068:                int nb = 0;
069:                while (eList.hasMoreElements()) {
070:                    entity = (Simple) javax.rmi.PortableRemoteObject.narrow(
071:                            eList.nextElement(), Simple.class);
072:                    nb++;
073:                    assertEquals("Wrong Info value", entity.getInfo(), value);
074:                    assertEquals("Wrong NumTest value", entity.getNumTest(),
075:                            value);
076:                }
077:                assertEquals("Wrong number of entities found", 2, nb);
078:                getHome().remove("991959_1");
079:                getHome().remove("991959_2");
080:            }
081:
082:            public void testFinderBetweenSansVerif() throws Exception {
083:                int value = 991959;
084:                getHome().create("991959_1", value, value);
085:                getHome().create("991959_2", value, value);
086:                Simple entity = null;
087:                Enumeration eList = null;
088:                eList = getHome().findInfo_beetwen(value, value);
089:
090:                getHome().remove("991959_1");
091:                getHome().remove("991959_2");
092:            }
093:
094:            // juste pour voir
095:
096:            public void testCreateRemoveFinderBetween() throws Exception {
097:                int value = 991959;
098:                getHome().create("991959_1", value, value);
099:                getHome().create("991959_2", value, value);
100:                Simple entity = null;
101:                Enumeration eList = null;
102:
103:                getHome().remove("991959_1");
104:                getHome().remove("991959_2");
105:            }
106:
107:            /**
108:             * testFinderEqualOne  verify a finder method that return a Enumeration
109:             * whith a where clause :
110:             *   where c_info = ?1 and c_numtest = ?1
111:             * the object of this test is to verify the correct interpretation of parameters
112:             * ?1 ?2
113:             */
114:            public void testFinderEqualOne() throws Exception {
115:                Simple entity = null;
116:                Enumeration eList = null;
117:                eList = getHome().findEqualOne(80);
118:                int nb = 0;
119:                while (eList.hasMoreElements()) {
120:                    entity = (Simple) javax.rmi.PortableRemoteObject.narrow(
121:                            eList.nextElement(), Simple.class);
122:                    nb++;
123:                    assertEquals(80, entity.getInfo());
124:                    assertEquals(80, entity.getNumTest());
125:                }
126:                assertEquals(2, nb);
127:            }
128:
129:            /**
130:             * testFinderEqualTwo  verify a finder method that return a Enumeration
131:             * whith a where clause :
132:             *   where c_info = ? and c_numtest = ?
133:             * the object of this test is to verify the correct interpretation of parameters
134:             * ?1 ?2
135:             */
136:            public void testFinderEqualTwo() throws Exception {
137:                Simple entity = null;
138:                Enumeration eList = null;
139:                eList = getHome().findEqualTwo(100, 90);
140:                int nb = 0;
141:                while (eList.hasMoreElements()) {
142:                    entity = (Simple) javax.rmi.PortableRemoteObject.narrow(
143:                            eList.nextElement(), Simple.class);
144:                    nb++;
145:                    assertEquals(100, entity.getInfo());
146:                    assertEquals(90, entity.getNumTest());
147:                }
148:                assertEquals(1, nb);
149:            }
150:
151:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.