From: wisberg Date: Mon, 5 May 2003 15:09:33 +0000 (+0000) Subject: fix test - NPE Guard, canonicalize file input X-Git-Tag: V1_1_0_RC2~76 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=721f2c00b04706d82c8abd0cb292b1dddfea89f1;p=aspectj.git fix test - NPE Guard, canonicalize file input --- diff --git a/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java b/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java index 625990e3a..fedc151be 100644 --- a/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java +++ b/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java @@ -113,10 +113,11 @@ public class StructureModelTest extends AjdeTestCase { * @todo add negative test to make sure things that aren't runnable aren't annotated */ public void testMainClassNodeInfo() throws IOException { - assertTrue("root exists", Ajde.getDefault().getStructureModelManager().getStructureModel().getRoot() != null); - File testFile = createFile("figures-coverage/figures/Main.java"); - StructureNode node = Ajde.getDefault().getStructureModelManager().getStructureModel().findNodeForSourceLine( - testFile.getAbsolutePath(), 11); + StructureModel model = Ajde.getDefault().getStructureModelManager().getStructureModel(); + assertTrue("model exists", model != null); + assertTrue("root exists", model.getRoot() != null); + File testFile = createFile("figures-coverage/figures/Main.java"); + StructureNode node = model.findNodeForSourceLine(testFile.getCanonicalPath(), 11); assertTrue("find result", node != null);