summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten <mkersten>2003-08-07 08:10:01 +0000
committermkersten <mkersten>2003-08-07 08:10:01 +0000
commitacdf688ccc4d8b376141b2c8e28bc5d7b7612e90 (patch)
tree45af0dc8461e8cb89504bb9bc43fa911c16df1f5
parent7b6fd547894bfbfbebc0c679be931a235a468512 (diff)
downloadaspectj-acdf688ccc4d8b376141b2c8e28bc5d7b7612e90.tar.gz
aspectj-acdf688ccc4d8b376141b2c8e28bc5d7b7612e90.zip
Fixed
- 40257: parsing of "../" paths in LST files is broken Added interactive test for checking compiler task list messages (via browser).
-rw-r--r--ajbrowser/testsrc/org/aspectj/tools/ajbrowser/InteractiveBrowserTest.java (renamed from ajbrowser/testsrc/org/aspectj/tools/ajbrowser/BrowserManagerTest.java)15
-rw-r--r--ajde/src/org/aspectj/ajde/ui/swing/CompilerMessagesCellRenderer.java2
-rw-r--r--org.aspectj.ajdt.core/testdata/bug-40257/d1/A.java6
-rw-r--r--org.aspectj.ajdt.core/testdata/bug-40257/d1/d2/B.java3
-rw-r--r--org.aspectj.ajdt.core/testdata/bug-40257/d1/test.lst3
-rw-r--r--org.aspectj.ajdt.core/testdata/bug-40257/d3/C.java3
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtAjcTests.java2
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java35
8 files changed, 50 insertions, 19 deletions
diff --git a/ajbrowser/testsrc/org/aspectj/tools/ajbrowser/BrowserManagerTest.java b/ajbrowser/testsrc/org/aspectj/tools/ajbrowser/InteractiveBrowserTest.java
index 4c14046b2..021533ed1 100644
--- a/ajbrowser/testsrc/org/aspectj/tools/ajbrowser/BrowserManagerTest.java
+++ b/ajbrowser/testsrc/org/aspectj/tools/ajbrowser/InteractiveBrowserTest.java
@@ -25,15 +25,15 @@ import org.aspectj.ajde.*;
/**
* @author Mik Kersten
*/
-public class BrowserManagerTest extends TestCase {
+public class InteractiveBrowserTest extends TestCase {
- public BrowserManagerTest(String name) {
+ public InteractiveBrowserTest(String name) {
super(name);
}
public static TestSuite suite() {
TestSuite result = new TestSuite();
- result.addTestSuite(BrowserManagerTest.class);
+ result.addTestSuite(InteractiveBrowserTest.class);
return result;
}
@@ -49,16 +49,19 @@ public class BrowserManagerTest extends TestCase {
"project-level task",
IMessage.ERROR);
+ BrowserManager.getDefault().showMessages();
+
assertTrue("confirmation result", verifySuccess("Project task is visible."));
}
public void testAddSourceLineTasks() {
BrowserManager.getDefault().init(new String[]{}, true);
- ISourceLocation dummyLocation = new SourceLocation(new File("<file>"), -1, -1);
+ ISourceLocation dummyLocation = new SourceLocation(new File("<file>"), 0, 0);
+
Ajde.getDefault().getTaskListManager().addSourcelineTask(
"error task",
dummyLocation,
- IMessage.ERROR);
+ IMessage.ERROR);
Ajde.getDefault().getTaskListManager().addSourcelineTask(
"warning task",
@@ -69,6 +72,8 @@ public class BrowserManagerTest extends TestCase {
"info task",
dummyLocation,
IMessage.INFO);
+
+ BrowserManager.getDefault().showMessages();
assertTrue("confirmation result", verifySuccess("3 kinds of sourceline tasks are visible."));
}
diff --git a/ajde/src/org/aspectj/ajde/ui/swing/CompilerMessagesCellRenderer.java b/ajde/src/org/aspectj/ajde/ui/swing/CompilerMessagesCellRenderer.java
index 9476f3b4e..be0ec1376 100644
--- a/ajde/src/org/aspectj/ajde/ui/swing/CompilerMessagesCellRenderer.java
+++ b/ajde/src/org/aspectj/ajde/ui/swing/CompilerMessagesCellRenderer.java
@@ -57,7 +57,7 @@ public class CompilerMessagesCellRenderer extends JLabel implements ListCellRend
} else if (IMessage.ERROR.isSameOrLessThan(kind)) {
setIcon(AjdeUIManager.getDefault().getIconRegistry().getErrorIcon());
} else {
- setIcon(null);
+ setIcon(AjdeUIManager.getDefault().getIconRegistry().getInfoIcon());
}
if (isSelected) {
setBackground(list.getSelectionBackground());
diff --git a/org.aspectj.ajdt.core/testdata/bug-40257/d1/A.java b/org.aspectj.ajdt.core/testdata/bug-40257/d1/A.java
new file mode 100644
index 000000000..d5fbbefd3
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/bug-40257/d1/A.java
@@ -0,0 +1,6 @@
+
+package d1;
+
+public class A {
+
+}
diff --git a/org.aspectj.ajdt.core/testdata/bug-40257/d1/d2/B.java b/org.aspectj.ajdt.core/testdata/bug-40257/d1/d2/B.java
new file mode 100644
index 000000000..d419b8fd5
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/bug-40257/d1/d2/B.java
@@ -0,0 +1,3 @@
+package d1.d2;
+
+class B { } \ No newline at end of file
diff --git a/org.aspectj.ajdt.core/testdata/bug-40257/d1/test.lst b/org.aspectj.ajdt.core/testdata/bug-40257/d1/test.lst
new file mode 100644
index 000000000..2091b5b30
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/bug-40257/d1/test.lst
@@ -0,0 +1,3 @@
+A.java
+d2/B.java
+../d3/C.java
diff --git a/org.aspectj.ajdt.core/testdata/bug-40257/d3/C.java b/org.aspectj.ajdt.core/testdata/bug-40257/d3/C.java
new file mode 100644
index 000000000..6729096d4
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/bug-40257/d3/C.java
@@ -0,0 +1,3 @@
+package d3;
+
+class C { } \ No newline at end of file
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtAjcTests.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtAjcTests.java
index ef1612750..777eec89a 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtAjcTests.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtAjcTests.java
@@ -25,7 +25,7 @@ public class AjdtAjcTests extends TestCase {
suite.addTestSuite(BuildArgParserTestCase.class);
suite.addTestSuite(ConsoleMessageHandlerTestCase.class);
//$JUnit-END$
- return suite;
+ return suite;
}
public AjdtAjcTests(String name) { super(name); }
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java
index a340565a6..7ce74846a 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java
@@ -12,23 +12,17 @@
package org.aspectj.ajdt.ajc;
-import org.aspectj.ajdt.internal.core.builder.AjBuildConfig;
-import org.aspectj.ajdt.internal.core.builder.AjCompilerOptions;
+import java.io.*;
+import java.util.*;
+
+import junit.framework.TestCase;
+
+import org.aspectj.ajdt.internal.core.builder.*;
import org.aspectj.bridge.MessageWriter;
import org.aspectj.testing.util.TestUtil;
import org.eclipse.jdt.core.compiler.InvalidInputException;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import junit.framework.TestCase;
-
/**
* Some black-box test is happening here.
*/
@@ -328,6 +322,23 @@ public class BuildArgParserTestCase extends TestCase {
assertEquals(outputDir.getPath(), OUT_PATH);
}
+ public void testNonExistentConfigFile() throws IOException {
+ String FILE_PATH = "@" + TEST_DIR + "../bug-40257/d1/test.lst";
+ AjBuildConfig config = parser.genBuildConfig(new String[] { FILE_PATH }, messageWriter);
+
+ String a = new File(TEST_DIR + "../bug-40257/d1/A.java").getCanonicalPath();
+ String b = new File(TEST_DIR + "../bug-40257/d1/d2/B.java").getCanonicalPath();
+ String c = new File(TEST_DIR + "../bug-40257/d3/C.java").getCanonicalPath();
+ List pathList = new ArrayList();
+ for (Iterator it = config.getFiles().iterator(); it.hasNext(); ) {
+ pathList.add(((File)it.next()).getCanonicalPath());
+ }
+ assertTrue(pathList.contains(a));
+ assertTrue(pathList.contains(b));
+ assertTrue(pathList.contains(c));
+
+ }
+
public void testXlint() throws InvalidInputException {
AjdtCommand command = new AjdtCommand();
AjBuildConfig config = parser.genBuildConfig(new String[] {"-Xlint"}, messageWriter);