Author: thomas.diesler(a)jboss.com
Date: 2009-02-18 11:44:48 -0500 (Wed, 18 Feb 2009)
New Revision: 3928
Removed:
jbpm3/tags/jbpm-3.2.5.SP1/modules/core/src/test/java/org/jbpm/perf/AsyncCallTest.java
Log:
Rollback -r3913:3818 - NEVER COMMIT ON A TAG
Deleted:
jbpm3/tags/jbpm-3.2.5.SP1/modules/core/src/test/java/org/jbpm/perf/AsyncCallTest.java
===================================================================
---
jbpm3/tags/jbpm-3.2.5.SP1/modules/core/src/test/java/org/jbpm/perf/AsyncCallTest.java 2009-02-18
15:13:34 UTC (rev 3927)
+++
jbpm3/tags/jbpm-3.2.5.SP1/modules/core/src/test/java/org/jbpm/perf/AsyncCallTest.java 2009-02-18
16:44:48 UTC (rev 3928)
@@ -1,101 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This 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 (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jbpm.perf;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jbpm.command.CommandService;
-import org.jbpm.command.StartProcessInstanceCommand;
-import org.jbpm.command.impl.CommandServiceImpl;
-import org.jbpm.db.AbstractDbTestCase;
-import org.jbpm.graph.def.ActionHandler;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.graph.exe.ProcessInstance;
-
-/**
- * This tests creates 10000 process instances. Every instance has an async call
- * to the test class. See JIRA bugs SOA-1175 and JBPM-2043.
- *
- * @author mvecera(a)redhat.com, pmacik(a)redhat.com
- */
-public class AsyncCallTest extends AbstractDbTestCase implements ActionHandler {
- private static final Log log = LogFactory.getLog(AsyncCallTest.class);
- private static final long serialVersionUID = -2962894670623757448L;
- private CommandService commandService = new
CommandServiceImpl(getJbpmConfiguration());
- private static final int INSTANCES = 10000;
- ProcessDefinition processDefinition;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- createSchema();
- processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition xmlns=\"urn:jbpm.org:jpdl-3.1\"
name=\"processDefinition1\">" +
- "<start-state name=\"start\">" +
- "<transition name=\"to_state\"
to=\"end\">" +
- "<action class=\"org.jbpm.perf.AsyncCallTest\"
/>" +
- "</transition>" +
- "</start-state>" +
- "<end-state name=\"end\">" +
- "</end-state>" +
- "</process-definition>");
- saveAndReload(processDefinition);
- }
-
- @Override
- protected void tearDown() throws Exception {
- beginSessionTransaction();
- jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
- super.tearDown();
- }
-
- public void testAsyncCall() {
- log.info("");
- log.info("=== EXECUTING PERFORMANCE TEST
================================================");
- log.info("");
-
- long start = System.currentTimeMillis();
-
- commitAndCloseSession();
- startJobExecutor();
-
- for (int i = 0; i < INSTANCES; i++) {
- beginSessionTransaction();
- StartProcessInstanceCommand startCommand = new StartProcessInstanceCommand();
- startCommand.setProcessDefinitionId(processDefinition.getId());
- startCommand.setProcessDefinitionName("processDefinition1");
- ProcessInstance pi = (ProcessInstance) commandService.execute(startCommand);
- commitAndCloseSession();
- }
-
- stopJobExecutor();
-
- long stop = System.currentTimeMillis();
- log.info("=== TEST FINISHED PROCESSING " + INSTANCES + " INSTANCES
IN " + (stop - start) + " MILLIS ===");
- log.info("=== THIS IS " + INSTANCES / ((double) (stop - start) / 1000) +
" PROCESSES PER SECOND ===");
- }
-
- public void execute(ExecutionContext executionContext) throws Exception {
- // no-op
- }
-}