summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorszarnekow2009-02-03 09:29:18 (EST)
committer sefftinge2009-02-03 09:29:18 (EST)
commit7ea5a4c1d03d30b18977af9c04c49143447e2698 (patch)
treed8178f68c356d1681417cc5ee1743e810b508c0b
parenta1f631eaec9a6bf46fb5db4d8c607546339dba81 (diff)
downloadorg.eclipse.xtext-7ea5a4c1d03d30b18977af9c04c49143447e2698.zip
org.eclipse.xtext-7ea5a4c1d03d30b18977af9c04c49143447e2698.tar.gz
org.eclipse.xtext-7ea5a4c1d03d30b18977af9c04c49143447e2698.tar.bz2
org.eclipse.xtext.generator.tests is green when executed as plugin test
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/ParserTestHelper.java4
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/ComplexReconstrTest.java7
-rwxr-xr-xtests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/tests/AbstractGeneratorTest.java4
3 files changed, 7 insertions, 8 deletions
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/ParserTestHelper.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/ParserTestHelper.java
index 60dc847..3519045 100644
--- a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/ParserTestHelper.java
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/ParserTestHelper.java
@@ -11,7 +11,6 @@ import java.io.IOException;
import java.io.InputStream;
import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.Resource.Diagnostic;
import org.eclipse.xtext.resource.IResourceFactory;
import org.eclipse.xtext.resource.XtextResource;
@@ -31,7 +30,8 @@ public class ParserTestHelper {
}
public XtextResource getResourceFromStream(InputStream in) throws IOException {
- ResourceSet rs = new XtextResourceSet();
+ XtextResourceSet rs = new XtextResourceSet();
+ rs.setClasspathURIContext(getClass());
URI uri = URI.createURI("mytestmodel." + factory.getModelFileExtensions()[0]);
XtextResource resource = createResource(uri);
rs.getResources().add(resource);
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/ComplexReconstrTest.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/ComplexReconstrTest.java
index 5abc066..062f753 100644
--- a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/ComplexReconstrTest.java
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/ComplexReconstrTest.java
@@ -11,7 +11,6 @@ package org.eclipse.xtext.parsetree.reconstr;
import org.apache.log4j.Logger;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.xtext.ParserRule;
import org.eclipse.xtext.resource.XtextResourceSet;
import org.eclipse.xtext.tests.AbstractGeneratorTest;
@@ -30,9 +29,9 @@ public class ComplexReconstrTest extends AbstractGeneratorTest {
}
public void testPrintGrammar() {
- ResourceSet rs = new XtextResourceSet();
- URI u = URI
- .createURI("classpath:/org/eclipse/xtext/parsetree/reconstr/ComplexReconstrTestLanguage.xmi");
+ XtextResourceSet rs = new XtextResourceSet();
+ rs.setClasspathURIContext(getClass());
+ URI u = URI.createURI("classpath:/org/eclipse/xtext/parsetree/reconstr/ComplexReconstrTestLanguage.xmi");
EObject o = rs.getResource(u, true).getContents().get(0);
for (Object x : o.eContents())
if (x instanceof ParserRule) {
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/tests/AbstractGeneratorTest.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/tests/AbstractGeneratorTest.java
index ccd7117..fb8e3f5 100755
--- a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/tests/AbstractGeneratorTest.java
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/tests/AbstractGeneratorTest.java
@@ -18,7 +18,6 @@ import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.Resource.Diagnostic;
import org.eclipse.xtend.XtendFacade;
import org.eclipse.xtend.expression.ExecutionContextImpl;
@@ -151,7 +150,8 @@ public abstract class AbstractGeneratorTest extends TestCase {
}
protected XtextResource getResource(InputStream in) throws Exception {
- ResourceSet rs = new XtextResourceSet();
+ XtextResourceSet rs = new XtextResourceSet();
+ rs.setClasspathURIContext(getClass());
XtextResource resource = (XtextResource) rs.createResource(URI.createURI("mytestmodel."+getResourceFactory().getModelFileExtensions()[0]));
resource.load(in, null);