private void loadParser() { try { parser = ProparseLdr.getInstance(); } catch (Throwable e) { fail("Failed to load proparse.dll"); } }
/** Test NoundoWrap.run() */ public void testNoUndo() { String testFile = "data/no-undo.p"; String outDir = "tmp"; parser.configSet("show-proparse-directives", "true"); // We look to the project settings for whether cap keywords are used. // Determines "NO-UNDO" vs. "no-undo". RefactorSession refPack = RefactorSession.getInstance(); try { refPack.loadProject("unittest"); } catch (Exception e) { fail("Failed to load project settings: " + e.getMessage()); } NoundoWrap wrap = new NoundoWrap(outDir); String retVal = wrap.run(testFile); if (retVal != null) assertEquals("", retVal); parserErrCheck(); String outFile = FileStuff.prepareTarget(outDir, testFile); assertEquals("", parser.diff("data/no-undo.expect.p", outFile)); } // testNoUndo()
private void parserErrCheck() { if (parser.errorGetStatus() != 0) fail(parser.errorGetText()); }