summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoritz Eysholdt2012-05-23 09:33:11 (EDT)
committer Sebastian Zarnekow2012-05-24 03:21:45 (EDT)
commite8693b487a4ee66a297f28a5249a61881038b252 (patch)
treef02721b4901d977ecff10cc008e10b82b37be0e8
parent874363846c7083743ed6634ca0a2cad2ae0e6b82 (diff)
downloadorg.eclipse.mwe-e8693b487a4ee66a297f28a5249a61881038b252.zip
org.eclipse.mwe-e8693b487a4ee66a297f28a5249a61881038b252.tar.gz
org.eclipse.mwe-e8693b487a4ee66a297f28a5249a61881038b252.tar.bz2
enabled the JUnit4Fragment
Signed-off-by: Sebastian Zarnekow <Sebastian.Zarnekow@itemis.de>
-rw-r--r--plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/GenerateMwe2.java11
-rw-r--r--plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/serializer/Mwe2SemanticSequencer.java6
-rw-r--r--tests/org.eclipse.emf.mwe2.language.tests/.classpath1
-rw-r--r--tests/org.eclipse.emf.mwe2.language.tests/META-INF/MANIFEST.MF13
4 files changed, 29 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/GenerateMwe2.java b/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/GenerateMwe2.java
index 1f01256..45c4706 100644
--- a/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/GenerateMwe2.java
+++ b/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/GenerateMwe2.java
@@ -17,6 +17,7 @@ import org.eclipse.xtext.generator.builder.BuilderIntegrationFragment;
import org.eclipse.xtext.generator.exporting.QualifiedNamesFragment;
import org.eclipse.xtext.generator.formatting.FormatterFragment;
import org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment;
+import org.eclipse.xtext.generator.junit.Junit4Fragment;
import org.eclipse.xtext.generator.parser.antlr.ex.ExternalAntlrLexerFragment;
import org.eclipse.xtext.generator.parser.antlr.ex.ca.ContentAssistParserGeneratorFragment;
import org.eclipse.xtext.generator.parser.antlr.ex.rt.AntlrGeneratorFragment;
@@ -47,6 +48,7 @@ public class GenerateMwe2 {
final String file_extensions = "mwe2";
final String projectName = "org.eclipse.emf.mwe2.language";
final String runtimeProject = "../"+projectName+"";
+ final String testProject = "../../tests/"+projectName+".tests";
final String uiProject = ""+runtimeProject+".ui";
Workflow workflow = new Workflow() {
@@ -82,11 +84,18 @@ public class GenerateMwe2 {
setDirectory(""+runtimeProject+".ui/src-gen");
}
});
+
+ addComponent(new DirectoryCleaner() {
+ {
+ setDirectory(""+testProject+".ui/src-gen");
+ }
+ });
addComponent(new Generator() {
{
setPathRtProject(runtimeProject);
setPathUiProject(uiProject);
+ setPathTestProject(testProject);
setProjectNameRt(projectName);
setProjectNameUi(""+projectName+".ui");
@@ -168,6 +177,8 @@ public class GenerateMwe2 {
addFragment(compareFragment);
addFragment(new CodetemplatesGeneratorFragment());
+
+ addFragment(new Junit4Fragment());
}
});
}
diff --git a/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/serializer/Mwe2SemanticSequencer.java b/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/serializer/Mwe2SemanticSequencer.java
index 9b098f2..2fc232a 100644
--- a/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/serializer/Mwe2SemanticSequencer.java
+++ b/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/serializer/Mwe2SemanticSequencer.java
@@ -3,15 +3,21 @@ package org.eclipse.emf.mwe2.language.serializer;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.mwe2.language.mwe2.PlainString;
import org.eclipse.emf.mwe2.language.mwe2.StringLiteral;
+import org.eclipse.emf.mwe2.language.services.Mwe2GrammarAccess;
import org.eclipse.emf.mwe2.language.services.Mwe2GrammarAccess.StringLiteralElements;
import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
import org.eclipse.xtext.serializer.sequencer.ISemanticNodeProvider.INodesForEObjectProvider;
+import com.google.inject.Inject;
+
/**
* @author Moritz Eysholdt - Initial contribution and API
*/
@SuppressWarnings("restriction")
public class Mwe2SemanticSequencer extends AbstractMwe2SemanticSequencer {
+
+ @Inject
+ private Mwe2GrammarAccess grammarAccess;
@Override
protected void sequence_StringLiteral(EObject context, StringLiteral lit) {
diff --git a/tests/org.eclipse.emf.mwe2.language.tests/.classpath b/tests/org.eclipse.emf.mwe2.language.tests/.classpath
index 64c5e31..59cf397 100644
--- a/tests/org.eclipse.emf.mwe2.language.tests/.classpath
+++ b/tests/org.eclipse.emf.mwe2.language.tests/.classpath
@@ -3,5 +3,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-gen"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/tests/org.eclipse.emf.mwe2.language.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.emf.mwe2.language.tests/META-INF/MANIFEST.MF
index de56c39..329f890 100644
--- a/tests/org.eclipse.emf.mwe2.language.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.emf.mwe2.language.tests/META-INF/MANIFEST.MF
@@ -15,6 +15,15 @@ Require-Bundle: org.eclipse.emf.mwe2.language;bundle-version="2.0.0",
org.eclipse.xtext.ui.shared;bundle-version="2.3.0",
org.eclipse.xtext.ui;bundle-version="2.3.0",
org.eclipse.jdt.core,
- org.eclipse.xtext.common.types.ui;bundle-version="2.3.0"
+ org.eclipse.xtext.common.types.ui;bundle-version="2.3.0",
+ org.eclipse.core.runtime,
+ org.eclipse.ui.workbench;resolution:=optional
Bundle-ActivationPolicy: lazy
-Import-Package: org.junit;version="4.5.0"
+Import-Package: org.junit;version="4.5.0",
+ org.junit.runner;version="4.5.0",
+ org.junit.runner.manipulation;version="4.5.0",
+ org.junit.runner.notification;version="4.5.0",
+ org.junit.runners;version="4.5.0",
+ org.junit.runners.model;version="4.5.0",
+ org.hamcrest.core
+Export-Package: org.eclipse.emf.mwe2.language