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;
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>() {
}
@Override
- public void exception(ReadGraph graph, Throwable throwable) throws DatabaseException {
+ public void exception(AsyncReadGraph graph, Throwable throwable) {
throwable.printStackTrace();
assert(false);
}