/*
 * Copyright (c) 2012 Mateusz Parzonka, Eric Bodden
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Mateusz Parzonka - initial API and implementation
 */
package prm4j;

import java.util.HashSet;
import java.util.Set;

import prm4j.api.Parameter;
import prm4j.api.Symbol;
import prm4j.util.FSMDefinitions;

/**
 * Provides utilities for testing.
 */
public abstract class AbstractTest extends FSMDefinitions /* we mix in other definitions layer by layer */{

    public final static Set<Parameter<?>> EMPTY_PARAMETER_SET = new HashSet<Parameter<?>>();

    /**
     * Downcast SymbolN to Symbol.
     *
     * @param values
     * @return
     */
    public static Set<Symbol> asSet(Symbol... values) {
	Set<Symbol> set = new HashSet<Symbol>();
	for (Symbol s : values) {
	    set.add(s);
	}
	return set;
    }

    public static Set<Parameter<?>> asSet(Parameter<?>... values) {
	Set<Parameter<?>> set = new HashSet<Parameter<?>>();
	for (Parameter<?> s : values) {
	    set.add(s);
	}
	return set;
    }

}

@@ -387,16 +387,79 @@
 prm4j;%0A%0A
+import static org.junit.Assert.fail;%0A%0Aimport java.util.Arrays;%0A
 import j
@@ -1287,10 +1287,556 @@
 %0A    %7D%0A%0A
+    /**%0A     * assertArrayEquals(boolean%5B%5D a1, boolean%5B%5D a2) not implemented in jUnit for some reason, see%0A     * https://github.com/KentBeck/junit/issues/86%0A     *%0A     * @param expected%0A     * @param actual%0A     */%0A    public static void assertBooleanArrayEquals(boolean%5B%5D expected, boolean%5B%5D actual) %7B%0A%09if (expected.length != actual.length)%0A%09    fail(%22Expected:%3C%22 + Arrays.toString(expected) + %22%3E but was: %3C%22 + Arrays.toString(actual) + %22%3E%22);%0A%09for (int i = 0; i %3C expected.length; i++) %7B%0A%09    if (expected%5Bi%5D != actual%5Bi%5D)%0A%09%09fail();%0A%09%7D%0A    %7D%0A%0A
 %7D%0A

Add test method to assert equality of boolean arrays