gpt4 book ai didi

java - SoapUI maven执行结果NoClassDefFoundError : com/jniwrapper/PlatformContext

转载 作者:行者123 更新时间:2023-12-02 11:39:31 30 4
gpt4 key购买 nike

我正在运行 Junit 的 SOAP UI 测试用例,它是 Java-Maven 项目。当我点击命令 mvn clean test 时,出现以下错误

15:49:44,469 ERROR [AbstractTestRunner] Exception during Test Execution
java.lang.NoClassDefFoundError: com/jniwrapper/PlatformContext
at com.eviware.soapui.SoapUI.isJXBrowserDisabled(SoapUI.java:1025)
at com.eviware.soapui.SoapUI.isJXBrowserDisabled(SoapUI.java:1006)
at com.eviware.soapui.impl.wsdl.submit.filters.HttpAuthenticationRequestFilter.filterAbstractHttpRequest(HttpAuthenticationRequestFilter.java:83)
at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterRequest(AbstractRequestFilter.java:31)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:179)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:76)
at com.eviware.soapui.impl.wsdl.WsdlRequest.submit(WsdlRequest.java:238)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.run(WsdlTestRequestStep.java:417)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:235)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:148)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:43)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:77)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:640)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:73)
at learn.TestCaseTwo.testRunnerFive(TestCaseTwo.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:77)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:110)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

下面是我的 pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>net.wu.web</groupId>
<artifactId>bddcucumber</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<skipITTests>false</skipITTests>
<geb.version>0.10.0</geb.version>
<selenium.version>2.52.0</selenium.version>
<groovy.version>2.3.6</groovy.version>
<spock.version>0.7-groovy-2.0</spock.version>
<gson.version>2.3.1</gson.version>
<httpclient.version>4.3.4</httpclient.version>
<httpcore.version>4.3.2</httpcore.version>
<surefire.plugin.version>2.12.4</surefire.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<repositories>
<repository>
<id>soapUI</id>
<name>eviware</name>
<url>http://smartbearsoftware.com/repository/maven2/</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>eviwarePluginRepository</id>
<url>http://smartbearsoftware.com/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>

<dependencies>


<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>

<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.11</version>
<scope>test</scope>
</dependency>



<dependency>
<groupId>fife</groupId>
<artifactId>rsyntaxtextarea</artifactId>
<version>2.0.1</version>
</dependency>

<!--Reference URL : https://stackoverflow.com/questions/22908086/how-to-run-soapui-tests-from-java-resolved -->
<dependency>
<groupId>com.github.redfish4ktc.soapui</groupId>
<artifactId>maven-soapui-extension-plugin</artifactId>
<version>4.6.4.0</version>
</dependency>

<dependency>
<groupId>net.java.dev.jgoodies</groupId>
<artifactId>looks</artifactId>
<version>2.1.4</version>
</dependency>
<dependency>
<groupId>net.sf.squirrel-sql.thirdparty-non-maven</groupId>
<artifactId>com-fifesoft-rsyntaxtextarea</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.karaf.eik.plugins</groupId>
<artifactId>org.apache.commons.collections</artifactId>
<version>3.2.1</version>
</dependency>


</dependencies>



<build>
<plugins>


<!-- Maven Surefire plugin-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.plugin.version}</version>
</plugin>


<plugin>
<!--<groupId>eviware</groupId>-->
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-pro-maven-plugin</artifactId>
<version>5.1.2</version>
<configuration>

<outputFolder>${basedir}/target/surefire-reports</outputFolder>
<junitReport>true</junitReport>
<printReport>true</printReport>

</configuration>

</plugin>

</plugins>

</build>

下面是我的测试用例。

public class TestCaseTwo {

WsdlProjectPro project = new WsdlProjectPro("src\\test\\resources\\SOAP\\Spain_KYC_CS_Sanity-soapui-project.xml");
TestSuite testSuite;
TestCase testCase;
TestRunner testRunner;

@Test
public void testRunnerOne(){
testSuite = project.getTestSuiteByName("Registration");
testCase = testSuite.getTestCaseByName("Registar a new D Type user");

testRunner = testCase.run(new PropertiesMap(),false);
Assert.assertEquals(testRunner.getStatus(), TestRunner.Status.FINISHED);
}
}

你能帮我删除这个错误:java.lang.NoClassDefFoundError: com/jniwrapper/PlatformContext

最佳答案

添加系统参数 soapui.jxbrowser.disable 并将值设置为 true

例如在maven的命令行中添加

mvn clean -Dsoapui.jxbrowser.disable=true

关于java - SoapUI maven执行结果NoClassDefFoundError : com/jniwrapper/PlatformContext,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48683370/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com