Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 为什么Beanshell在'@';源文件中的字符?_Java_Junit_Automated Tests_Beanshell - Fatal编程技术网

Java 为什么Beanshell在'@';源文件中的字符?

Java 为什么Beanshell在'@';源文件中的字符?,java,junit,automated-tests,beanshell,Java,Junit,Automated Tests,Beanshell,在解释.java源文件时,在本例中是一个JUnit测试套件,其中包含以下声明: @RunWith(Suite.class) @SuiteClasses({ MiamiAForm.class }) 为什么Beanshell(1.3版和2.1b5版)会被这些角色扼杀 Evaluation Error: Sourced file: com\co\tests\TestSuite.java Token Parsing Error: Lexical error at line 16, column 10

在解释.java源文件时,在本例中是一个JUnit测试套件,其中包含以下声明:

@RunWith(Suite.class)
@SuiteClasses({ MiamiAForm.class })
为什么Beanshell(1.3版和2.1b5版)会被这些角色扼杀

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>
评估错误:源文件:com\co\tests\TestSuite.java
令牌解析错误:第16行第10列的词法错误。
遇到:“@”之后的“B”(66):

因为beanshell不解析某些java 1.5功能的语法。看,还开着。现在(部分)支持泛型,但不支持枚举和注释

因此,似乎不可能在beanshell下运行JUnit4测试。如果您真的不想编译它们,请尝试Groovy