| TestUtilities.java |
1 package comtest;
2
3 import static org.junit.Assert.*;
4
5 /**
6 * A collection for things to help testing
7 * @author vesal
8 *
9 */
10 public class TestUtilities {
11 /*
12 #import static comtest.TestUtilities.*;
13 */
14
15
16 /**
17 * A helper function to make regExp test by ComTest
18 * @param message what message to show
19 * @param value what to check
20 * @param mask what regExp mask to use
21 * @param dummy just a dummy parameter to overload double assertEquals
22 *
23 * @example
24 * <pre name="test">
25 * "cat" ~~~ "c.*t";
26 * "cat" ~~~ "c.*a";
27 * "cat" =~ "c.*a";
28 * </pre>
29 */
30 public static void assertEquals(String message, String value, String mask, double dummy) {
31 if ( value.matches(mask) ) return;
32 fail(message + " Does not match: " + value + " to " + mask);
33 }
34
35 }
36