1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package th.co.edge.jseq.argouml;
24
25 import java.io.File;
26
27 import junit.framework.Test;
28 import junit.framework.TestCase;
29 import junit.framework.TestSuite;
30 import th.co.edge.jseq.Activation;
31 import th.co.edge.jseq.ActivationList;
32 import th.co.edge.jseq.Diagram;
33 import th.co.edge.jseq.TestMethodImpl;
34
35 public class ArgoUMLGeneratorTest extends TestCase {
36 public ArgoUMLGeneratorTest(String name) {
37 super(name);
38 }
39
40 public static Test suite() {
41 TestSuite suite = new TestSuite(ArgoUMLGeneratorTest.class);
42 return suite;
43 }
44
45 public static void main(String[] args) throws Exception {
46 ArgoUMLGeneratorTest testcase = new ArgoUMLGeneratorTest("");
47 testcase.test();
48 }
49
50
51
52
53
54 public void test() throws Exception {
55 ArgoUMLGenerator generator = new ArgoUMLGenerator();
56
57 ActivationList activationList = th.co.edge.jseq.ActivationListTest
58 .buildActivationList();
59 Diagram diagram = generator.generate(activationList);
60 File file = new File("test.zargo");
61 diagram.save(file);
62 }
63
64
65
66
67
68 public static ActivationList buildActivationList() {
69 Activation root = new Activation(null, "Foo", new TestMethodImpl(
70 "start"), -1);
71 Activation barInit = new Activation(root, "Bar", new TestMethodImpl(
72 "<init>", true), -1);
73 new Activation(barInit, "Baz", new TestMethodImpl("hubba"), -1);
74 new Activation(root, "Bar", new TestMethodImpl("frotz"), -1);
75
76 ActivationList activationList = new ActivationList();
77 activationList.add(root);
78 return activationList;
79 }
80 }