mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 16:28:56 +00:00
fixed UriBasedReaderTest (#32)
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
This commit is contained in:
parent
88894d23b8
commit
fa84a99b56
1 changed files with 8 additions and 3 deletions
|
@ -8,6 +8,8 @@
|
|||
package org.eclipse.xtext.mwe;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
|
@ -72,7 +74,7 @@ public class UriBasedReaderTest extends AbstractXtextTests {
|
|||
@Test public void testTransitiveReferences() throws Exception {
|
||||
UriBasedReader reader = new UriBasedReader();
|
||||
reader.addRegister(new ImportUriTestLanguageStandaloneSetup());
|
||||
reader.addUri("file:/" + pathTo("importUriSubfolder/Start.importuritestlanguage"));
|
||||
reader.addUri(pathTo2("importUriSubfolder/Start.importuritestlanguage"));
|
||||
|
||||
SlotEntry slotEntry = new SlotEntry();
|
||||
slotEntry.setType("Type");
|
||||
|
@ -195,8 +197,11 @@ public class UriBasedReaderTest extends AbstractXtextTests {
|
|||
assertTrue(errorString, errorString.contains(errorURI));
|
||||
}
|
||||
|
||||
public String pathTo(String string) throws Exception {
|
||||
return new ReaderTest().pathTo(string).replace(File.separator, "/");
|
||||
public String pathTo2(String string) throws Exception {
|
||||
Path path = FileSystems.getDefault().getPath("").toAbsolutePath().resolve("src/"+getClass().getName().replace('.', '/') + ".java").getParent();
|
||||
Path resolved = path.resolve(string);
|
||||
String result = resolved.toUri().toString();
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue