문제

When interpreting a .java source file, in this case a JUnit test suite with the following declaration in it:

@RunWith(Suite.class)
@SuiteClasses({ MiamiAForm.class })

Why does Beanshell (version 1.3 and also 2.1b5) choke on those characters?

Evaluation Error: Sourced file: com\co\tests\TestSuite.java 
Token Parsing Error: Lexical error at line 16, column 10.  
Encountered: "B" (66), after : "@": <at unknown location>
도움이 되었습니까?

해결책

Because beanshell does not parse the syntax for some java 1.5 features. See Issue 24: Support of java 1.5 lang features (generics, enum, annotations), still open. Generics are now (partially) supported, but enums and annotations are not.

So it seems like it's not possible to run JUnit 4 tests under beanshell. Try Groovy, if you really don't want to compile them.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top