11/* ****************************************************************************
22 * SysML 2 Pilot Implementation
33 * Copyright (c) 2018 IncQuery Labs Ltd.
4+ * Copyright (c) 2018, 2019 California Institute of Technology/Jet Propulsion Laboratory
5+ * Copyright (c) 2019 Model Driven Solutions
46 *
57 * This program is free software: you can redistribute it and/or modify
68 * it under the terms of the GNU Lesser General Public License as published by
1820 * @license LGPL-3.0-or-later <http://spdx.org/licenses/LGPL-3.0-or-later>
1921 *
2022 * Contributors:
21- * Zoltan Kiss
22- * Balazs Grill
23+ * Zoltan Kiss, IncQuery
24+ * Balazs Grill, IncQuery
25+ * Miyako Wilson, JPL
26+ * Ed Seidewitz, MDS
2327 *
2428 *****************************************************************************/
2529package org.omg.sysml.tests
@@ -30,18 +34,28 @@ import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
3034import org.eclipse.xtext.resource.XtextResourceSet
3135import org.eclipse.xtext.testing.util.ParseHelper
3236import org.omg.sysml.lang.sysml.Package
37+ import org.eclipse.emf.common.util.URI
3338
3439class Dependency {
40+
41+ public static final String LIBRARY_BASE_PATH = " library/Base.alf" ;
3542
3643 @Inject
3744 private Provider<XtextResourceSet > resourceSetProvider;
3845
3946 @Inject
4047 ParseHelper<Package > parseHelper
48+
49+ // Loads Base library file, which has elements that are needed for default specializations
50+ public def ResourceSetImpl getLibraryBasePackage () {
51+ val rs = resourceSetProvider. get
52+ rs. getResource(URI . createFileURI(LIBRARY_BASE_PATH ), true )
53+ rs
54+ }
4155
4256 // Basic import file most of the tests use this
4357 public def ResourceSetImpl getDependencyOuterPackage () {
44- val rs = resourceSetProvider . get
58+ val rs = getLibraryBasePackage
4559 parseHelper. parse(
4660 ' ' ' package OuterPackage{
4761 class A{
@@ -56,7 +70,7 @@ class Dependency {
5670
5771 // Basic import file most of the tests use this
5872 public def ResourceSetImpl getDependencyOuterPackage2 () {
59- val rs = resourceSetProvider . get
73+ val rs = getLibraryBasePackage
6074 parseHelper. parse(
6175 ' ' ' package OuterPackage{
6276 class A{
@@ -116,7 +130,7 @@ class Dependency {
116130
117131 // It's for the shadowing tests
118132 def ResourceSetImpl getDependencyAlias () {
119- val rs = resourceSetProvider . get
133+ val rs = getLibraryBasePackage
120134 parseHelper. parse(' ' '
121135 package PackageAlias1{
122136 A_alias is A;
@@ -144,7 +158,7 @@ class Dependency {
144158
145159 // It's for the shadowing tests
146160 def ResourceSetImpl getDependencySameNamesImport () {
147- val rs = resourceSetProvider . get
161+ val rs = getLibraryBasePackage
148162 parseHelper. parse(' ' '
149163 package SamePackage{
150164 class container{
@@ -164,7 +178,7 @@ class Dependency {
164178
165179 // The Visibility tests use this source
166180 def ResourceSetImpl getDependencyVisibilityPackage () {
167- val rs = resourceSetProvider . get
181+ val rs = getLibraryBasePackage
168182 parseHelper. parse(' ' '
169183 package VisibilityPackage {
170184 private class c_Private{
0 commit comments