DefaultInterpreter implements SoarCommandInterpreter { @Override public void source(File file) throws SoarException { sourceCommand.source(file.getAbsolutePath()); } DefaultInterpreter(Agent agent); @Override void addCommand(String name, SoarCommand handler); SoarCommand getCommand(String name, SourceLocation srcLoc); ParsedCommand getParsedCommand(String name, SourceLocation srcLoc); @Override String getName(); @Override void dispose(); @Override String eval(String code); @Override void source(File file); @Override void source(URL url); @Override void loadRete(File file); @Override void loadRete(URL url); @Override void saveRete(File file); @Override String getWorkingDirectory(); @Override String[] getCompletionList(String command, int cursorPosition); @Override Collection<String> getSourcedFiles(); Set<String> getAliasStrings(); SoarCommand getCommand(String s); @Override List<String> getCommandStrings(); @Override SoarExceptionsManager getExceptionsManager();  }
@Test public void testCanLoadRelativePathInJar() throws Exception { String path = getClass().getResource("test.jar").toExternalForm(); String inputFile = "jar:" + path + "!/test.soar"; URL url = new URL(inputFile); SoarCommands.source(agent.getInterpreter(), url ); assertTrue("Expected a rule to be loaded", agent.getProductions().getProductionCount() == 1); }