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_bankWrite.java 5248 2004-08-06 12:42:59Z durieuxp $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.stests.bank;
027:
028: public abstract class A_bankWrite extends A_bank {
029:
030: public A_bankWrite(String name) {
031: super (name);
032: }
033:
034: public void testBasicMove() throws Exception {
035: ope(OP_MOVE, 0, 9, 1, 1);
036: }
037:
038: public void testBasicMoveNC() throws Exception {
039: ope(OP_MOVE, 0, 9, 1, 1, 5, false);
040: }
041:
042: public void testLongMove() throws Exception {
043: ope(OP_MOVE, 0, 9, 100, 1);
044: }
045:
046: public void testLongMoveNC() throws Exception {
047: ope(OP_MOVE, 0, 9, 100, 1, 5, false);
048: }
049:
050: /**
051: * This test is long with F_bankCS, because deadlocks
052: * occur and are solved by the transaction timeout.
053: */
054: public void testMultiLongMove() throws Exception {
055: ope(OP_MOVE, 0, 9, 10, 10);
056: }
057:
058: public void testBasicRemove() throws Exception {
059: ope(OP_CREATE, 3000, 4000, 1, 1);
060: ope(OP_REMOVE, 3000, 4000, 1, 1);
061: }
062:
063: public void testLongRemove() throws Exception {
064: ope(OP_CREATE, 3000, 4000, 100, 1);
065: ope(OP_REMOVE, 3000, 4000, 100, 1);
066: }
067:
068: public void testMultiRemove() throws Exception {
069: ope(OP_CREATE, 3000, 4000, 100, 1);
070: ope(OP_REMOVE, 3000, 4000, 1, 8);
071: }
072:
073: public void testLongMultiRemove() throws Exception {
074: ope(OP_CREATE, 3000, 3300, 300, 1);
075: ope(OP_REMOVE, 3000, 3300, 10, 8);
076: }
077:
078: /**
079: * Test the rollback
080: */
081: public void testBasicRB() throws Exception {
082: ope(OP_MOVE, 0, 2, 4, 1, 700);
083: }
084:
085: public void testMultiRB() throws Exception {
086: ope(OP_MOVE, 0, 4, 4, 5, 600);
087: }
088:
089: public void testLongRB() throws Exception {
090: ope(OP_MOVE, 0, 4, 100, 1, 800);
091: }
092:
093: public void testLongMultiRB() throws Exception {
094: ope(OP_MOVE, 0, 8, 50, 4, 900);
095: }
096:
097: public void testBasicCreate() throws Exception {
098: ope(OP_CREATE, 100, 150, 1, 1);
099: }
100:
101: public void testLongCreate() throws Exception {
102: ope(OP_CREATE, 200, 250, 30, 1);
103: }
104:
105: public void testMultiCreate() throws Exception {
106: ope(OP_CREATE, 1000, 1900, 1, 12);
107: }
108:
109: public void testLongMultiCreate() throws Exception {
110: ope(OP_CREATE, 2000, 9000, 10, 8);
111: }
112:
113: public void testMultiMove() throws Exception {
114: ope(OP_MOVE, 0, 5, 1, 5);
115: }
116:
117: }
|