[Minor] fixed broken test
This commit is contained in:
parent
42c623cea6
commit
464fa8ac4a
|
@ -29,6 +29,10 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.junit.AfterClass;
|
||||||
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
import li.strolch.agent.api.Observer;
|
import li.strolch.agent.api.Observer;
|
||||||
import li.strolch.agent.api.StrolchRealm;
|
import li.strolch.agent.api.StrolchRealm;
|
||||||
import li.strolch.model.Order;
|
import li.strolch.model.Order;
|
||||||
|
@ -43,10 +47,6 @@ import li.strolch.runtime.StrolchConstants;
|
||||||
import li.strolch.runtime.privilege.PrivilegeHandler;
|
import li.strolch.runtime.privilege.PrivilegeHandler;
|
||||||
import li.strolch.testbase.runtime.RuntimeMock;
|
import li.strolch.testbase.runtime.RuntimeMock;
|
||||||
|
|
||||||
import org.junit.AfterClass;
|
|
||||||
import org.junit.BeforeClass;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||||
*/
|
*/
|
||||||
|
@ -111,7 +111,7 @@ public class ObserverUpdateTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldReceiveUpdates() {
|
public void shouldReceiveUpdates() throws InterruptedException {
|
||||||
|
|
||||||
// register an observer for orders and resources
|
// register an observer for orders and resources
|
||||||
ElementAddedObserver observer = new ElementAddedObserver();
|
ElementAddedObserver observer = new ElementAddedObserver();
|
||||||
|
@ -136,6 +136,9 @@ public class ObserverUpdateTest {
|
||||||
tx.commitOnClose();
|
tx.commitOnClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// observer updates are async...
|
||||||
|
Thread.sleep(100L);
|
||||||
|
|
||||||
assertEquals(2, observer.results.size());
|
assertEquals(2, observer.results.size());
|
||||||
assertEquals(1, observer.results.get(Tags.ORDER).getCreated().size());
|
assertEquals(1, observer.results.get(Tags.ORDER).getCreated().size());
|
||||||
assertEquals(1, observer.results.get(Tags.RESOURCE).getCreated().size());
|
assertEquals(1, observer.results.get(Tags.RESOURCE).getCreated().size());
|
||||||
|
|
Loading…
Reference in New Issue