summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkwannheden2009-08-24 10:25:15 (EDT)
committer sefftinge2009-08-24 10:25:15 (EDT)
commit93d2746d0c8fa14749fd4fc690c5eea49fb6e303 (patch)
tree378abcccb265dba760e52b342f5957f5d08d07c4
parentd8e6773f8fb9f332472d48661b3c7e892720ba11 (diff)
downloadorg.eclipse.xtext-93d2746d0c8fa14749fd4fc690c5eea49fb6e303.zip
org.eclipse.xtext-93d2746d0c8fa14749fd4fc690c5eea49fb6e303.tar.gz
org.eclipse.xtext-93d2746d0c8fa14749fd4fc690c5eea49fb6e303.tar.bz2
Fix: allow importURI feature to reference registered EPackages - https://bugs.eclipse.org/bugs/show_bug.cgi?id=280817
-rw-r--r--tests/org.eclipse.xtext.generator.tests/org.eclipse.xtext.generator.tests.launch33
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/scoping/impl/ImportUriUtilTest.java11
2 files changed, 39 insertions, 5 deletions
diff --git a/tests/org.eclipse.xtext.generator.tests/org.eclipse.xtext.generator.tests.launch b/tests/org.eclipse.xtext.generator.tests/org.eclipse.xtext.generator.tests.launch
index a38b521..6f7f5aa 100644
--- a/tests/org.eclipse.xtext.generator.tests/org.eclipse.xtext.generator.tests.launch
+++ b/tests/org.eclipse.xtext.generator.tests/org.eclipse.xtext.generator.tests.launch
@@ -1,16 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
-<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.xtext.generator.tests/src"/>
+<listEntry value="/org.eclipse.xtext.generator.tests"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="2"/>
+<listEntry value="4"/>
</listAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.xtext.generator.tests/src"/>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.xtext.generator.tests"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.xtext.generator.tests"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx640m"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx512m -XX:MaxPermSize=256M -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="run_in_ui_thread" value="true"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
</launchConfiguration>
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/scoping/impl/ImportUriUtilTest.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/scoping/impl/ImportUriUtilTest.java
index ab4f9ad..074b2ed 100644
--- a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/scoping/impl/ImportUriUtilTest.java
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/scoping/impl/ImportUriUtilTest.java
@@ -11,6 +11,7 @@ package org.eclipse.xtext.scoping.impl;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.resource.ContentHandler;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
@@ -35,4 +36,14 @@ public class ImportUriUtilTest extends AbstractXtextTests {
assertEquals(bar, ImportUriUtil.getResource(foo, "bar.xmi"));
assertEquals(true, ImportUriUtil.isValid(ePackage, "bar.xmi"));
}
+
+ public void testEPackageURI() throws Exception {
+ ResourceSet rs = new ResourceSetImpl();
+ Resource foo = rs.createResource(URI.createURI("foo.xmi"), ContentHandler.UNSPECIFIED_CONTENT_TYPE);
+ EPackage ePackage = EcoreFactory.eINSTANCE.createEPackage();
+ foo.getContents().add(ePackage);
+
+ assertEquals(true, ImportUriUtil.isValid(ePackage, EcorePackage.eNS_URI));
+ }
+
}