Author: rahul
Date: Wed Dec 12 10:40:22 2007
New Revision: 603698
URL: http://svn.apache.org/viewvc?rev=603698&view=rev
Log:
Better encapsulation (build.xml + Sun JDK 1.4 caused ITE in this test).
Modified:
commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/AbstractStateMachineTest.java
Modified:
commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/AbstractStateMachineTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/AbstractStateMachineTest.java?rev=603698&r1=603697&r2=603698&view=diff
==============================================================================
---
commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/AbstractStateMachineTest.java
(original)
+++
commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/AbstractStateMachineTest.java
Wed Dec 12 10:40:22 2007
@@ -35,31 +35,21 @@
super(name);
}
- // Test data
- private boolean fooCalled;
- private boolean barCalled;
-
- /**
- * Set up instance variables required by this test case.
- */
- public void setUp() {
- fooCalled = false;
- barCalled = false;
- }
-
public void testMoreThanOneScxmlDocument() throws Exception {
URL fooScxmlDocument = getClass().getResource("foo.xml");
URL barScxmlDocument = getClass().getResource("bar.xml");
- new Foo(fooScxmlDocument);
- new Bar(barScxmlDocument);
+ Foo f = new Foo(fooScxmlDocument);
+ Bar b = new Bar(barScxmlDocument);
- assertTrue(fooCalled);
- assertTrue(barCalled);
+ assertTrue(f.fooCalled());
+ assertTrue(b.barCalled());
}
private class Foo extends AbstractStateMachine {
+ private boolean fooCalled;
+
public Foo(final URL scxmlDocument) {
super(scxmlDocument);
}
@@ -67,16 +57,26 @@
public void foo() {
fooCalled = true;
}
+
+ public boolean fooCalled() {
+ return fooCalled;
+ }
}
private class Bar extends AbstractStateMachine {
+ private boolean barCalled;
+
public Bar(final URL scxmlDocument) {
super(scxmlDocument);
}
public void bar() {
barCalled = true;
+ }
+
+ public boolean barCalled() {
+ return barCalled;
}
}