Skip to content

Commit e05085a

Browse files
committed
added a lib for helping language workbench tests
1 parent 0d97038 commit e05085a

13 files changed

Lines changed: 161 additions & 27 deletions

File tree

framework/xdsml_framework/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<module>plugins/org.gemoc.xdsmlframework.ui.utils</module>
1717
<module>plugins/org.gemoc.xdsmlframework.ide.ui</module>
1818
<module>plugins/org.gemoc.xdsmlframework.extensions.sirius</module>
19+
<module>tests/org.gemoc.xdsmlframework.test.lib</module>
1920

2021
<!-- feature -->
2122
<module>releng/org.gemoc.modeldebugging.xdsmlframework.feature</module>

framework/xdsml_framework/releng/org.gemoc.modeldebugging.xdsmlframework.feature/feature.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,12 @@
3737
install-size="0"
3838
version="0.0.0"
3939
unpack="false"/>
40+
41+
<plugin
42+
id="org.gemoc.xdsmlframework.test.lib"
43+
download-size="0"
44+
install-size="0"
45+
version="0.0.0"
46+
unpack="false"/>
4047

4148
</feature>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5+
<classpathentry kind="src" path="src"/>
6+
<classpathentry kind="src" path="xtend-gen"/>
7+
<classpathentry kind="output" path="bin"/>
8+
</classpath>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>org.gemoc.xdsmlframework.test.lib</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.jdt.core.javabuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.pde.ManifestBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.pde.SchemaBuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>org.eclipse.pde.PluginNature</nature>
31+
<nature>org.eclipse.jdt.core.javanature</nature>
32+
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
33+
</natures>
34+
</projectDescription>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.compliance=1.8
5+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7+
org.eclipse.jdt.core.compiler.source=1.8
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: xdsmlframework Test library
4+
Bundle-SymbolicName: org.gemoc.xdsmlframework.test.lib
5+
Bundle-Version: 2.3.0.qualifier
6+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
7+
Require-Bundle: org.junit;bundle-version="4.12.0",
8+
org.eclipse.xtext.junit4;bundle-version="2.10.0",
9+
org.eclipse.xtext.xbase.lib;bundle-version="2.10.0",
10+
fr.inria.diverse.melange.ui;bundle-version="0.2.0",
11+
org.eclipse.debug.ui;bundle-version="3.11.202",
12+
org.eclipse.emf.compare;bundle-version="3.3.1",
13+
org.eclipse.jdt.core;bundle-version="3.12.3",
14+
org.eclipse.ui.ide;bundle-version="3.12.3",
15+
org.eclipse.jdt.launching;bundle-version="3.8.101",
16+
org.eclipse.jdt.ui;bundle-version="3.12.2",
17+
org.eclipse.xtext.ui;bundle-version="2.10.0",
18+
fr.inria.diverse.melange.metamodel;bundle-version="0.2.0",
19+
org.eclipse.core.expressions;bundle-version="3.5.100",
20+
fr.inria.diverse.trace.gemoc.generator;bundle-version="2.3.0",
21+
fr.inria.diverse.trace.gemoc;bundle-version="2.3.0"
22+
Export-Package: org.gemoc.xdsmlframework.test.lib
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source.. = src/,\
2+
xtend-gen/
3+
output.. = bin/
4+
bin.includes = META-INF/,\
5+
.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project>
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<relativePath>../..</relativePath>
7+
<groupId>org.gemoc.modeldebugging.xdsmlframework</groupId>
8+
<artifactId>org.gemoc.modeldebugging.xdsmlframework.root</artifactId>
9+
<version>2.3.0-SNAPSHOT</version>
10+
</parent>
11+
12+
<artifactId>org.gemoc.xdsmlframework.test.lib</artifactId>
13+
<packaging>eclipse-plugin</packaging>
14+
15+
</project>
16+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2017 Inria.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* Inria - initial API and implementation
10+
*******************************************************************************/
11+
package org.gemoc.xdsmlframework.test.lib;
12+
13+
import org.eclipse.xtext.junit4.IInjectorProvider;
14+
15+
import com.google.inject.Injector;
16+
17+
public class MelangeUiInjectorProvider implements IInjectorProvider {
18+
19+
@Override
20+
public Injector getInjector() {
21+
return fr.inria.diverse.melange.ui.internal.MelangeActivator.getInstance().getInjector("fr.inria.diverse.melange.Melange");
22+
}
23+
24+
}

java_execution/java_xdsml/tests/org.gemoc.execution.sequential.javaxdsml.tests/src/org/gemoc/execution/sequential/javaxdsml/tests/eclipse/shared/WorkspaceTestHelper.xtend renamed to framework/xdsml_framework/tests/org.gemoc.xdsmlframework.test.lib/src/org/gemoc/xdsmlframework/test/lib/WorkspaceTestHelper.xtend

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
package org.gemoc.execution.sequential.javaxdsml.tests.eclipse.shared
1+
/*******************************************************************************
2+
* Copyright (c) 2017 Inria.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* Inria - initial API and implementation
10+
*******************************************************************************/
11+
package org.gemoc.xdsmlframework.test.lib
212

313
import com.google.common.base.Charsets
414
import com.google.common.io.CharStreams
@@ -81,6 +91,10 @@ import org.eclipse.core.runtime.IProgressMonitor
8191
import org.eclipse.core.runtime.Status
8292
import com.google.common.io.ByteStreams
8393

94+
95+
/**
96+
* Class containing helper methods for testing a workspace in a GEMOC Language workbench
97+
*/
8498
class WorkspaceTestHelper {
8599
static final String MELANGE_CMD_GENERATE_ALL = "fr.inria.diverse.melange.GenerateAll"
86100
static final String MELANGE_CMD_GENERATE_ADAPTERS = "fr.inria.diverse.melange.GenerateAdapters"
@@ -464,8 +478,8 @@ class WorkspaceTestHelper {
464478

465479
Assert.assertEquals(pkg.name, node.text.toString)
466480

467-
val subPack = pkg.ESubpackages
468-
val classes = pkg.EClassifiers
481+
val subPack = pkg.getESubpackages
482+
val classes = pkg.getEClassifiers
469483
val subNodes = node.children
470484

471485
subPack.forEach[p |
@@ -487,23 +501,23 @@ class WorkspaceTestHelper {
487501

488502
Assert.assertEquals(cls.name, node.text.toString)
489503

490-
val ref = cls.EAllReferences
491-
val att = cls.EAllAttributes
492-
val op = cls.EAllOperations
504+
val ref = cls.getEAllReferences
505+
val att = cls.getEAllAttributes
506+
val op = cls.getEAllOperations
493507
val subNodes = node.children
494508

495509
ref.forEach[r |
496-
val n = subNodes.findFirst[text.toString == (r.name +" : "+ r.EType.name)]
510+
val n = subNodes.findFirst[text.toString == (r.name +" : "+ r.getEType.name)]
497511
Assert.assertNotNull(n)
498512
]
499513

500514
att.forEach[a |
501-
val n = subNodes.findFirst[text.toString == a.name +" : "+ a.EType.name]
515+
val n = subNodes.findFirst[text.toString == a.name +" : "+ a.getEType.name]
502516
Assert.assertNotNull(n)
503517
]
504518

505519
op.forEach[o |
506-
val n = subNodes.findFirst[text.toString == o.name +" : "+ o.EType.name]
520+
val n = subNodes.findFirst[text.toString == o.name +" : "+ o.getEType.name]
507521
Assert.assertNotNull(n)
508522
]
509523
}

0 commit comments

Comments
 (0)