[Bluej-discuss] bluej and user defined annotations

Davin McCall davmac at bluej.org
Thu Sep 27 04:10:11 BST 2007


Ok, but what is the package hierarchy as BlueJ sees it? Refer to my 
previous email... your project should have multiple packages. If not, 
you may have created it incorrectly.

(Speaking of which, when you say you did "import non-BlueJ", did you 
mean "open non-BlueJ" or "import"?)

Davin


Aryeh Friedman wrote:
> Here is the physical layout of the dev.utest.core dir (all of them are
> declared as that package):
>
> Assert.java             TestCase.java           TestException.java
> Result.java             TestEvent.java          TestSet.java
> Settings.java           TestEventListener.java  TestSuite.java
> Test.java               TestEventType.java      TestType.java
>
> Note I created the project by doing import non-bluej.
>
> --Aryeh
>
> On 9/27/07, Davin McCall <davmac at bluej.org> wrote:
>   
>> Hi,
>>
>> Could it be that you have created a BlueJ project without the
>> appropriate package hierarchy? That is, that you have a project with
>> this TestCase annotation inside it, but it's not inside a package
>> dev.utest.core (although it's declared to be)? This would mightily
>> confuse the compiler. (To clarify, inside your project's "unnamed"
>> package there should be a "dev" sub-package, and inside that there
>> should be a "utest" sub-package, with a "core" sub-package inside that,
>> which should contain the TestCase interface).
>>
>> If that's not the issue, then I guess the next obvious question is:
>> where is TestType actually defined?
>>
>> Davin
>>
>>
>>
>> Aryeh Friedman wrote:
>>     
>>> The following code compiles and works just fine from the command line
>>> but blows up when compiled with BlueJ:
>>>
>>> package dev.utest.core;
>>>
>>> import java.lang.annotation.Retention;
>>> import java.lang.annotation.RetentionPolicy;
>>>
>>> /**
>>>  * Mark a method as being a test case
>>>  *
>>>  * @author Aryeh M. Friedman
>>>  */
>>> @Retention(RetentionPolicy.RUNTIME)
>>> public @interface TestCase
>>> {
>>>       TestType value() default TestType.All;    // can not find symbol -- TestType
>>> }
>>>
>>> There are two possibilities I can think of:
>>>
>>> 1. I use a jvm wrapper (external to BlueJ) and had rewrote the bluej
>>> startup script to use it instead of the jvm selected at install time
>>> (I have 1.4, 1.5 and 1.6 all installed)
>>>
>>> 2. BlueJ has issues with the code
>>>
>>> My normal command line is:
>>>
>>> javac -d ~plos/obj *.java
>>>
>>> (CLASSPATH is ~plos/obj)
>>>       
>   



More information about the bluej-discuss mailing list