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