Skip to content

Commit b608c9a

Browse files
committed
Merge pull request #760 from Systems-Modeling/ST6RI-934-1
ST6RI-934 Abstract syntax metamodel for KerML 1.1/SysML 2.1 Beta 1 (revised) - Also updated creation of SysMLInteractive in SysMLInteractiveTests, to avoid local build problems (especially for global scope tests).
2 parents f8e047f + 71ce0fc commit b608c9a

44 files changed

Lines changed: 26508 additions & 26499 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

org.omg.sysml.interactive.tests/src/org/omg/sysml/interactive/tests/DerivedPropertyAndOperationTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void testPayloadArgument() throws Exception {
9494

9595
@Test
9696
public void testViewExpose() throws Exception {
97-
SysMLInteractive instance = getSysMLInteractiveInstance();
97+
SysMLInteractive instance = createSysMLInteractiveInstance();
9898
List<Element> elements = process(instance, test);
9999
ViewUsage view = (ViewUsage)((Namespace)elements.get(0)).getOwnedMember().get(1);
100100
List<Element> exposed = view.getExposedElement();
@@ -111,7 +111,7 @@ public void testViewExpose() throws Exception {
111111

112112
@Test
113113
public void testQualifiedName() throws Exception {
114-
SysMLInteractive instance = getSysMLInteractiveInstance();
114+
SysMLInteractive instance = createSysMLInteractiveInstance();
115115
SysMLInteractiveResult result = instance.process(qualifiedNameTest);
116116
Element root = result.getRootElement();
117117
List<Element> elements = ((Namespace)root).getOwnedMember();
@@ -150,7 +150,7 @@ public void testQualifiedName() throws Exception {
150150

151151
@Test
152152
public void testPathOperation() throws Exception {
153-
SysMLInteractive instance = getSysMLInteractiveInstance();
153+
SysMLInteractive instance = createSysMLInteractiveInstance();
154154
List<Element> elements = process(instance, pathTest);
155155

156156
Namespace TopLevel = (Namespace)elements.get(0);
@@ -201,7 +201,7 @@ public void testPathOperation() throws Exception {
201201

202202
@Test
203203
public void testDirectedUsage1() throws Exception {
204-
SysMLInteractive instance = getSysMLInteractiveInstance();
204+
SysMLInteractive instance = createSysMLInteractiveInstance();
205205
SysMLInteractiveResult result = instance.process(directedUsageTest1);
206206
Element root = result.getRootElement();
207207
List<Element> elements = ((Namespace)root).getOwnedMember();
@@ -248,7 +248,7 @@ public void testDirectedUsage1() throws Exception {
248248

249249
@Test
250250
public void testDirectedUsage2() throws Exception {
251-
SysMLInteractive instance = getSysMLInteractiveInstance();
251+
SysMLInteractive instance = createSysMLInteractiveInstance();
252252
SysMLInteractiveResult result = instance.process(directedUsageTest2);
253253
Element root = result.getRootElement();
254254
List<Element> elements = ((Namespace)root).getOwnedMember();
@@ -292,7 +292,7 @@ public void testDirectedUsage2() throws Exception {
292292

293293
@Test
294294
public void testEnumeratedValue() throws Exception {
295-
SysMLInteractive instance = getSysMLInteractiveInstance();
295+
SysMLInteractive instance = createSysMLInteractiveInstance();
296296
SysMLInteractiveResult result = instance.process(enumeratedValueTest);
297297
Element root = result.getRootElement();
298298
List<Element> elements = ((Namespace)root).getOwnedMember();
@@ -324,7 +324,7 @@ public void testEnumeratedValue() throws Exception {
324324

325325
@Test
326326
public void testCircularRecursiveImport() throws Exception {
327-
SysMLInteractive instance = getSysMLInteractiveInstance();
327+
SysMLInteractive instance = createSysMLInteractiveInstance();
328328
SysMLInteractiveResult result = instance.process(circularRecursiveImportTest);
329329
Element root = result.getRootElement();
330330
List<Element> elements = ((Namespace)root).getOwnedMember();
@@ -345,7 +345,7 @@ public void testCircularRecursiveImport() throws Exception {
345345

346346
@Test
347347
public void testLocale() throws Exception {
348-
SysMLInteractive instance = getSysMLInteractiveInstance();
348+
SysMLInteractive instance = createSysMLInteractiveInstance();
349349
SysMLInteractiveResult result = instance.process(localeTest);
350350
Element root = result.getRootElement();
351351
List<Element> elements = ((Namespace)root).getOwnedMember();
@@ -370,7 +370,7 @@ public void testLocale() throws Exception {
370370

371371
@Test
372372
public void testCrossFeature() throws Exception {
373-
SysMLInteractive instance = getSysMLInteractiveInstance();
373+
SysMLInteractive instance = createSysMLInteractiveInstance();
374374
SysMLInteractiveResult result = instance.process(crossFeatureTest);
375375
Element root = result.getRootElement();
376376
Namespace test = (Namespace)((Namespace)root).getOwnedMember().get(0);
@@ -401,7 +401,7 @@ public void testCrossFeature() throws Exception {
401401

402402
@Test
403403
public void testFeatureMembership() throws Exception {
404-
SysMLInteractive instance = getSysMLInteractiveInstance();
404+
SysMLInteractive instance = createSysMLInteractiveInstance();
405405
SysMLInteractiveResult result = instance.process(featureMembershipTest);
406406
Element root = result.getRootElement();
407407
List<Element> elements = ((Namespace)root).getOwnedMember();
@@ -432,7 +432,7 @@ private boolean testFeatureOwningTypes(Type type) {
432432

433433
@Test
434434
public void testNamespaceResolve() throws Exception {
435-
SysMLInteractive instance = getSysMLInteractiveInstance();
435+
SysMLInteractive instance = createSysMLInteractiveInstance();
436436
SysMLInteractiveResult result = instance.process(namespaceResolveTest);
437437
Element root = result.getRootElement();
438438
List<Element> elements = ((Namespace)root).getOwnedMember();

org.omg.sysml.interactive.tests/src/org/omg/sysml/interactive/tests/ExpressionEvaluationTest.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected void assertList(String[] expecteds, String actual) {
6464

6565
@Test
6666
public void testEvaluation1() throws Exception {
67-
SysMLInteractive instance = getSysMLInteractiveInstance();
67+
SysMLInteractive instance = createSysMLInteractiveInstance();
6868
process(instance, evalTest1);
6969
assertElement("LiteralInteger 3", instance.eval("p11.a2", "EvalTest1"));
7070
assertElement("LiteralInteger 2", instance.eval("p11.p11.a2", "EvalTest1"));
@@ -88,7 +88,7 @@ public void testEvaluation1() throws Exception {
8888

8989
@Test
9090
public void testEvaluation2() throws Exception {
91-
SysMLInteractive instance = getSysMLInteractiveInstance();
91+
SysMLInteractive instance = createSysMLInteractiveInstance();
9292
process(instance, evalTest2);
9393
assertElement("LiteralInteger 1", instance.eval("p1.a1", "EvalTest2"));
9494
assertElement("LiteralInteger 2", instance.eval("p2.a2", "EvalTest2"));
@@ -114,7 +114,7 @@ public void testEvaluation2() throws Exception {
114114

115115
@Test
116116
public void testEvaluation3() throws Exception {
117-
SysMLInteractive instance = getSysMLInteractiveInstance();
117+
SysMLInteractive instance = createSysMLInteractiveInstance();
118118
process(instance, evalTest3);
119119
assertElement("AttributeUsage a1", instance.eval("p1.a1", "EvalTest3"));
120120
assertElement("OperatorExpression +", instance.eval("p1.a2", "EvalTest3"));
@@ -142,7 +142,7 @@ public void testEvaluation3() throws Exception {
142142

143143
@Test
144144
public void testEvaluation4() throws Exception {
145-
SysMLInteractive instance = getSysMLInteractiveInstance();
145+
SysMLInteractive instance = createSysMLInteractiveInstance();
146146
process(instance, evalTest4);
147147
assertElement("AttributeUsage a1", instance.eval("p1.a1", "EvalTest4"));
148148
assertElement("LiteralInteger 3", instance.eval("p1.a2", "EvalTest4"));
@@ -185,7 +185,7 @@ public void testEvaluation4() throws Exception {
185185

186186
@Test
187187
public void testEvaluation5() throws Exception {
188-
SysMLInteractive instance = getSysMLInteractiveInstance();
188+
SysMLInteractive instance = createSysMLInteractiveInstance();
189189
process(instance, evalTest5);
190190
assertElement("LiteralBoolean true", instance.eval("p1.c1()", "EvalTest5"));
191191
assertElement("LiteralBoolean false", instance.eval("p1.c2()", "EvalTest5"));
@@ -229,7 +229,7 @@ public void testEvaluation5() throws Exception {
229229

230230
@Test
231231
public void testEvaluation6() throws Exception {
232-
SysMLInteractive instance = getSysMLInteractiveInstance();
232+
SysMLInteractive instance = createSysMLInteractiveInstance();
233233
process(instance, evalTest6);
234234
assertElement("LiteralInteger 10", instance.eval("p1.a", "EvalTest6"));
235235
assertElement("LiteralInteger 17", instance.eval("p1.z1", "EvalTest6"));
@@ -259,7 +259,7 @@ public void testEvaluation6() throws Exception {
259259

260260
@Test
261261
public void testEvaluation7() throws Exception {
262-
SysMLInteractive instance = getSysMLInteractiveInstance();
262+
SysMLInteractive instance = createSysMLInteractiveInstance();
263263
process(instance, evalTest7);
264264
assertElement("LiteralInteger 1", instance.eval("test.fact1", "EvalTest7"));
265265
assertElement("LiteralInteger 120", instance.eval("test.fact5", "EvalTest7"));
@@ -287,7 +287,7 @@ public void testEvaluation7() throws Exception {
287287

288288
@Test
289289
public void testChainEvaluation() throws Exception {
290-
SysMLInteractive instance = getSysMLInteractiveInstance();
290+
SysMLInteractive instance = createSysMLInteractiveInstance();
291291
process(instance, chainTest);
292292
assertElement("LiteralInteger 1", instance.eval("y.a.z", "ChainTest"));
293293
}
@@ -318,7 +318,7 @@ public void testChainEvaluation() throws Exception {
318318

319319
@Test
320320
public void testIndexOperator() throws Exception {
321-
SysMLInteractive instance = getSysMLInteractiveInstance();
321+
SysMLInteractive instance = createSysMLInteractiveInstance();
322322
process(instance, indexOperatorTest);
323323
assertElement("LiteralString a", instance.eval("seq#(1)", "IndexOperatorTest"));
324324
assertElement("LiteralString b", instance.eval("seq#(2)", "IndexOperatorTest"));
@@ -352,7 +352,7 @@ public void testIndexOperator() throws Exception {
352352

353353
@Test
354354
public void testInvocationEvaluation() throws Exception {
355-
SysMLInteractive instance = getSysMLInteractiveInstance();
355+
SysMLInteractive instance = createSysMLInteractiveInstance();
356356
process(instance, invocationTest);
357357
assertList(new String[] {"LiteralInteger 1", "LiteralInteger 2"}, instance.eval("Test(1, 2)", "InvocationTest"));
358358
assertList(new String[] {"LiteralInteger 1", "LiteralInteger 2"}, instance.eval("Test(x = 1, y = 2)", "InvocationTest"));
@@ -363,7 +363,7 @@ public void testInvocationEvaluation() throws Exception {
363363

364364
@Test
365365
public void testArithmeticEvaluation() throws Exception {
366-
SysMLInteractive instance = getSysMLInteractiveInstance();
366+
SysMLInteractive instance = createSysMLInteractiveInstance();
367367
assertElement("LiteralInteger 5", instance.eval("2 + 3", null));
368368
assertElement("LiteralInteger -1", instance.eval("2 - 3", null));
369369
assertElement("LiteralInteger 6", instance.eval("2 * 3", null));
@@ -374,7 +374,7 @@ public void testArithmeticEvaluation() throws Exception {
374374

375375
@Test
376376
public void testListOpsExpression() throws Exception {
377-
SysMLInteractive instance = getSysMLInteractiveInstance();
377+
SysMLInteractive instance = createSysMLInteractiveInstance();
378378
assertList(new String[] {}, instance.eval("null", null));
379379
assertList(new String[] {}, instance.eval("()", null));
380380
assertList(new String[]{"LiteralInteger 1", "LiteralInteger 2", "LiteralInteger 3"}, instance.eval("(1, 2, 3)", null));
@@ -384,14 +384,14 @@ public void testListOpsExpression() throws Exception {
384384

385385
@Test
386386
public void testControlOpEvaluation() throws Exception {
387-
SysMLInteractive instance = getSysMLInteractiveInstance();
387+
SysMLInteractive instance = createSysMLInteractiveInstance();
388388
assertList(new String[] {"LiteralInteger 2", "LiteralInteger 4", "LiteralInteger 6"}, instance.eval("(1,2,3).{in x : ScalarValues::Integer; x * 2}", null));
389389
assertList(new String[] {"LiteralInteger 1", "LiteralInteger 2"}, instance.eval("(1,2,3).?{in x : ScalarValues::Integer; x < 3}", null));
390390
}
391391

392392
@Test
393393
public void testDataFunctionEvaluation() throws Exception {
394-
SysMLInteractive instance = getSysMLInteractiveInstance();
394+
SysMLInteractive instance = createSysMLInteractiveInstance();
395395

396396
assertElement("LiteralInteger 2", instance.eval("DataFunctions::max(1,2)", null));
397397
assertElement("LiteralInteger 2", instance.eval("DataFunctions::max(2,1)", null));
@@ -416,14 +416,14 @@ public void testDataFunctionEvaluation() throws Exception {
416416

417417
@Test
418418
public void testNumericalFunctionEvaluation() throws Exception {
419-
SysMLInteractive instance = getSysMLInteractiveInstance();
419+
SysMLInteractive instance = createSysMLInteractiveInstance();
420420
assertElement("LiteralInteger 6", instance.eval("NumericalFunctions::sum((1,2,3))", null));
421421
assertElement("LiteralInteger 6", instance.eval("NumericalFunctions::product((1,2,3))", null));
422422
}
423423

424424
@Test
425425
public void testSequenceFunctionEvaluation() throws Exception {
426-
SysMLInteractive instance = getSysMLInteractiveInstance();
426+
SysMLInteractive instance = createSysMLInteractiveInstance();
427427
assertElement("LiteralInteger 3", instance.eval("SequenceFunctions::size((1, 2, 3))", null));
428428

429429
assertElement("LiteralBoolean true", instance.eval("SequenceFunctions::includes((1, 2, 3), 1)", null));
@@ -505,7 +505,7 @@ public void testSequenceFunctionEvaluation() throws Exception {
505505

506506
@Test
507507
public void testCollectionFunctionEvaluation() throws Exception {
508-
SysMLInteractive instance = getSysMLInteractiveInstance();
508+
SysMLInteractive instance = createSysMLInteractiveInstance();
509509
process(instance, collectionTest);
510510

511511
assertElement("LiteralInteger 3", instance.eval("CollectionFunctions::size(collection123)", "CollectionTest"));
@@ -543,7 +543,7 @@ public void testCollectionFunctionEvaluation() throws Exception {
543543

544544
@Test
545545
public void testControlFunctionEvaluation() throws Exception {
546-
SysMLInteractive instance = getSysMLInteractiveInstance();
546+
SysMLInteractive instance = createSysMLInteractiveInstance();
547547
assertList(new String[] {"LiteralInteger 2", "LiteralInteger 4", "LiteralInteger 6"}, instance.eval("(1,2,3)->ControlFunctions::collect{in x : ScalarValues::Integer; x * 2}", null));
548548
assertList(new String[] {"LiteralInteger 1", "LiteralInteger 2"}, instance.eval("(1,2,3)->ControlFunctions::select{in x : ScalarValues::Integer; x < 3}", null));
549549
assertList(new String[] {"LiteralInteger 1"}, instance.eval("(1,2,3)->ControlFunctions::selectOne{in x : ScalarValues::Integer; x < 3}", null));
@@ -569,7 +569,7 @@ public void testControlFunctionEvaluation() throws Exception {
569569

570570
@Test
571571
public void testTrigFunctionEvaluation() throws Exception {
572-
SysMLInteractive instance = getSysMLInteractiveInstance();
572+
SysMLInteractive instance = createSysMLInteractiveInstance();
573573
assertElement("LiteralRational " + Math.sin(2), instance.eval("TrigFunctions::sin(2)", null));
574574
assertElement("LiteralRational " + Math.sin(2.5), instance.eval("TrigFunctions::sin(2.5)", null));
575575
assertElement("LiteralRational " + Math.cos(2), instance.eval("TrigFunctions::cos(2)", null));

org.omg.sysml.interactive.tests/src/org/omg/sysml/interactive/tests/GlobalNameRedefinitionTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class GlobalNameRedefinitionTest extends SysMLInteractiveTest {
3838

3939
@Test
4040
public void testRedefinitionShadowing() throws Exception {
41-
SysMLInteractive instance = getSysMLInteractiveInstance();
41+
SysMLInteractive instance = createSysMLInteractiveInstance();
4242

4343
SysMLInteractiveResult result1 = instance.process("y = 1;");
4444
System.out.println(result1);
@@ -57,7 +57,7 @@ public void testRedefinitionShadowing() throws Exception {
5757

5858
@Test
5959
public void testRedefinitionShadowingMultidigitFiles() throws Exception {
60-
SysMLInteractive instance = getSysMLInteractiveInstance();
60+
SysMLInteractive instance = createSysMLInteractiveInstance();
6161

6262
// This is used to ensure later requests will get identifiers 9 and 10
6363
for (int i=1; i<9; i++) {
@@ -81,7 +81,7 @@ public void testRedefinitionShadowingMultidigitFiles() throws Exception {
8181

8282
@Test
8383
public void testNoShadowingCaseSensitive() throws Exception {
84-
SysMLInteractive instance = getSysMLInteractiveInstance();
84+
SysMLInteractive instance = createSysMLInteractiveInstance();
8585

8686
SysMLInteractiveResult result1 = instance.process("y = 1;");
8787
System.out.println(result1);

0 commit comments

Comments
 (0)