/*                          
 * mBench: The Open Source Micro Benchmark Tool 
 *                                             
 * Distributable under GPL license. 
 * See terms of license at gnu.org.                 
 *
 * Copyright (C) 2005 Sumisho Computer Systems Corp.
 */
package test.jp.co.scs.mbench.stub;

import jp.co.scs.mbench.ThreadTerminateException;
import jp.co.scs.mbench.component.BenchmarkSupport;

/**
 *      This stub emulates the error of BenchmarkTerminateException.
 * 
 *      @author Tetsuro Ikeda
 */
public class StubBenchmarkContainer2 extends BenchmarkSupport {
    
    public static final int ABORT_NUMBER = 5;
    
    private int count = 0;
    
    public String[] execute() throws ThreadTerminateException {
        count++;
        if (count < ABORT_NUMBER) {
            return null;
        } else {
            throw new ThreadTerminateException();
        }
    }
}
