KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > stests > bank > A_bankWrite


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_bankWrite.java,v 1.4 2004/08/06 12:42:59 durieuxp Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.stests.bank;
27
28
29
30 public abstract class A_bankWrite extends A_bank {
31
32     public A_bankWrite(String JavaDoc name) {
33         super(name);
34     }
35
36     public void testBasicMove() throws Exception JavaDoc {
37         ope(OP_MOVE, 0, 9, 1, 1);
38     }
39
40     public void testBasicMoveNC() throws Exception JavaDoc {
41         ope(OP_MOVE, 0, 9, 1, 1, 5, false);
42     }
43
44     public void testLongMove() throws Exception JavaDoc {
45         ope(OP_MOVE, 0, 9, 100, 1);
46     }
47
48     public void testLongMoveNC() throws Exception JavaDoc {
49         ope(OP_MOVE, 0, 9, 100, 1, 5, false);
50     }
51
52     /**
53      * This test is long with F_bankCS, because deadlocks
54      * occur and are solved by the transaction timeout.
55      */

56     public void testMultiLongMove() throws Exception JavaDoc {
57         ope(OP_MOVE, 0, 9, 10, 10);
58     }
59
60     public void testBasicRemove() throws Exception JavaDoc {
61         ope(OP_CREATE, 3000, 4000, 1, 1);
62         ope(OP_REMOVE, 3000, 4000, 1, 1);
63     }
64
65     public void testLongRemove() throws Exception JavaDoc {
66         ope(OP_CREATE, 3000, 4000, 100, 1);
67         ope(OP_REMOVE, 3000, 4000, 100, 1);
68     }
69
70     public void testMultiRemove() throws Exception JavaDoc {
71         ope(OP_CREATE, 3000, 4000, 100, 1);
72         ope(OP_REMOVE, 3000, 4000, 1, 8);
73     }
74
75     public void testLongMultiRemove() throws Exception JavaDoc {
76         ope(OP_CREATE, 3000, 3300, 300, 1);
77         ope(OP_REMOVE, 3000, 3300, 10, 8);
78     }
79
80     /**
81      * Test the rollback
82      */

83     public void testBasicRB() throws Exception JavaDoc {
84         ope(OP_MOVE, 0, 2, 4, 1, 700);
85     }
86
87     public void testMultiRB() throws Exception JavaDoc {
88         ope(OP_MOVE, 0, 4, 4, 5, 600);
89     }
90
91     public void testLongRB() throws Exception JavaDoc {
92         ope(OP_MOVE, 0, 4, 100, 1, 800);
93     }
94
95     public void testLongMultiRB() throws Exception JavaDoc {
96         ope(OP_MOVE, 0, 8, 50, 4, 900);
97     }
98
99     public void testBasicCreate() throws Exception JavaDoc {
100         ope(OP_CREATE, 100, 150, 1, 1);
101     }
102
103     public void testLongCreate() throws Exception JavaDoc {
104         ope(OP_CREATE, 200, 250, 30, 1);
105     }
106
107     public void testMultiCreate() throws Exception JavaDoc {
108         ope(OP_CREATE, 1000, 1900, 1, 12);
109     }
110
111     public void testLongMultiCreate() throws Exception JavaDoc {
112         ope(OP_CREATE, 2000, 9000, 10, 8);
113     }
114
115     public void testMultiMove() throws Exception JavaDoc {
116         ope(OP_MOVE, 0, 5, 1, 5);
117     }
118
119
120 }
121
Popular Tags