/*
 * 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.logic;

import org.junit.Test;
import static junit.framework.Assert.*;

import prm4j.AbstractTest;
import prm4j.api.fsm.FSM;
import prm4j.api.fsm.FSMSpec;

public class StatefulSpecProcessorTest extends AbstractTest {

    @Test
    public void accessors_unsafeMapIterator() throws Exception {
	FSM<Void> fsm = new FSM_unsafeMapIterator().fsm;
	StatefulSpecProcessor ssp = new StatefulSpecProcessor(new FSMSpec<Void>(fsm));

	assertEquals(ssp.getInitialState(), fsm.getInitialState());
	assertEquals(ssp.getSymbols(), fsm.getAlphabet().getSymbols());
    }

}

@@ -400,16 +400,23 @@
 %0Aimport 
+static 
 org.juni
@@ -421,52 +421,178 @@
 nit.
-Test;%0Aimport static junit.framework.Assert.*
+Assert.assertEquals;%0A%0Aimport java.util.Collections;%0Aimport java.util.HashMap;%0Aimport java.util.HashSet;%0Aimport java.util.Map;%0Aimport java.util.Set;%0A%0Aimport org.junit.Test
 ;%0A%0Ai
@@ -617,16 +617,41 @@
 ctTest;%0A
+import prm4j.api.Symbol;%0A
 import p
@@ -1029,16 +1029,16 @@
 ate());%0A
-
 %09assertE
@@ -1101,10 +1101,1087 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void getPropertyEnableSets_unsafeMapIterator() throws Exception %7B%0A%09FSM_unsafeMapIterator u = new FSM_unsafeMapIterator();%0A%09FSM%3CVoid%3E fsm = u.fsm;%0A%09StatefulSpecProcessor ssp = new StatefulSpecProcessor(new FSMSpec%3CVoid%3E(fsm));%0A%0A%09Map%3CSymbol, Set%3CSet%3CSymbol%3E%3E%3E actual = ssp.getPropertyEnableSets();%0A%0A%09Map%3CSymbol, Set%3CSet%3CSymbol%3E%3E%3E expected = new HashMap%3CSymbol, Set%3CSet%3CSymbol%3E%3E%3E();%0A%09for (Symbol symbol : u.alphabet.getSymbols()) %7B%0A%09    expected.put(symbol, new HashSet%3CSet%3CSymbol%3E%3E());%0A%09%7D%0A%09expected.get(u.createColl).add(Collections.%3CSymbol%3E emptySet());%0A%09expected.get(u.createIter).add(asSet(u.createColl));%0A%09expected.get(u.createIter).add(asSet(u.createColl, u.updateMap));%0A%09expected.get(u.useIter).add(asSet(u.createColl, u.createIter));%0A%09expected.get(u.useIter).add(asSet(u.createColl, u.createIter, u.updateMap));%0A%09expected.get(u.updateMap).add(asSet(u.createColl));%0A%09expected.get(u.updateMap).add(asSet(u.createColl, u.createIter));%0A%09expected.get(u.updateMap).add(asSet(u.createColl, u.createIter, u.useIter));%0A%0A%09assertEquals(expected, actual);%0A    %7D%0A%0A
 %7D%0A

Test method