01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.workflow;
17:
18: import java.util.Date;
19:
20: import junit.framework.TestCase;
21: import edu.iu.uis.eden.clientapp.WorkflowDocument;
22: import edu.iu.uis.eden.clientapp.vo.NetworkIdVO;
23:
24: /**
25: * I basic loop to do things to workflow documents
26: */
27: public class KualiRouterHammer extends TestCase {
28:
29: public void testTheHammer() throws Exception {
30:
31: if (true)
32: return;
33:
34: int counter = 0;
35: long total = 0;
36: while (counter < 20) {
37: long begin = new Date().getTime();
38: WorkflowDocument workflowDocument = new WorkflowDocument(
39: new NetworkIdVO("KWESTERN"),
40: "AuxiliaryVoucherDocument");
41: workflowDocument.getRouteHeaderId();
42: long end = new Date().getTime();
43: long requestTime = end - begin;
44: total += requestTime;
45: counter++;
46: System.out.println("Request time " + requestTime);
47: System.out.println("Average " + total / counter);
48: }
49:
50: System.out.println("Total time " + total);
51: System.out.println("Loops " + counter);
52: System.out.println("Average " + total / counter);
53:
54: }
55: }
|