1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.scxml2.env.groovy;
18
19 import java.util.Set;
20
21 import org.apache.commons.scxml2.SCXMLExecutor;
22 import org.apache.commons.scxml2.SCXMLTestHelper;
23 import org.apache.commons.scxml2.model.EnterableState;
24 import org.junit.Assert;
25 import org.junit.Test;
26
27 public class StaticMethodTest {
28
29 @Test
30 public void testGroovyStaticMethodInvocation() throws Exception {
31 SCXMLExecutor exec = SCXMLTestHelper.getExecutor("org/apache/commons/scxml2/env/groovy/static-method.xml");
32 exec.getRootContext().set("System", System.class);
33 exec.go();
34 Set<EnterableState> currentStates = exec.getStatus().getStates();
35 Assert.assertEquals(1, currentStates.size());
36 Assert.assertEquals("static", currentStates.iterator().next().getId());
37 }
38 }