|
23 | 23 |
|
24 | 24 | import static org.junit.Assert.assertEquals; |
25 | 25 | import static org.junit.Assert.assertFalse; |
| 26 | +import static org.junit.Assert.assertNull; |
26 | 27 | import static org.junit.Assert.assertTrue; |
27 | 28 |
|
28 | 29 | import java.util.List; |
29 | 30 |
|
30 | 31 | import org.junit.Test; |
31 | 32 | import org.omg.sysml.interactive.SysMLInteractive; |
| 33 | +import org.omg.sysml.interactive.SysMLInteractiveResult; |
32 | 34 | import org.omg.sysml.lang.sysml.AcceptActionUsage; |
33 | 35 | import org.omg.sysml.lang.sysml.ActionUsage; |
34 | 36 | import org.omg.sysml.lang.sysml.AttributeUsage; |
@@ -88,6 +90,26 @@ public void testViewExpose() throws Exception { |
88 | 90 | assertEquals(1, exposed.size()); |
89 | 91 | } |
90 | 92 |
|
| 93 | + public final String qualifiedNameTest = |
| 94 | + "package Test {\n" |
| 95 | + + " package P {\n" |
| 96 | + + " item x;\n" |
| 97 | + + " item x;\n" |
| 98 | + + " }" |
| 99 | + + "}"; |
| 100 | + |
| 101 | + @Test |
| 102 | + public void testQualifiedName() throws Exception { |
| 103 | + SysMLInteractive instance = getSysMLInteractiveInstance(); |
| 104 | + SysMLInteractiveResult result = instance.process(qualifiedNameTest); |
| 105 | + Element root = result.getRootElement(); |
| 106 | + List<Element> elements = ((Namespace)root).getOwnedMember(); |
| 107 | + Namespace P = (Namespace)((Namespace)elements.get(0)).getOwnedMember().get(0); |
| 108 | + List<Element> P_ownedMembers = P.getOwnedMember(); |
| 109 | + assertEquals("Test::P::x", P_ownedMembers.get(0).getQualifiedName()); |
| 110 | + assertNull(P_ownedMembers.get(1).getQualifiedName()); |
| 111 | + } |
| 112 | + |
91 | 113 | public final String pathTest = |
92 | 114 | "// Path of package: TopLevel\n" |
93 | 115 | + "// Path of owning membership: TopLevel/owningMembership\n" |
|
0 commit comments