/*
* This file is part of the WfMOpen project.
* Copyright (C) 2001-2003 Danet GmbH (www.danet.de), GS-AN.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: LoadRuns.java 2550 2007-10-22 14:00:54Z $
*
* $Log$
* Revision 1.1.1.1 2003/12/19 13:01:51 drmlipp
* Updated to 1.1rc1
*
* Revision 1.7 2003/10/23 14:22:43 lipp
* Moved import to a better place.
*
* Revision 1.6 2003/10/22 15:26:54 lipp
* Added create and start test.
*
* Revision 1.5 2003/10/22 11:00:58 lipp
* Extended.
*
* Revision 1.4 2003/10/21 21:00:45 lipp
* Moved EJBClientTest to new junit sub-package.
*
* Revision 1.3 2003/10/21 20:25:58 lipp
* Updated.
*
* Revision 1.2 2003/10/21 15:51:42 lipp
* Specific load test output.
*
* Revision 1.1 2003/10/20 21:04:34 lipp
* Getting started.
*
*/
package load;
import java.util.HashMap;
import java.util.Map;
import javax.security.auth.login.LoginException;
import de.danet.an.util.junit.EJBClientTest;
import de.danet.an.util.junit.NamedTestGroup;
import com.clarkware.junitperf.ConstantTimer;
import com.clarkware.junitperf.LoadTest;
import com.clarkware.junitperf.TestMethodFactory;
import common.UTLoginContext;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* This class provides ...
*
* @author <a href="mailto:mnl@mnl.de">Michael N. Lipp</a>
* @version $Revision: 2550 $
*/
public class LoadRuns extends TestCase {
private static UTLoginContext plc = null;
static {
try {
plc = new UTLoginContext();
plc.login();
} catch (LoginException e) {
throw new IllegalStateException (e.getMessage ());
}
}
/**
* Creates an instance of <code>LoadRuns</code>
* with all attributes initialized to default values.
*/
public LoadRuns (String name) {
super (name);
}
/**
* Make this test suite.
*/
public static Test suite() {
TestSuite rootSuite = new TestSuite();
rootSuite.addTest(new ProcHandling("importProcessDefinitions"));
TestSuite suite = new TestSuite();
TestMethodFactory factory
= new TestMethodFactory(ProcHandling.class, "createProcess6Acts");
addTest (suite, "Create 6 activities", factory);
factory = new TestMethodFactory
(ProcHandling.class, "createProcess11Acts");
addTest (suite, "Create 11 activities", factory);
factory = new TestMethodFactory
(ProcHandling.class, "createProcess21Acts");
addTest (suite, "Create 21 activities", factory);
Map tg = new HashMap ();
tg.put ("title", "Create Tests");
rootSuite.addTest (new NamedTestGroup (suite, "TestGroup", tg));
suite = new TestSuite ();
factory = new TestMethodFactory
(ProcHandling.class, "createStart11Acts");
addTest (suite, "Create and start 11 activities", factory);
tg.put ("title", "Create and Start Tests");
rootSuite.addTest (new NamedTestGroup (suite, "TestGroup", tg));
return new EJBClientTest (plc, rootSuite);
}
private static void addTest (TestSuite parentSuite, String title,
TestMethodFactory factory) {
TestSuite suite = new TestSuite ();
Map sas = new HashMap ();
sas.put ("users", "1");
suite.addTest
(new NamedTestGroup
(new LoadTest(factory, 1, 20, new ConstantTimer(10)),
"Samples", sas));
sas.put ("users", "2");
suite.addTest
(new NamedTestGroup
(new LoadTest(factory, 2, 10, new ConstantTimer(10)),
"Samples", sas));
sas.put ("users", "4");
suite.addTest
(new NamedTestGroup
(new LoadTest(factory, 4, 5, new ConstantTimer(10)),
"Samples", sas));
sas.put ("users", "5");
suite.addTest
(new NamedTestGroup
(new LoadTest(factory, 5, 4, new ConstantTimer(10)),
"Samples", sas));
sas.put ("users", "10");
suite.addTest
(new NamedTestGroup
(new LoadTest(factory, 10, 2, new ConstantTimer(10)),
"Samples", sas));
Map tt = new HashMap ();
tt.put ("title", title);
parentSuite.addTest (new NamedTestGroup(suite, "Test", tt));
}
}