Source Code Cross Referenced for A_multi.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas » stests » manac » 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.stests.manac 
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: A_multi.java 3813 2003-12-03 13:01:20Z coqp $
023:         * --------------------------------------------------------------------------
024:         */
025:
026:        package org.objectweb.jonas.stests.manac;
027:
028:        /**
029:         * This TestCase is a set of multithreaded clients accessing concurrently
030:         * the set of accounts. For each test, an indicative Time (in millisec) is
031:         * given, to have a rough idea of the relative time of the test case.
032:         * (first value = CMP1, second value = CMP2)
033:         */
034:        public abstract class A_multi extends A_manac {
035:
036:            // default values
037:            int accounts = 20; // 20 accounts (nb of pre-created accounts)
038:            int delay = 0; // no delay added
039:            int loops = 1; // 1 loop
040:            int amount = 10; // withdraw value : 10 (initial value is 1000)
041:            int threads = 2; // 2 threads
042:            int checklevel = 2; // check accounts after every test
043:            int timeout = 12; // 12 seconds
044:
045:            public A_multi(String name) {
046:                super (name);
047:            }
048:
049:            public int getAccounts() {
050:                return accounts;
051:            }
052:
053:            /*
054:             * Simplest test with 2 threads : 1 loop, 2 threads, no rollback, no delay
055:             * Time: 
056:             */
057:            public void testBasic() throws Exception {
058:                manac(accounts, delay, loops, amount, threads, checklevel,
059:                        timeout);
060:            }
061:
062:            /*
063:             * 2 threads with possible rollback
064:             * Time: 
065:             */
066:            public void testRb() throws Exception {
067:                int accounts = 6;
068:                int loops = 10;
069:                int amount = 400;
070:                manac(accounts, delay, loops, amount, threads, checklevel,
071:                        timeout);
072:            }
073:
074:            /*
075:             * add a delay
076:             * Time: 
077:             */
078:            public void testD3T3() throws Exception {
079:                int accounts = 4;
080:                int delay = 3;
081:                int loops = 6;
082:                int threads = 3;
083:                manac(accounts, delay, loops, amount, threads, checklevel,
084:                        timeout);
085:            }
086:
087:            /*
088:             * 4 threads 
089:             * Time: 
090:             */
091:            public void testT4() throws Exception {
092:                int loops = 12;
093:                int threads = 4;
094:                manac(accounts, delay, loops, amount, threads, checklevel,
095:                        timeout);
096:            }
097:
098:            /*
099:             * 6 threads 
100:             * Time: 3,449 20,143 (or possible failure)
101:             */
102:            public void testT6() throws Exception {
103:                int loops = 8;
104:                int threads = 6;
105:                manac(accounts, delay, loops, amount, threads, checklevel,
106:                        timeout);
107:            }
108:
109:            /*
110:             * 6 threads with collisions
111:             * Time: 27,967 52,204
112:             */
113:            public void testCollT6() throws Exception {
114:                int accounts = 4;
115:                int threads = 6;
116:                manac(accounts, delay, loops, amount, threads, checklevel,
117:                        timeout);
118:            }
119:
120:            /*
121:             * 8 threads
122:             * Time: 73,842 failure
123:             */
124:            public void testT8() throws Exception {
125:                int loops = 6;
126:                int threads = 8;
127:                manac(accounts, delay, loops, amount, threads, checklevel,
128:                        timeout);
129:            }
130:
131:            /*
132:             * 8 threads with many collisions
133:             * Time: 42,465 42,846
134:             */
135:            public void testCollT8() throws Exception {
136:                int accounts = 4;
137:                int threads = 8;
138:                manac(accounts, delay, loops, amount, threads, checklevel,
139:                        timeout);
140:            }
141:
142:            /*
143:             * 16 threads
144:             * Time: 33,22 failure
145:             */
146:            public void testT16() throws Exception {
147:                int threads = 16;
148:                manac(accounts, delay, loops, amount, threads, checklevel,
149:                        timeout);
150:            }
151:
152:            /*
153:             * more threads again
154:             * failure failure
155:             */
156:            public void testT30() throws Exception {
157:                int threads = 30;
158:                manac(accounts, delay, loops, amount, threads, checklevel,
159:                        timeout);
160:            }
161:
162:            /*
163:             * 4 threads and possible create
164:             * Time: 3,706 3,227
165:             */
166:            public void testCreateT4() throws Exception {
167:                int accounts = 200;
168:                int loops = 12;
169:                int threads = 4;
170:                manac(accounts, delay, loops, amount, threads, checklevel,
171:                        timeout);
172:            }
173:
174:            /*
175:             * 2 threads with possible rollback and create
176:             * Time: 3,601 7,146
177:             */
178:            public void testCreateRbT2() throws Exception {
179:                int accounts = 100;
180:                int loops = 10;
181:                int amount = 444;
182:                manac(accounts, delay, loops, amount, threads, checklevel,
183:                        timeout);
184:            }
185:
186:            /*
187:             * 4 threads with delay and possible create
188:             * Time: 
189:             */
190:            public void testCreateD2T4() throws Exception {
191:                int accounts = 200;
192:                int delay = 2;
193:                int threads = 4;
194:                manac(accounts, delay, loops, amount, threads, checklevel,
195:                        timeout);
196:            }
197:
198:            /*
199:             * 6 threads and possible create
200:             * Time: 
201:             */
202:            public void testCreateT6() throws Exception {
203:                int accounts = 400;
204:                int loops = 8;
205:                int threads = 6;
206:                manac(accounts, delay, loops, amount, threads, checklevel,
207:                        timeout);
208:            }
209:
210:            /*
211:             * 8 threads and possible create
212:             * Time: 
213:             */
214:            public void testCreateT8() throws Exception {
215:                int accounts = 400;
216:                int loops = 6;
217:                int threads = 8;
218:                manac(accounts, delay, loops, amount, threads, checklevel,
219:                        timeout);
220:            }
221:
222:            /*
223:             * 16 threads and possible create
224:             * Time: 5,381 15,261
225:             */
226:            public void testCreateT16() throws Exception {
227:                int accounts = 800;
228:                int threads = 16;
229:                manac(accounts, delay, loops, amount, threads, checklevel,
230:                        timeout);
231:            }
232:
233:            /*
234:             * 16 threads more loops
235:             * Time: 14,431 14,239
236:             */
237:            public void testCreateD1T16() throws Exception {
238:                int accounts = 300;
239:                int delay = 1;
240:                int threads = 16;
241:                manac(accounts, delay, loops, amount, threads, checklevel,
242:                        timeout);
243:            }
244:
245:            /*
246:             * Test many create in parallell
247:             */
248:            public void testConcurrentCreate() throws Exception {
249:                int accounts = 40;
250:                int threads = 30;
251:                int loops = 1;
252:                int timeout = 18;
253:                manac(accounts, delay, loops, amount, threads, checklevel,
254:                        timeout);
255:            }
256:
257:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.