Community
Participate
Working Groups
The adjt "enhanced" build configuration management is not compatible with the junit-runner. When tests are excluded (via the aspejctj context menu actions) the junit-runner still searches for them, throwing either ClassNotFound exceptions or NullPointException from its internal code. There seems to be no workaround. The adjt configuraiton cannot exclude the tests, yet adjt has disabled the standard java nature method of exluding files from the build path.
Barry, Please could you expand on the steps necessary to reproduce this. If I exclude a test, I see that I can still select Run As > JUnit test on it, which I shouldn't be able to do. So that is a bug, but a minor one, as it involves explicitly trying to run an excluded test, something you wouldn't normally do. However your description makes the problem sound more serious. If you want to exclude a test, can you not just remove it from the JUnit test suite?
I don't use explicit suites. I let the junit plugin search for them since I am either running just the one test I'm working on, or running all tests. So I tend to setup a junit run target for an entire directory or project. For most projects I have only two targets: one that runs all unit-tests (in directory utest) and one that runs all functional tests (in directory ftest). So to reproduce: Create a junit run target with the "run all tests in selected project..." selected. Exclude a [failing] test. And run. (I admit that I have not tested this just now as I describe it. But this is how the problem surfaced when I reported it.) (Maybe off topic, maybe not: Why does the aspectj nature need to change the default java behavior for excludes? Only to get around limitations with the compiler?)
I see the problem now - I didn't know you could do that (we always use test suites). Your comment about having different behaviour to JDT is very much on topic here. The reasons for this are partly historical: AJDT added support for direct manipulation of the build path from context menus in the package explorer and named build configurations files, at a time when JDT supported neither. As of Eclipse 3.1, JDT now supports the first capability via a new Build Path entry on the context menu. But it still doesn't support the second, which is of particular importance to AspectJ projects, as it allows the creation of multiple build configurations with and without certain aspects, so you can create a debug configuration etc. Longer term (in the Eclipse 3.2 timeframe) we hope to persuade JDT to add support for named configurations, at which point we can take out the AJDT support, and problems such as this will go away. It would be difficult to do anything about this on Eclipse 3.0 because of the missing JDT function there, so I'm going to target this for the Eclipse 3.1 release (AJDT 1.3). The best we could hope for there would be to switch to JDT's include/exclude mechanism, and re-implement the named configuration support on top of that (and then contribute that support to JDT if they want it).
All fine by me. I use only 3.1 in any case. And will almost certainly move to 3.2.Mx as soon as I can. Thanks.
The results of my investigations are not great - JDT's include/exclude mechanism cannot operate on .aj files, so it is not possible to address this for AJDT 1.3 on Eclipse 3.1. We are pushing hard to progress this in the Eclipse 3.2 timeframe. It is part of many changes which together will bring a great deal of benefit to AJDT. Relevant JDT bugs include: 115067 - add getJavaLikeExtensions style API to JDT/Core 89977 - make JDT/UI cope with compilation units with non-.java extensions 71460 - associate Java contents with non *.java files 36939 - Improve support for Java-like source files
Fixed in 1.4.0.20060219125111 for Eclipse 3.2M5. AJDT now uses the JDT include/exclude mechanism, so excluded tests really are excluded. See the new features page for more info: http://www.eclipse.org/ajdt/newfeatures/
Very sweet Matt. Thanks much!