1 package org.simantics.db.tests.api.support.virtualGraphSupport;
5 import org.simantics.db.Resource;
6 import org.simantics.db.VirtualGraph;
7 import org.simantics.db.WriteGraph;
8 import org.simantics.db.common.request.WriteResultRequest;
9 import org.simantics.db.exception.DatabaseException;
10 import org.simantics.db.service.VirtualGraphSupport;
11 import org.simantics.db.testing.base.WriteReadTest;
13 public class VirtualGraphTest6 extends WriteReadTest {
16 protected void write(WriteGraph graph) throws DatabaseException {
18 VirtualGraphSupport support = graph.getService(VirtualGraphSupport.class);
19 VirtualGraph virt = support.getMemoryPersistent(UUID.randomUUID().toString());
21 Resource other = graph.syncRequest(new WriteResultRequest<Resource>(virt) {
24 public Resource perform(WriteGraph graph) throws DatabaseException {
25 Resource other = graph.newResource();
27 System.err.println("other=" + other);
28 graph.claim(written, L0.ConsistsOf, L0.PartOf, other);
34 Resource single = graph.getSingleObject(written, L0.ConsistsOf);
36 System.err.println("single=" + single);
37 assertNotNull(single);
38 assertTrue(single.equals(other));