KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > stests > manac > A_stress


1 /*
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: A_stress.java,v 1.6 2003/12/03 13:01:20 coqp Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.stests.manac;
27
28 /**
29  * set of testCases used to load the EJBServer
30  */

31 public abstract class A_stress extends A_manac {
32
33     // default values
34
int accounts = 20; // 20 accounts (nb of pre-created accounts)
35
int delay = 0; // no delay added
36
int loops = 50; // 100 loop
37
int amount = 1; // withdraw value : 1 (initial value is 1000)
38
int threads = 4; // threads
39
int checklevel = 0; // check accounts after every test
40
int timeout = 10; // seconds
41

42     public A_stress(String JavaDoc name) {
43         super(name);
44     }
45
46     public int getAccounts() {
47         return accounts;
48     }
49
50     public void testStress1() throws Exception JavaDoc {
51         manac(accounts, delay, loops, amount, threads, checklevel, timeout);
52     }
53
54     public void testStress2() throws Exception JavaDoc {
55         int delay = 3;
56         manac(accounts, delay, loops, amount, threads, checklevel, timeout);
57     }
58
59     public void testStress3() throws Exception JavaDoc {
60         int amount = 100;
61         manac(accounts, delay, loops, amount, threads, checklevel, timeout);
62     }
63
64     public void testStress4() throws Exception JavaDoc {
65         int amount = 300;
66         int loops = 20;
67         manac(accounts, delay, loops, amount, threads, checklevel, timeout);
68     }
69
70     public void testStress5() throws Exception JavaDoc {
71         int accounts = 50;
72         manac(accounts, delay, loops, amount, threads, checklevel, timeout);
73     }
74
75     public void testStress6() throws Exception JavaDoc {
76         int accounts = 50;
77         int amount = 100;
78         manac(accounts, delay, loops, amount, threads, checklevel, timeout);
79     }
80
81     public void testStress7() throws Exception JavaDoc {
82         int delay = 3;
83         int accounts = 50;
84         manac(accounts, delay, loops, amount, threads, checklevel, timeout);
85     }
86
87     public void testStress8() throws Exception JavaDoc {
88         int accounts = 1000;
89         manac(accounts, delay, loops, amount, threads, checklevel, timeout);
90     }
91
92     public void testStress9() throws Exception JavaDoc {
93         int accounts = 1000;
94         int amount = 80;
95         int loops = 20;
96         manac(accounts, delay, loops, amount, threads, checklevel, timeout);
97     }
98
99     /**
100      * same test than in A_Multi, but with more loops.
101      */

102     public void testConcurrentCreate() throws Exception JavaDoc {
103         int accounts = 40;
104         int threads = 25;
105         int loops = 8;
106         int amount = 10;
107         int checklevel = 2;
108         manac(accounts, delay, loops, amount, threads, checklevel, timeout);
109     }
110
111 }
112
Popular Tags