Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/366.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 JUnit5动态测试_Java_Junit5 - Fatal编程技术网

Java JUnit5动态测试

Java JUnit5动态测试,java,junit5,Java,Junit5,我犯了这个错误 XQTest.lambda$null$0:51 » NoClassDefFound Could not initialize class weblogic.... java.lang.NoClassDefFoundError: Could not initialize class weblogic.xml.query.parsers.StAXFactoryHelper 这是我的测试: @TestFactory public Stream<DynamicTest> X

我犯了这个错误

XQTest.lambda$null$0:51 » NoClassDefFound Could not initialize class weblogic....
java.lang.NoClassDefFoundError: Could not initialize class weblogic.xml.query.parsers.StAXFactoryHelper
这是我的测试:

@TestFactory
public Stream<DynamicTest> XQueryDynamicTestsFromStream() throws IOException {
    ArrayList<Tuple4> tuple4 = buildTest.buildTestFromResources();

    System.out.println("TEST");


    return tuple4.stream()
                 .map(phrs ->
                      DynamicTest.dynamicTest(
                          "Test XQuery: (" + phrs.a.substring(phrs.a.lastIndexOf("\\") + 1) + ")"
                          , () -> {
                              int idx = tuple4.indexOf(phrs);
                              String transformer = tuple4.get(idx).a;
                              String testPath = tuple4.get(idx).b;
                              String inpFile = tuple4.get(idx).c;
                              String expFile = tuple4.get(idx).d;

                              XQueryTester tester = new XQueryTester(transformer, testPath);

                              if (inpFile.contains("HDR")) {
                                  assertTrue(tester.testHeader(inpFile, expFile));
                              } else if (inpFile.contains("PAY")) {
                                  causing error->assertTrue(tester.testBody(inpFile, expFile));
                              }


                          }
                      )
                 );
}
@TestFactory
公共流XQueryDynamicTestsFromStream()引发IOException{
ArrayList tuple4=buildTest.buildTestFromResources();
系统输出打印(“测试”);
返回tuple4.stream()
.map(phrs->
动态测试,动态测试(
测试XQuery:(“+phrs.a.substring(phrs.a.lastIndexOf(“\\”)+1)+”
, () -> {
int idx=tuple4.indexOf(phrs);
字符串转换器=tuple4.get(idx).a;
字符串testPath=tuple4.get(idx.b);
字符串inpFile=tuple4.get(idx.c);
字符串expFile=tuple4.get(idx.d);
XQueryTester=新的XQueryTester(变压器、测试路径);
if(inpFile.contains(“HDR”)){
assertTrue(tester.testHeader(inpFile,expFile));
}else if(inpFile.contains(“PAY”)){
导致错误->assertTrue(tester.testBody(inpFile,expFile));
}
}
)
);
}
仅供参考:我正在测试XQuery,因此编写了自己的引擎
XQueryTester
,我将其实例化为
“tester”


根据我使用
XQueryTest(buildTest)
搜索的文件,我正在运行一个头或负载测试。

看起来像是包含
weblogic.xml.query.parsers.statxFactoryHelper的JAR在测试运行时不在类路径上。如果是这样的话,这与JUnit无关。看起来包含
weblogic.xml.query.parsers.StatxFactoryHelper
的JAR在测试运行时不在类路径上。如果是这样,这与JUnit无关。