]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.db.tests/src/org/simantics/db/tests/api/request/misc/SyncAsyncSyncTest9.java
Multiple reader thread support for db client
[simantics/platform.git] / tests / org.simantics.db.tests / src / org / simantics / db / tests / api / request / misc / SyncAsyncSyncTest9.java
index 4d6b1fb46bab7e51732b3b55639c37343edf1270..9deff6d3431720fbcc07379fcde71e91d5aea01a 100644 (file)
 package org.simantics.db.tests.api.request.misc;
 
 import org.junit.Test;
+import org.simantics.db.AsyncReadGraph;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
 import org.simantics.db.Statement;
 import org.simantics.db.common.primitiverequest.PossibleStatement;
 import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.procedure.AsyncListener;
 import org.simantics.db.procedure.SyncListener;
 import org.simantics.db.testing.base.ExistingDatabaseTest;
 import org.simantics.layer0.Layer0;
@@ -29,17 +31,17 @@ public class SyncAsyncSyncTest9 extends ExistingDatabaseTest {
                
                Session session = getSession();
                
-        session.syncRequest(new TestReadRequest() {
+        session.syncRequest(new TestAsyncReadRequest() {
 
             @Override
-            public void run(ReadGraph g) throws DatabaseException {
+            public void run(AsyncReadGraph g) throws Throwable {
 
                 final Layer0 b = Layer0.getInstance(g);
 
-                g.forPossibleObject(g.getRootLibrary(), b.InstanceOf, new SyncListener<Resource>() {
+                g.forPossibleObject(g.getRootLibrary(), b.InstanceOf, new AsyncListener<Resource>() {
 
                     @Override
-                    public void execute(ReadGraph graph, Resource type) throws DatabaseException {
+                    public void execute(AsyncReadGraph graph, Resource type) {
 
                         graph.asyncRequest(new PossibleStatement(type, b.InstanceOf), new SyncListener<Statement>() {
 
@@ -104,7 +106,7 @@ public class SyncAsyncSyncTest9 extends ExistingDatabaseTest {
                     }
 
                     @Override
-                    public void exception(ReadGraph graph, Throwable throwable) throws DatabaseException {
+                    public void exception(AsyncReadGraph graph, Throwable throwable) {
                         throwable.printStackTrace();
                         assert(false);
                     }