/*
 * 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.manac;

/**
 * set of testCases used to load the EJBServer
 */
public abstract class A_stress extends A_manac {

    // default values
    int accounts = 20;          // 20 accounts (nb of pre-created accounts)
    int delay = 0;              // no delay added
    int loops = 50;              // 100 loop
    int amount = 1;            // withdraw value : 1 (initial value is 1000)
    int threads = 4;            // threads
    int checklevel = 0;         // check accounts after every test
    int timeout = 10;           // seconds

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

    public int getAccounts() {
        return accounts;
    }

    public void testStress1() throws Exception {
        manac(accounts, delay, loops, amount, threads, checklevel, timeout);
    }

    public void testStress2() throws Exception {
        int delay = 3;
        manac(accounts, delay, loops, amount, threads, checklevel, timeout);
    }

    public void testStress3() throws Exception {
        int amount = 100;
        manac(accounts, delay, loops, amount, threads, checklevel, timeout);
    }

    public void testStress4() throws Exception {
        int amount = 300;
        int loops = 20;
        manac(accounts, delay, loops, amount, threads, checklevel, timeout);
    }

    public void testStress5() throws Exception {
        int accounts = 50;
        manac(accounts, delay, loops, amount, threads, checklevel, timeout);
    }

    public void testStress6() throws Exception {
        int accounts = 50;
        int amount = 100;
        manac(accounts, delay, loops, amount, threads, checklevel, timeout);
    }

    public void testStress7() throws Exception {
        int delay = 3;
        int accounts = 50;
        manac(accounts, delay, loops, amount, threads, checklevel, timeout);
    }

    public void testStress8() throws Exception {
        int accounts = 1000;
        manac(accounts, delay, loops, amount, threads, checklevel, timeout);
    }

    public void testStress9() throws Exception {
        int accounts = 1000;
        int amount = 80;
        int loops = 20;
        manac(accounts, delay, loops, amount, threads, checklevel, timeout);
    }

    /**
     * same test than in A_Multi, but with more loops.
     */
    public void testConcurrentCreate() throws Exception {
        int accounts = 40;
        int threads = 25;
        int loops = 8;
        int amount = 10;
        int checklevel = 2; 
        manac(accounts, delay, loops, amount, threads, checklevel, timeout);
    }

}
