@@ -0,0 +1,1723 @@
+/*%0A * Copyright (c) 2012 Mateusz Parzonka, Eric Bodden%0A * All rights reserved. This program and the accompanying materials%0A * are made available under the terms of the Eclipse Public License v1.0%0A * which accompanies this distribution, and is available at%0A * http://www.eclipse.org/legal/epl-v10.html%0A *%0A * Contributors:%0A * Mateusz Parzonka - initial API and implementation%0A */%0Apackage prm4j.indexing.realtime;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport java.util.Collection;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.junit.Test;%0A%0Aimport prm4j.AbstractTest;%0Aimport prm4j.api.fsm.FSM;%0Aimport prm4j.api.fsm.FSMSpec;%0Aimport prm4j.spec.FiniteSpec;%0A%0Apublic class BindingStoreTest extends AbstractTest %7B%0A%0A    @SuppressWarnings(%7B %22rawtypes%22, %22unchecked%22 %7D)%0A    @Test%0A    public void getBindings_unsafeMapIterator_1() throws Exception %7B%0A%09FSM_unsafeMapIterator u = new FSM_unsafeMapIterator();%0A%09FSM fsm = u.fsm;%0A%09FiniteSpec finiteSpec = new FSMSpec(fsm);%0A%09u.m.setIndex(0);%0A%09u.c.setIndex(1);%0A%09u.i.setIndex(2);%0A%0A%09BindingStore bs = new BindingStore(finiteSpec.getFullParameterSet());%0A%0A%09Object%5B%5D boundObjects = new Object%5BfiniteSpec.getFullParameterSet().size()%5D;%0A%09Map map = new HashMap();%0A%09map.put(1, %22a%22);%0A%09Collection coll = map.entrySet();%0A%09boundObjects%5B0%5D = map;%0A%09boundObjects%5B1%5D = coll;%0A%0A%09LowLevelBinding%5B%5D bindings = bs.getBindings(boundObjects);%0A%09LowLevelBinding mBinding = bindings%5B0%5D;%0A%09LowLevelBinding cBinding = bindings%5B1%5D;%0A%0A%09// check 'compression'%0A%09assertEquals(2, bindings.length);%0A%0A%09// check bound objects%0A%09assertTrue(map == mBinding.get());%0A%09assertTrue(coll == cBinding.get());%0A%09// check parameter index%0A%09assertEquals(0, mBinding.getParameterId());%0A%09assertEquals(1, cBinding.getParameterId());%0A    %7D%0A%0A%7D%0A

Add test for BindingStore