/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
package org.apache.qpid.junit.extensions;
import junit.framework.Test;
import junit.framework.TestResult;
import junit.framework.TestSuite;
import org.apache.log4j.Logger;
import org.apache.qpid.junit.extensions.listeners.CSVTestListener;
import org.apache.qpid.junit.extensions.listeners.ConsoleTestListener;
import org.apache.qpid.junit.extensions.listeners.XMLTestListener;
import org.apache.qpid.junit.extensions.util.CommandLineParser;
import org.apache.qpid.junit.extensions.util.MathUtils;
import org.apache.qpid.junit.extensions.util.ParsedProperties;
import org.apache.qpid.junit.extensions.util.TestContextProperties;
import java.io.*;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
/**
* TKTestRunner extends {@link junit.textui.TestRunner} with the ability to run tests multiple times, to execute a test
* simultaneously using many threads, to put a delay between test runs and adds support for tests that take integer
* parameters that can be 'stepped' through on multiple test runs. These features can be accessed by using this class
* as an entry point and passing command line arguments to specify which features to use:
*
*
* -c [10:20:30:40:50] | Runs the test with 10,20,...,50 threads.
* |
-s [1:100]:samples=10
* | Runs the test with ten different size parameters evenly spaced between 1 and 100.
* |
-s [1:1000000]:samples=10:exp
* | Runs the test with ten different size parameters exponentially spaced between 1 and 1000000.
* |
-r 10 | Runs each test ten times.
* |
-d 10H | Runs the test repeatedly for 10 hours.
* |
-d 1M, -r 10
* | Runs the test repeatedly for 1 minute but only takes a timing sample every 10 test runs.
* |
-r 10, -c [1:5:10:50], -s [100:1000:10000]
* | Runs 12 test cycles (4 concurrency samples * 3 size sample), with 10 repeats each. In total the test
* will be run 199 times (3 + 15 + 30 + 150)
* |
cache=true | Passes the 'cache' parameter with value 'true' to the test.
* |
cache=[true:false] | Runs the test with the 'cache' parameter set to 'true' and 'false'.
* |
cacheSize=[1000:1000000],samples=4,exp
* | Runs the test with the 'cache' parameter set to a series of exponentially increasing sizes.
* |
*
*