File accessed outside allowed roots

Hi,

I'm running into a problem in my JUnit tests (those which use testdata). They work fine on OSX and Linux (Travis), but on Windows I keep getting this error when I try to open a testdata file:

java.lang.AssertionError: File accessed outside allowed roots: file://C:/dev/projets/IDEALeek/testdata/annotator/Duplicates.lks; Allowed roots: [/src, C:/Users/bj/AppData/Local/Temp, C:/Users/bj, testdata/annotator/Duplicates.lks, C:/Profil/bj/IntelliJIdea13/system/plugins-sandbox/test, C:/Users/bj/AppData/Local/Temp/, C:/Users/bj/AppData/Local/Temp/unitTest_duplicateDeclarations_435, C:/dev/projets/IDEALeek/out, C:/Program Files/Java/jdk1.7.0_45/jre]


Obviously, when I mean to use the fixture "testdata/annotator/Duplicates.lks" it's the one in "file://C:/dev/projets/IDEALeek/testdata/annotator/Duplicates.lks" but somehow on Windows one of the two paths is not absolute...

Here's my test case:

public class AnnotatorTest extends LSCodeInsightTestSupport {

    @Override
    protected String getTestDataPath() {
        return "testdata/annotator";
    }

    public void testDuplicateDeclarations() {
        myFixture.configureByFile("Duplicates.lks");
        myFixture.checkHighlighting();
    }
}


The wiki also uses a relative path to testdata. Can someone tell me what I'm doing wrong?
It seems that the guys developing the Kotlin plugin had the same problem, and that they had to use a workaround for the EAP 14. Should I use VirtualDirectoryImpl.allowRootAccess() manually as well?

1 comment
Comment actions Permalink

It's a bug. I've created the issue to track it:
http://youtrack.jetbrains.com/issue/IDEA-129297

Alexey Kudravtsev
Intellij IDEA  developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with  pleasure!"
0

Please sign in to leave a comment.