diff options
author | aclement <aclement> | 2004-08-16 16:44:13 +0000 |
---|---|---|
committer | aclement <aclement> | 2004-08-16 16:44:13 +0000 |
commit | eb1d697f95742d25109b1d285db38da40464b340 (patch) | |
tree | 9a972366a4289ab721a235245c49c3b777b93cba /ajde/testsrc | |
parent | 6b1ef0ff7cfd1dbb985993fd5486c9ddf31b280d (diff) | |
download | aspectj-eb1d697f95742d25109b1d285db38da40464b340.tar.gz aspectj-eb1d697f95742d25109b1d285db38da40464b340.zip |
Fix for Bugzilla Bug 72016: No problem type information from AspectJ compiler / AJDE
Diffstat (limited to 'ajde/testsrc')
-rw-r--r-- | ajde/testsrc/org/aspectj/ajde/AjdeTests.java | 1 | ||||
-rw-r--r-- | ajde/testsrc/org/aspectj/ajde/ExtensionTests.java | 55 |
2 files changed, 56 insertions, 0 deletions
diff --git a/ajde/testsrc/org/aspectj/ajde/AjdeTests.java b/ajde/testsrc/org/aspectj/ajde/AjdeTests.java index a2155fd9b..924ff6cbb 100644 --- a/ajde/testsrc/org/aspectj/ajde/AjdeTests.java +++ b/ajde/testsrc/org/aspectj/ajde/AjdeTests.java @@ -39,6 +39,7 @@ public class AjdeTests extends TestCase { suite.addTestSuite(JarManifestTest.class); suite.addTestSuite(DuplicateManifestTest.class); suite.addTestSuite(ShowWeaveMessagesTestCase.class); + suite.addTestSuite(ExtensionTests.class); //$JUnit-END$ return suite; diff --git a/ajde/testsrc/org/aspectj/ajde/ExtensionTests.java b/ajde/testsrc/org/aspectj/ajde/ExtensionTests.java new file mode 100644 index 000000000..d4659e3a8 --- /dev/null +++ b/ajde/testsrc/org/aspectj/ajde/ExtensionTests.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * Matthew Webster - initial implementation + *******************************************************************************/ +package org.aspectj.ajde; + +import java.util.List; +import java.io.File; + +import org.aspectj.bridge.IMessage; +import org.aspectj.tools.ajc.AjcTestCase; +import org.aspectj.tools.ajc.CompilationResult; +import org.eclipse.jdt.core.compiler.IProblem; + +/** + * Tests the 'extensions' to AJDE: + * 1) ID is now available on messages to allow you to see what 'kind' of + * message it is - this activates quick fixes/etc in Eclipse. + */ +public class ExtensionTests extends AjcTestCase { + + public static final String PROJECT_DIR = "extensions"; + + private File baseDir; + + protected void setUp() throws Exception { + super.setUp(); + baseDir = new File("../ajde/testdata",PROJECT_DIR); + } + + /** + * Aim: Check that the ID of certain message kinds are correct + * + * ajc -warn:unusedImport UnusedImport.java + * + * Expected result = id + */ + public void testOutjarInInjars () { + String[] args = new String[] {"UnusedImport.java","-warn:unusedImport"}; + CompilationResult result = ajc(baseDir,args); + List l = result.getWarningMessages(); + IMessage m = ((IMessage)l.get(0)); + assertTrue("Expected ID of message to be "+IProblem.UnusedImport+" (UnusedImport) but found an ID of "+m.getID(), + m.getID()==IProblem.UnusedImport); + } + + + +} |