LightCodeInsightFixtureTestCase can't find resource bundle

Answered

I'm getting an exception in a simple LightCodeInsightFixtureTestCase that looks like this

public class RenameTest extends LightCodeInsightFixtureTestCase{

@Test
public void testRename1() throws Exception {
myFixture.configureByText(MathematicaFileType.INSTANCE, "code1");
myFixture.renameElementAtCaret("var");
myFixture.checkResult("code2");
}
}

Unfortunately, I'm getting a java.util.MissingResourceException (here is the full trace) which is caused by one of the additional files I'm using in the plugin. Loading the resources when running the plugin works, only the test fails. I'm using java.util.ResourceBundle for this and the code looks like this

public class SymbolInformationProvider {

private final static String ourSymbolInformationFile = "/de/halirutan/mathematica/codeinsight/completion/symbolInformationV11_0_1";
private final static HashMap<String, SymbolInformation> ourSymbols;

private SymbolInformationProvider() {}

static {

ResourceBundle info = ResourceBundle.getBundle(ourSymbolInformationFile);
//...

What is the correct way of loading additional resources within Idea and how can I fix this problem?

Cheers
Patrick

1 comment
Comment actions Permalink

The solution to the problem is to use dots instead of the absolute location with slash

private final static String ourSymbolInformationFile = "de.halirutan.mathematica.codeinsight.completion.symbolInformationV11_0_1";
1

Please sign in to leave a comment.