]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.db.tests/src/org/simantics/db/tests/api/readGraph/getInverse/GetInverseTest1.java
Added missing org.simantics.db.{tests,testing} plug-ins.
[simantics/platform.git] / tests / org.simantics.db.tests / src / org / simantics / db / tests / api / readGraph / getInverse / GetInverseTest1.java
1 package org.simantics.db.tests.api.readGraph.getInverse;
2
3 import org.junit.Test;
4 import org.simantics.db.Resource;
5 import org.simantics.db.common.primitiverequest.Inverse;
6 import org.simantics.db.exception.NoInverseException;
7 import org.simantics.db.testing.base.ExistingDatabaseTest;
8 import org.simantics.db.tests.common.Writes;
9
10 /*
11  * When a resource does not specify L0.InverseOf, getInverse shall throw NoInverseException.
12  */
13 public class GetInverseTest1 extends ExistingDatabaseTest {
14         
15         @Test
16         public void test() throws Exception{
17
18                 Resource resource = getSession().syncRequest(Writes.newEmpty());
19
20                 try {
21                         assertNotNull("Null not allowed",getSession().syncRequest(new Inverse(resource)));
22                 } catch (NoInverseException e) {
23                         return;
24                 }
25         fail("Should throw.");
26         }
27         
28 }