]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.db.tests/src/org/simantics/db/tests/api/request/misc/AsyncTransactionTest.java
Multiple reader thread support for db client
[simantics/platform.git] / tests / org.simantics.db.tests / src / org / simantics / db / tests / api / request / misc / AsyncTransactionTest.java
index 749fbeb768f278f4a40d5a8b86371fd24288931b..b4137a43a0179b16f319bb0882966f9e614932f8 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * Copyright (c) 2007, 2018 Association for Decentralized Information Management
  * in Industry THTH ry.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -13,15 +13,14 @@ 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.Session;
 import org.simantics.db.WriteGraph;
+import org.simantics.db.common.request.AsyncReadRequest;
 import org.simantics.db.common.request.WriteRequest;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.procedure.AsyncListener;
 import org.simantics.db.procedure.AsyncProcedure;
 import org.simantics.db.request.AsyncRead;
-import org.simantics.db.request.Read;
 import org.simantics.db.testing.base.ExistingDatabaseTest;
 
 /**
@@ -89,12 +88,11 @@ public class AsyncTransactionTest extends ExistingDatabaseTest {
     public void testAsyncTransactions() throws DatabaseException {
         Session session = getSession();
 
-        session.asyncRequest(new Read<Object>() {
+        session.asyncRequest(new AsyncReadRequest() {
 
             @Override
-            public Object perform(ReadGraph graph) throws DatabaseException {
+            public void run(AsyncReadGraph graph) {
                 AsyncTransactionTest.this.perform(graph);
-                return null;
             }
 
         });