Revision: 1287
Author: plorenz
Date: Sat Mar 2 18:24:41 2013
Log: Run code cleanups
http://code.google.com/p/sarasvati/source/detail?r=1287
Modified:
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/Engine.java
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/AttributeConverters.java
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/Base64.java
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/Base64InputStream.java
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/Base64OutputStream.java
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/LongArrayAttributeConverter.java
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/impl/BaseEngine.java
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/join/TokenSetJoinStrategy.java
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/load/definition/ProcessDefinition.java
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/mem/MemEngine.java
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/xml/XmlProcessDefinition.java
/java/trunk/sarasvati-core/src/test/java/com/googlecode/sarasvati/env/Base64Test.java
/java/trunk/sarasvati-core/src/test/java/com/googlecode/sarasvati/unittest/load/LoaderTest.java
/java/trunk/sarasvati-example/src/main/java/com/googlecode/sarasvati/example/convert/ConverterExample.java
/java/trunk/sarasvati-example/src/main/java/com/googlecode/sarasvati/example/snippets/CompleteWithCheckSiblings.java
/java/trunk/sarasvati-example/src/main/java/com/googlecode/sarasvati/example/snippets/NotBacktrableWhenCompleteNode.java
/java/trunk/sarasvati-hibernate/src/main/java/com/googlecode/sarasvati/hib/HibEngine.java
/java/trunk/sarasvati-test/src/test/java/com/googlecode/sarasvati/test/execution/MultiStartNodeTest.java
/java/trunk/sarasvati-test/src/test/java/com/googlecode/sarasvati/test/traversal/TraversalTest.java
=======================================
---
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/Engine.java
Tue Feb 26 19:49:07 2013
+++
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/Engine.java
Sat Mar 2 18:24:41 2013
@@ -468,14 +468,14 @@
GuardResult evaluateGuard (NodeToken token, String guard);
/**
- * Allows retrying an arc token, to see if the conditions have changed
and
+ * Allows retrying an arc token, to see if the conditions have changed
and
* its execution can now be completed.
- *
+ *
* @param token The token to retry
* @return The resulting join action
*/
JoinAction retryIncompleteArcToken (final ArcToken token);
-
+
/**
* Since an Engine can have state specific to the currently executing
process,
=======================================
---
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/AttributeConverters.java
Tue Feb 26 19:49:07 2013
+++
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/AttributeConverters.java
Sat Mar 2 18:24:41 2013
@@ -61,7 +61,7 @@
converters.put( Double.class, new DoubleAttributeConverter() );
converters.put( Double.TYPE, new DoubleAttributeConverter() );
-
+
converters.put( long[].class, new LongArrayAttributeConverter() );
}
=======================================
---
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/Base64.java
Tue Feb 26 19:49:07 2013
+++
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/Base64.java
Sat Mar 2 18:24:41 2013
@@ -6,26 +6,26 @@
class Base64
{
- public static char[] BYTE_TO_CHAR = {
+ public static char[] BYTE_TO_CHAR = {
'A', 'B', 'C', 'D',
'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X',
- 'Y', 'Z', 'a', 'b',
- 'c', 'd', 'e', 'f',
- 'g', 'h', 'i', 'j',
- 'k', 'l', 'm', 'n',
- 'o', 'p', 'q', 'r',
- 's', 't', 'u', 'v',
- 'w', 'x', 'y', 'z',
+ 'Y', 'Z', 'a', 'b',
+ 'c', 'd', 'e', 'f',
+ 'g', 'h', 'i', 'j',
+ 'k', 'l', 'm', 'n',
+ 'o', 'p', 'q', 'r',
+ 's', 't', 'u', 'v',
+ 'w', 'x', 'y', 'z',
'0', '1', '2', '3',
'4', '5', '6', '7',
'8', '9', '=', '/' };
-
+
public static byte[] CHAR_TO_BYTE = new byte[128];
-
+
static
{
for (int i = 0; i < BYTE_TO_CHAR.length; i++)
@@ -33,7 +33,7 @@
CHAR_TO_BYTE[BYTE_TO_CHAR[i]] = (byte)i;
}
}
-
+
public static String encode(final byte[] bytes)
{
try
@@ -50,14 +50,14 @@
throw new RuntimeException("Unexpected failure while encoding bytes
to base64", ioe);
}
}
-
+
public static byte[] decode(final String base64)
{
try
{
final StringReader stringReader = new StringReader(base64);
final Base64InputStream in = new Base64InputStream(stringReader);
- final int length = ((base64.length() / 4) * 3) + Math.max(0,
((base64.length() % 4) - 1));
+ final int length = ((base64.length() / 4) * 3) + Math.max(0,
((base64.length() % 4) - 1));
byte[] bytes = new byte[length];
in.read(bytes);
in.close();
@@ -69,7 +69,7 @@
throw new RuntimeException("Unexpected failure while decoding bytes
from base64", ioe);
}
}
-
+
public static void main(String[] args)
{
for (int i = 0; i < BYTE_TO_CHAR.length; i++)
=======================================
---
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/Base64InputStream.java
Tue Feb 26 19:49:07 2013
+++
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/Base64InputStream.java
Sat Mar 2 18:24:41 2013
@@ -7,16 +7,16 @@
public class Base64InputStream extends InputStream
{
private final Reader reader;
-
+
int current = 0;
int index = 0;
int available = 0;
-
+
public Base64InputStream(final Reader reader)
{
this.reader = reader;
}
-
+
@Override
public int read() throws IOException
{
@@ -28,16 +28,16 @@
{
return -1;
}
-
+
current = Base64.CHAR_TO_BYTE[current];
-
+
int next = reader.read();
if (next == -1)
{
throw new IOException("Unexpected end of stream");
}
current = current << 6 | Base64.CHAR_TO_BYTE[next];
-
+
available = 1;
next = reader.read();
@@ -45,7 +45,7 @@
{
current = current << 6 | Base64.CHAR_TO_BYTE[next];
available = 2;
-
+
next = reader.read();
if (next != -1)
{
@@ -62,20 +62,20 @@
current = current << 12;
}
}
-
+
available--;
index++;
-
+
if (index == 1)
{
return (current >> 16) & 255;
}
-
+
if (index == 2)
{
return (current >> 8) & 255;
}
-
+
return current & 255;
}
}
=======================================
---
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/Base64OutputStream.java
Tue Feb 26 19:49:07 2013
+++
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/Base64OutputStream.java
Sat Mar 2 18:24:41 2013
@@ -8,15 +8,15 @@
{
private static final int MASK_6_BITS = 63;
private final Writer writer;
-
+
int current = 0;
int index = 0;
-
+
public Base64OutputStream(final Writer writer)
{
this.writer = writer;
}
-
+
@Override
public void write(final int b) throws IOException
{
@@ -26,16 +26,16 @@
{
int charIdx = (current >> 18) & MASK_6_BITS;
writer.write(Base64.BYTE_TO_CHAR[charIdx]);
-
+
charIdx = (current >> 12) & MASK_6_BITS;
writer.write(Base64.BYTE_TO_CHAR[charIdx]);
-
+
charIdx = (current >> 6) & MASK_6_BITS;
writer.write(Base64.BYTE_TO_CHAR[charIdx]);
-
+
charIdx = current & MASK_6_BITS;
writer.write(Base64.BYTE_TO_CHAR[charIdx]);
-
+
current = 0;
index = 0;
}
@@ -44,30 +44,30 @@
current = current << 8;
}
}
-
+
@Override
public void close() throws IOException
- {
+ {
if (index == 0)
{
return;
}
-
+
if (index == 1)
{
current = current << 8;
}
-
+
int charIdx = (current >> 18) & MASK_6_BITS;
writer.write(Base64.BYTE_TO_CHAR[charIdx]);
-
+
charIdx = (current >> 12) & MASK_6_BITS;
- writer.write(Base64.BYTE_TO_CHAR[charIdx]);
+ writer.write(Base64.BYTE_TO_CHAR[charIdx]);
if (index == 2)
{
charIdx = (current >> 6) & MASK_6_BITS;
- writer.write(Base64.BYTE_TO_CHAR[charIdx]);
+ writer.write(Base64.BYTE_TO_CHAR[charIdx]);
}
}
}
=======================================
---
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/LongArrayAttributeConverter.java
Tue Feb 26 19:49:07 2013
+++
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/env/LongArrayAttributeConverter.java
Sat Mar 2 18:24:41 2013
@@ -34,19 +34,19 @@
{
return null;
}
-
+
final long[] array = (long[]) object;
-
+
final ByteBuffer byteBuffer = ByteBuffer.allocate(4 + (8 *
array.length));
byteBuffer.putInt(array.length);
for (final long value : array)
{
byteBuffer.putLong(value);
}
-
+
return Base64.encode(byteBuffer.array());
}
-
+
/**
* Converts the given string to an Integer
*
@@ -59,18 +59,18 @@
{
return null;
}
-
+
final byte[] bytes = Base64.decode(string);
final ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);
final int length = byteBuffer.getInt();
-
+
final long[] array = new long[length];
-
+
for (int i = 0; i < array.length; i++)
{
array[i] = byteBuffer.getLong();
}
-
+
return array;
}
}
=======================================
---
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/impl/BaseEngine.java
Tue Feb 26 19:49:07 2013
+++
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/impl/BaseEngine.java
Sat Mar 2 18:24:41 2013
@@ -275,14 +275,14 @@
process.addActiveArcToken( token );
- final JoinAction joinAction = retryIncompleteArcToken(token);
+ final JoinAction joinAction = retryIncompleteArcToken(token);
if ( JoinAction.Nothing == joinAction )
{
ArcTokenEvent.fireIncompleteJoinEvent( this, token );
}
}
}
-
+
@Override
public JoinAction retryIncompleteArcToken (final ArcToken token)
{
=======================================
---
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/join/TokenSetJoinStrategy.java
Tue Feb 26 19:49:07 2013
+++
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/join/TokenSetJoinStrategy.java
Sat Mar 2 18:24:41 2013
@@ -124,9 +124,9 @@
{
return IncompleteJoinResult.INSTANCE;
}
-
+
final Collection<ArcToken> members =
tokenSet.getActiveArcTokens(engine);
-
+
for (final ArcToken member : members)
{
if
(!member.getArc().getEndNode().equals(token.getArc().getEndNode()))
@@ -134,7 +134,7 @@
return IncompleteJoinResult.INSTANCE;
}
}
-
+
resultTokens.addAll(members);
}
=======================================
---
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/load/definition/ProcessDefinition.java
Sun Feb 3 19:26:44 2013
+++
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/load/definition/ProcessDefinition.java
Sat Mar 2 18:24:41 2013
@@ -45,11 +45,11 @@
*/
String getMessageDigest ();
- /**
+ /**
* @return Any custom data for the process definition
*/
CustomDefinition getCustom();
-
+
/**
* @return A list of the nodes defined in the process definition
*/
@@ -59,7 +59,7 @@
* @return A list of the externals defined in the process definition.
*/
List<? extends ExternalDefinition> getExternals ();
-
+
/**
* @return A list of custom xml elements of the process.
*/
=======================================
---
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/mem/MemEngine.java
Tue Feb 26 19:49:07 2013
+++
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/mem/MemEngine.java
Sat Mar 2 18:24:41 2013
@@ -155,7 +155,7 @@
/**
* Provides a subclass to override which execution event listeners are
added to
- * new global queues. By default this adds the listeners from {@link
BaseEngine}
+ * new global queues. By default this adds the listeners from {@link
BaseEngine}
* as well as the following listeners:
* <ul>
* <li>{@link TokenSetDeadEndListener}</li>
@@ -171,7 +171,7 @@
ExecutionEventType.ARC_TOKEN_INCOMPLETE_JOIN,
ExecutionEventType.NODE_TOKEN_COMPLETED );
}
-
+
private EngineFactory<MemEngine> newEngineFactory()
{
return new EngineFactory<MemEngine>()
=======================================
---
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/xml/XmlProcessDefinition.java
Sun Feb 3 19:26:44 2013
+++
/java/trunk/sarasvati-core/src/main/java/com/googlecode/sarasvati/xml/XmlProcessDefinition.java
Sat Mar 2 18:24:41 2013
@@ -25,8 +25,8 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.TreeMap;
-import java.util.Map.Entry;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@@ -98,16 +98,16 @@
@Override
public List<Object> getCustomProcessData()
{
- return custom != null? custom.getCustom() : Collections.emptyList();
+ return custom != null? custom.getCustom() : Collections.emptyList();
}
-
+
@Override
- public XmlCustom getCustom()
+ public XmlCustom getCustom()
{
return custom;
}
- public void setCustom(XmlCustom custom)
+ public void setCustom(XmlCustom custom)
{
this.custom = custom;
}
@@ -136,7 +136,7 @@
digest.update( entry.getValue().getBytes() );
}
}
-
+
for ( XmlNode node : nodes )
{
node.addToDigest( digest );
@@ -170,7 +170,7 @@
buf.append( custom );
buf.append( "\n" );
}
-
+
for (NodeDefinition node : nodes)
{
buf.append( node );
=======================================
---
/java/trunk/sarasvati-core/src/test/java/com/googlecode/sarasvati/env/Base64Test.java
Tue Feb 26 19:49:07 2013
+++
/java/trunk/sarasvati-core/src/test/java/com/googlecode/sarasvati/env/Base64Test.java
Sat Mar 2 18:24:41 2013
@@ -12,25 +12,25 @@
public void test()
{
SecureRandom rand = new SecureRandom();
-
+
for (int i = 1; i < 1024; i++)
{
byte[] array = new byte[i];
rand.nextBytes(array);
-
+
final String encoded = Base64.encode(array);
-
+
byte[] decoded = Base64.decode(encoded);
Assert.assertTrue(Arrays.equals(array, decoded));
}
-
+
for (int i = 1024; i < 1024 * 1024; i += rand.nextInt(1024))
{
byte[] array = new byte[i];
rand.nextBytes(array);
-
+
final String encoded = Base64.encode(array);
-
+
byte[] decoded = Base64.decode(encoded);
Assert.assertTrue(Arrays.equals(array, decoded));
}
=======================================
---
/java/trunk/sarasvati-core/src/test/java/com/googlecode/sarasvati/unittest/load/LoaderTest.java
Sun Feb 3 19:26:44 2013
+++
/java/trunk/sarasvati-core/src/test/java/com/googlecode/sarasvati/unittest/load/LoaderTest.java
Sat Mar 2 18:24:41 2013
@@ -40,7 +40,7 @@
Assert.assertNotNull( "Graph should be loaded",
engine.getRepository().getLatestGraph( "external-present" ) );
Assert.assertNotNull( "Graph should be loaded",
engine.getRepository().getLatestGraph( "external" ) );
}
-
+
@Test
public void testCustomProcessData() throws Exception
{
=======================================
---
/java/trunk/sarasvati-example/src/main/java/com/googlecode/sarasvati/example/convert/ConverterExample.java
Tue Dec 13 07:27:51 2011
+++
/java/trunk/sarasvati-example/src/main/java/com/googlecode/sarasvati/example/convert/ConverterExample.java
Sat Mar 2 18:24:41 2013
@@ -10,7 +10,7 @@
public static void main(String[] args)
{
AttributeConverter longArrayConverter = new AttributeConverter()
- {
+ {
@Override
public Object stringToObject(String string, Class<?> type)
{
@@ -18,29 +18,29 @@
{
return null;
}
-
+
if (!type.isArray() ||
type.getComponentType() != Long.TYPE)
{
throw new IllegalArgumentException("This converter can only be
used to convert string to long[]");
- }
-
+ }
+
if ("[]".equals(string))
{
return new long[0];
}
-
+
final String[] elements = string.substring(1, string.length() -
1).split(",");
- final long[] result = new long[elements.length];
-
+ final long[] result = new long[elements.length];
+
for (int i = 0; i < elements.length; i++)
{
result[i] = Long.parseLong(elements[i]);
}
-
- return result;
+
+ return result;
}
-
+
@Override
public String objectToString(Object object)
{
@@ -48,15 +48,15 @@
{
return null;
}
-
+
if (!object.getClass().isArray() ||
object.getClass().getComponentType() != Long.TYPE)
{
return null;
}
-
+
final long[] array = (long[])object;
-
+
final StringBuilder buf = new StringBuilder(3 * array.length);
buf.append("[");
if (array.length > 0)
@@ -69,17 +69,17 @@
buf.append(array[i]);
}
buf.append("]");
-
+
return buf.toString();
}
};
-
+
@SuppressWarnings("unchecked")
final Class<long[]> longArrayType = (Class<long[]>) new
long[0].getClass();
-
+
AttributeConverters.setConverterForType(longArrayType,
longArrayConverter);
-
- long[][] testArrays =
+
+ long[][] testArrays =
new long[][] { null,
{},
{1},
=======================================
---
/java/trunk/sarasvati-example/src/main/java/com/googlecode/sarasvati/example/snippets/CompleteWithCheckSiblings.java
Sun Jan 27 09:07:40 2013
+++
/java/trunk/sarasvati-example/src/main/java/com/googlecode/sarasvati/example/snippets/CompleteWithCheckSiblings.java
Sat Mar 2 18:24:41 2013
@@ -26,7 +26,7 @@
}
return result;
}
-
+
public void complete(final Engine engine, final NodeToken token, final
String arcName)
{
if ("back".equals(arcName))
@@ -39,6 +39,6 @@
}
}
}
- engine.complete(token, arcName);
+ engine.complete(token, arcName);
}
}
=======================================
---
/java/trunk/sarasvati-example/src/main/java/com/googlecode/sarasvati/example/snippets/NotBacktrableWhenCompleteNode.java
Sun Jan 27 09:07:40 2013
+++
/java/trunk/sarasvati-example/src/main/java/com/googlecode/sarasvati/example/snippets/NotBacktrableWhenCompleteNode.java
Sat Mar 2 18:24:41 2013
@@ -4,11 +4,11 @@
import com.googlecode.sarasvati.NodeToken;
import com.googlecode.sarasvati.hib.HibNode;
-public class NotBacktrableWhenCompleteNode extends HibNode
-{
+public class NotBacktrableWhenCompleteNode extends HibNode
+{
@Override
public boolean isBacktrackable(Engine engine, NodeToken token)
- {
+ {
return !token.isComplete();
- }
+ }
}
=======================================
---
/java/trunk/sarasvati-hibernate/src/main/java/com/googlecode/sarasvati/hib/HibEngine.java
Tue Feb 26 19:49:07 2013
+++
/java/trunk/sarasvati-hibernate/src/main/java/com/googlecode/sarasvati/hib/HibEngine.java
Sat Mar 2 18:24:41 2013
@@ -335,10 +335,10 @@
config.setCacheConcurrencyStrategy(
HibArcToken.class.getName(),"read-write" );
}
}
-
+
/**
* Provides a subclass to override which execution event listeners are
added to
- * new global queues. By default this adds the listeners from {@link
BaseEngine}
+ * new global queues. By default this adds the listeners from {@link
BaseEngine}
* as well as the following listeners:
* <ul>
* <li>{@link TokenSetDeadEndListener}</li>
=======================================
---
/java/trunk/sarasvati-test/src/test/java/com/googlecode/sarasvati/test/execution/MultiStartNodeTest.java
Tue Dec 6 08:29:01 2011
+++
/java/trunk/sarasvati-test/src/test/java/com/googlecode/sarasvati/test/execution/MultiStartNodeTest.java
Sat Mar 2 18:24:41 2013
@@ -34,14 +34,14 @@
@Test public void testLinear () throws Exception
{
final RubricPredicate predicate = new RubricPredicate()
- {
+ {
@Override
public boolean eval(final Engine engine, final NodeToken token)
{
return "bar".equals(token.getProcess().getEnv().getAttribute("foo"));
}
};
-
+
DefaultRubricFunctionRepository.getGlobalInstance().registerPredicate("isFooBar",
predicate);
MapEnv env = new MapEnv();
env.setAttribute("foo", "bar");
=======================================
---
/java/trunk/sarasvati-test/src/test/java/com/googlecode/sarasvati/test/traversal/TraversalTest.java
Sun Nov 4 19:28:44 2012
+++
/java/trunk/sarasvati-test/src/test/java/com/googlecode/sarasvati/test/traversal/TraversalTest.java
Sat Mar 2 18:24:41 2013
@@ -57,10 +57,10 @@
level = Math.min(level, parentLevel == null ?
Integer.MAX_VALUE : parentLevel);
}
}
-
+
level++;
levelMap.put(token, level);
-
+
if (level != currentNodeLevel)
{
if (level == currentNodeLevel + 1)
@@ -72,21 +72,21 @@
throw new RuntimeException("Current level is " +
currentNodeLevel + " hit node at level " + level);
}
}
- }
+ }
}
-
+
public static class DepthFirstTestVisitor extends TokenVisitorAdaptor
{
final Set<Token> doneSet = new HashSet<Token>();
final LinkedList<Token> stack = new LinkedList<Token>();
final Map<Token, Integer> levelMap = new HashMap<Token, Integer>();
int currentNodeLevel = 1;
-
+
@Override
public void visit (final NodeToken token)
{
int level = 0;
-
+
if (!token.getParentTokens().isEmpty())
{
boolean parentFoundInStack = false;
@@ -95,19 +95,19 @@
{
Integer parentLevel = levelMap.get(parent.getParentToken());
level = Math.min(level, parentLevel == null ?
Integer.MAX_VALUE : parentLevel);
-
+
parentFoundInStack |= stack.contains(parent.getParentToken());
}
-
+
if (!parentFoundInStack)
{
throw new RuntimeException("No parent found in stack. Not depth
first!");
}
}
-
+
level++;
levelMap.put(token, level);
-
+
if (level == currentNodeLevel)
{
if (!stack.isEmpty())
@@ -134,11 +134,11 @@
}
stack.add(token);
}
-
+
currentNodeLevel = level;
- }
+ }
}
-
+
public NodeToken executeTraversal () throws Exception
{
Graph g = reloadDefinition( "traversal" );
@@ -160,20 +160,20 @@
return tokenA;
}
- @Test
+ @Test
public void testBreadthFirst () throws Exception
{
NodeToken tokenA = executeTraversal();
TokenTraversals.traverseChildrenBreadthFirst( tokenA, new
BreadthFirstTestVisitor() );
}
- @Test
+ @Test
public void testDepthFirst () throws Exception
{
NodeToken tokenA = executeTraversal();
TokenTraversals.traverseChildrenDepthFirst( tokenA, new
DepthFirstTestVisitor() );
}
-
+
@Test(expected=RuntimeException.class)
public void testBreadthFirstWithDepthFirstTester() throws Exception
{
@@ -181,7 +181,7 @@
TokenTraversals.traverseChildrenBreadthFirst( tokenA, new
DepthFirstTestVisitor());
}
- @Test(expected=RuntimeException.class)
+ @Test(expected=RuntimeException.class)
public void testDepthFirstWithBreadthFirstTester() throws Exception
{
NodeToken tokenA = executeTraversal();