1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.routeheader;
17
18 import org.junit.Ignore;
19 import org.junit.Test;
20 import org.kuali.rice.kew.api.WorkflowDocument;
21 import org.kuali.rice.kew.api.WorkflowDocumentFactory;
22 import org.kuali.rice.kew.test.KEWTestCase;
23 import org.kuali.rice.kew.util.PerformanceLogger;
24
25
26
27
28 public class WorkflowDocumentServiceTest extends KEWTestCase {
29 protected void loadTestData() throws Exception {
30
31 }
32
33 @Ignore @Test
34 public void testCreatePerformanceWithBranches() {
35 testCreatePerformance("DocTypeWithBranches.xml", "Testing.LongRoutePath");
36 }
37
38 @Ignore @Test
39 public void testCreatePerformanceWithoutBranches() {
40 testCreatePerformance("DocTypeWithoutBranches.xml", "Testing.LongRoutePathWithoutBranches");
41 }
42
43 protected void testCreatePerformance(String xml, String doctype) {
44 PerformanceLogger logger = new PerformanceLogger();
45 logger.log("Loading " + xml);
46 loadXmlFile(xml);
47 logger.log("Done loading " + xml);
48
49 System.err.println("Creating and routing " + doctype);
50 WorkflowDocument document = WorkflowDocumentFactory.createDocument("admin", doctype);
51
52 document.route("");
53
54 document.setTitle("Testing");
55
56 logger = new PerformanceLogger();
57 logger.log("starting save routing data");
58 document.saveDocumentData();
59 logger.log("finished save routing data");
60 }
61 }