/*
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 1999 Bull S.A.
 * Contact: jonas-team@objectweb.org
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.objectweb.jonas.stests.bank;



public abstract class A_bankWrite extends A_bank {

    public A_bankWrite(String name) {
        super(name);
    }

    public void testBasicMove() throws Exception {
        ope(OP_MOVE, 0, 9, 1, 1);
    }

    public void testBasicMoveNC() throws Exception {
        ope(OP_MOVE, 0, 9, 1, 1, 5, false);
    }

    public void testLongMove() throws Exception {
        ope(OP_MOVE, 0, 9, 100, 1);
    }

    public void testLongMoveNC() throws Exception {
        ope(OP_MOVE, 0, 9, 100, 1, 5, false);
    }

    /**
     * This test is long with F_bankCS, because deadlocks
     * occur and are solved by the transaction timeout.
     */
    public void testMultiLongMove() throws Exception {
        ope(OP_MOVE, 0, 9, 10, 10);
    }

    public void testBasicRemove() throws Exception {
        ope(OP_CREATE, 3000, 4000, 1, 1);
        ope(OP_REMOVE, 3000, 4000, 1, 1);
    }

    public void testLongRemove() throws Exception {
        ope(OP_CREATE, 3000, 4000, 100, 1);
        ope(OP_REMOVE, 3000, 4000, 100, 1);
    }

    public void testMultiRemove() throws Exception {
        ope(OP_CREATE, 3000, 4000, 100, 1);
        ope(OP_REMOVE, 3000, 4000, 1, 8);
    }

    public void testLongMultiRemove() throws Exception {
        ope(OP_CREATE, 3000, 3300, 300, 1);
        ope(OP_REMOVE, 3000, 3300, 10, 8);
    }

    /**
     * Test the rollback
     */
    public void testBasicRB() throws Exception {
        ope(OP_MOVE, 0, 2, 4, 1, 700);
    }

    public void testMultiRB() throws Exception {
        ope(OP_MOVE, 0, 4, 4, 5, 600);
    }

    public void testLongRB() throws Exception {
        ope(OP_MOVE, 0, 4, 100, 1, 800);
    }

    public void testLongMultiRB() throws Exception {
        ope(OP_MOVE, 0, 8, 50, 4, 900);
    }

    public void testBasicCreate() throws Exception {
        ope(OP_CREATE, 100, 150, 1, 1);
    }

    public void testLongCreate() throws Exception {
        ope(OP_CREATE, 200, 250, 30, 1);
    }

    public void testMultiCreate() throws Exception {
        ope(OP_CREATE, 1000, 1900, 1, 12);
    }

    public void testLongMultiCreate() throws Exception {
        ope(OP_CREATE, 2000, 9000, 10, 8);
    }

    public void testMultiMove() throws Exception {
        ope(OP_MOVE, 0, 5, 1, 5);
    }


}
