testng,javafx Intellij在实例化类时发生了错误,无法公开< test类>可访问
我试图以编程方式拨打测试类,并在测试文档中关注讲师。当我在Eclipse中调用它时,它可以正常工作,但是当我切换到Intellij更方便地使用Javafx时,我可以制作一个UI程序,它不起作用并显示此错误。 这是我的测试呼叫课程
package com.vinh.testing.CallTest;
import org.testng.TestListenerAdapter;
import org.testng.TestNG;
import tests.LogOutTest;
public class TestLogOutCall {
public void callLogOutTest() {
TestListenerAdapter tla = new TestListenerAdapter();
TestNG testng = new TestNG();
testng.setTestClasses(new Class[] { LogOutTest.class });
testng.addListener(tla);
testng.run();
}
}
,这是我的测试课
package tests;
import static io.restassured.RestAssured.*;
import static org.testng.Assert.assertNotEquals;
import org.testng.annotations.Test;
import io.restassured.path.json.JsonPath;
import io.restassured.response.Response;
public class LogOutTest {
String ACCESS_TOKEN = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9hdWN0aW9uLWFwcDMuaGVyb2t1YXBwLmNvbVwvYXBpXC9sb2dpbiIsImlhdCI6MTY1NTUzNzg2OSwiZXhwIjoxNjU1ODk3ODY5LCJuYmYiOjE2NTU1Mzc4NjksImp0aSI6InJuejdrMHhSQmNUTHB2TnkiLCJzdWIiOjY1LCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.sX-pWrwDyGfCIhlqy_1huxTt3GSElXrQtnpKV53q4BM";
@Test
public void Test01() {
baseURI = "https://auction-app3.herokuapp.com/api";
Response response = given().
header("Authorization", "bearer" + ACCESS_TOKEN).
contentType("application/json").
when().
post("/logout");
response.then().statusCode(200);
System.out.println(response.getBody().asString());
JsonPath jpath = response.jsonPath();
int code = jpath.getInt("code");
System.out.println(code);
assertNotEquals(code, 1000);
}
}
,然后我遇到了
C:\Users\Lenovo\.jdks\openjdk-18.0.1.1\bin\java.exe "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1.1\lib\idea_rt.jar=50009:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1.1\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-controls\18\javafx-controls-18.jar;C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-graphics\18\javafx-graphics-18.jar;C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-base\18\javafx-base-18.jar;C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-fxml\18\javafx-fxml-18.jar;C:\Users\Lenovo\.m2\repository\org\apache\groovy\groovy\4.0.1\groovy-4.0.1.jar;C:\Users\Lenovo\.m2\repository\org\apache\groovy\groovy-xml\4.0.1\groovy-xml-4.0.1.jar;C:\Users\Lenovo\.m2\repository\org\apache\httpcomponents\httpclient\4.5.13\httpclient-4.5.13.jar;C:\Users\Lenovo\.m2\repository\org\apache\httpcomponents\httpcore\4.4.13\httpcore-4.4.13.jar;C:\Users\Lenovo\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\Users\Lenovo\.m2\repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar;C:\Users\Lenovo\.m2\repository\org\apache\httpcomponents\httpmime\4.5.13\httpmime-4.5.13.jar;C:\Users\Lenovo\.m2\repository\org\hamcrest\hamcrest\2.1\hamcrest-2.1.jar;C:\Users\Lenovo\.m2\repository\org\ccil\cowan\tagsoup\tagsoup\1.2.1\tagsoup-1.2.1.jar;C:\Users\Lenovo\.m2\repository\org\apache\groovy\groovy-json\4.0.1\groovy-json-4.0.1.jar;C:\Users\Lenovo\.m2\repository\io\rest-assured\rest-assured-common\5.1.1\rest-assured-common-5.1.1.jar;C:\Users\Lenovo\.m2\repository\io\rest-assured\xml-path\5.1.1\xml-path-5.1.1.jar;C:\Users\Lenovo\.m2\repository\xml-apis\xml-apis\1.4.01\xml-apis-1.4.01.jar;C:\Users\Lenovo\.m2\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar;C:\Users\Lenovo\.m2\repository\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;C:\Users\Lenovo\.m2\repository\com\beust\jcommander\1.82\jcommander-1.82.jar;C:\Users\Lenovo\.m2\repository\org\webjars\jquery\3.6.0\jquery-3.6.0.jar;C:\Users\Lenovo\.m2\repository\junit\junit\4.10\junit-4.10.jar;C:\Users\Lenovo\.m2\repository\org\hamcrest\hamcrest-core\1.1\hamcrest-core-1.1.jar -p D:\Testing\target\classes;C:\Users\Lenovo\.m2\repository\org\testng\testng\7.6.0\testng-7.6.0.jar;C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-base\18\javafx-base-18-win.jar;C:\Users\Lenovo\.m2\repository\org\apache\commons\commons-lang3\3.11\commons-lang3-3.11.jar;C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-fxml\18\javafx-fxml-18-win.jar;C:\Users\Lenovo\.m2\repository\io\rest-assured\json-path\5.1.1\json-path-5.1.1.jar;C:\Users\Lenovo\.m2\repository\io\rest-assured\rest-assured\5.1.1\rest-assured-5.1.1.jar;C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-graphics\18\javafx-graphics-18-win.jar;C:\Users\Lenovo\.m2\repository\com\googlecode\json-simple\json-simple\1.1.1\json-simple-1.1.1.jar;C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-controls\18\javafx-controls-18-win.jar;C:\Users\Lenovo\.m2\repository\org\controlsfx\controlsfx\11.1.1\controlsfx-11.1.1.jar -m com.vinh.testing/com.vinh.testing.AutomationTesting
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at javafx.fxml@18/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1857)
at javafx.fxml@18/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1724)
at javafx.base@18/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at javafx.base@18/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
at javafx.base@18/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at javafx.base@18/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at javafx.base@18/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at javafx.base@18/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base@18/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base@18/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base@18/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base@18/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base@18/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at javafx.base@18/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.base@18/javafx.event.Event.fireEvent(Event.java:198)
at javafx.graphics@18/javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3586)
at javafx.graphics@18/javafx.scene.Scene$MouseHandler.process(Scene.java:3890)
at javafx.graphics@18/javafx.scene.Scene.processMouseEvent(Scene.java:1874)
at javafx.graphics@18/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2607)
at javafx.graphics@18/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
at javafx.graphics@18/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at javafx.graphics@18/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
at javafx.graphics@18/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
at javafx.graphics@18/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
at javafx.graphics@18/com.sun.glass.ui.View.handleMouseEvent(View.java:551)
at javafx.graphics@18/com.sun.glass.ui.View.notifyMouse(View.java:937)
at javafx.graphics@18/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics@18/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:77)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at javafx.base@18/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:275)
at javafx.fxml@18/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:84)
at javafx.fxml@18/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1854)
... 29 more
Caused by: org.testng.TestNGException:
An error occurred while instantiating class tests.LoginTest: Unable to make public tests.LoginTest() accessible: module com.vinh.testing does not "exports tests" to module org.testng
at [email protected]/org.testng.internal.objects.SimpleObjectDispenser.createInstance(SimpleObjectDispenser.java:99)
at [email protected]/org.testng.internal.objects.SimpleObjectDispenser.dispense(SimpleObjectDispenser.java:40)
at [email protected]/org.testng.internal.objects.GuiceBasedObjectDispenser.dispense(GuiceBasedObjectDispenser.java:28)
at [email protected]/org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:106)
at [email protected]/org.testng.internal.ClassImpl.getInstances(ClassImpl.java:136)
at [email protected]/org.testng.TestClass.getInstances(TestClass.java:129)
at [email protected]/org.testng.TestClass.initTestClassesAndInstances(TestClass.java:109)
at [email protected]/org.testng.TestClass.init(TestClass.java:101)
at [email protected]/org.testng.TestClass.<init>(TestClass.java:66)
at [email protected]/org.testng.TestRunner.initMethods(TestRunner.java:463)
at [email protected]/org.testng.TestRunner.init(TestRunner.java:335)
at [email protected]/org.testng.TestRunner.init(TestRunner.java:288)
at [email protected]/org.testng.TestRunner.<init>(TestRunner.java:178)
at [email protected]/org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:639)
at [email protected]/org.testng.SuiteRunner.init(SuiteRunner.java:225)
at [email protected]/org.testng.SuiteRunner.<init>(SuiteRunner.java:115)
at [email protected]/org.testng.TestNG.createSuiteRunner(TestNG.java:1349)
at [email protected]/org.testng.TestNG.createSuiteRunners(TestNG.java:1325)
at [email protected]/org.testng.TestNG.runSuitesLocally(TestNG.java:1167)
at [email protected]/org.testng.TestNG.runSuites(TestNG.java:1099)
at [email protected]/org.testng.TestNG.run(TestNG.java:1067)
at com.vinh.testing/com.vinh.testing.CallTest.TestLoginCall.CallTestLogin(TestLoginCall.java:16)
at com.vinh.testing/com.vinh.testing.Controller.Test(Controller.java:63)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
... 36 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make public tests.LoginTest() accessible: module com.vinh.testing does not "exports tests" to module org.testng
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:191)
at java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:184)
at [email protected]/org.testng.internal.objects.SimpleObjectDispenser.instantiateUsingDefaultConstructor(SimpleObjectDispenser.java:177)
at [email protected]/org.testng.internal.objects.SimpleObjectDispenser.createInstance(SimpleObjectDispenser.java:87)
... 59 more
IM新的测试,请帮助我。
I tried to call the test class programmatically and follow the instructor in the TestNG docs. When i called it in Eclipse, it worked, but when i switch to Intellij to be more convenient to use JavaFX so that i can make a UI program, it doesn't work and show this error.
This is my test call class
package com.vinh.testing.CallTest;
import org.testng.TestListenerAdapter;
import org.testng.TestNG;
import tests.LogOutTest;
public class TestLogOutCall {
public void callLogOutTest() {
TestListenerAdapter tla = new TestListenerAdapter();
TestNG testng = new TestNG();
testng.setTestClasses(new Class[] { LogOutTest.class });
testng.addListener(tla);
testng.run();
}
}
and this is my test class
package tests;
import static io.restassured.RestAssured.*;
import static org.testng.Assert.assertNotEquals;
import org.testng.annotations.Test;
import io.restassured.path.json.JsonPath;
import io.restassured.response.Response;
public class LogOutTest {
String ACCESS_TOKEN = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9hdWN0aW9uLWFwcDMuaGVyb2t1YXBwLmNvbVwvYXBpXC9sb2dpbiIsImlhdCI6MTY1NTUzNzg2OSwiZXhwIjoxNjU1ODk3ODY5LCJuYmYiOjE2NTU1Mzc4NjksImp0aSI6InJuejdrMHhSQmNUTHB2TnkiLCJzdWIiOjY1LCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.sX-pWrwDyGfCIhlqy_1huxTt3GSElXrQtnpKV53q4BM";
@Test
public void Test01() {
baseURI = "https://auction-app3.herokuapp.com/api";
Response response = given().
header("Authorization", "bearer" + ACCESS_TOKEN).
contentType("application/json").
when().
post("/logout");
response.then().statusCode(200);
System.out.println(response.getBody().asString());
JsonPath jpath = response.jsonPath();
int code = jpath.getInt("code");
System.out.println(code);
assertNotEquals(code, 1000);
}
}
and then i met this
C:\Users\Lenovo\.jdks\openjdk-18.0.1.1\bin\java.exe "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1.1\lib\idea_rt.jar=50009:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1.1\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-controls\18\javafx-controls-18.jar;C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-graphics\18\javafx-graphics-18.jar;C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-base\18\javafx-base-18.jar;C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-fxml\18\javafx-fxml-18.jar;C:\Users\Lenovo\.m2\repository\org\apache\groovy\groovy\4.0.1\groovy-4.0.1.jar;C:\Users\Lenovo\.m2\repository\org\apache\groovy\groovy-xml\4.0.1\groovy-xml-4.0.1.jar;C:\Users\Lenovo\.m2\repository\org\apache\httpcomponents\httpclient\4.5.13\httpclient-4.5.13.jar;C:\Users\Lenovo\.m2\repository\org\apache\httpcomponents\httpcore\4.4.13\httpcore-4.4.13.jar;C:\Users\Lenovo\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\Users\Lenovo\.m2\repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar;C:\Users\Lenovo\.m2\repository\org\apache\httpcomponents\httpmime\4.5.13\httpmime-4.5.13.jar;C:\Users\Lenovo\.m2\repository\org\hamcrest\hamcrest\2.1\hamcrest-2.1.jar;C:\Users\Lenovo\.m2\repository\org\ccil\cowan\tagsoup\tagsoup\1.2.1\tagsoup-1.2.1.jar;C:\Users\Lenovo\.m2\repository\org\apache\groovy\groovy-json\4.0.1\groovy-json-4.0.1.jar;C:\Users\Lenovo\.m2\repository\io\rest-assured\rest-assured-common\5.1.1\rest-assured-common-5.1.1.jar;C:\Users\Lenovo\.m2\repository\io\rest-assured\xml-path\5.1.1\xml-path-5.1.1.jar;C:\Users\Lenovo\.m2\repository\xml-apis\xml-apis\1.4.01\xml-apis-1.4.01.jar;C:\Users\Lenovo\.m2\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar;C:\Users\Lenovo\.m2\repository\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;C:\Users\Lenovo\.m2\repository\com\beust\jcommander\1.82\jcommander-1.82.jar;C:\Users\Lenovo\.m2\repository\org\webjars\jquery\3.6.0\jquery-3.6.0.jar;C:\Users\Lenovo\.m2\repository\junit\junit\4.10\junit-4.10.jar;C:\Users\Lenovo\.m2\repository\org\hamcrest\hamcrest-core\1.1\hamcrest-core-1.1.jar -p D:\Testing\target\classes;C:\Users\Lenovo\.m2\repository\org\testng\testng\7.6.0\testng-7.6.0.jar;C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-base\18\javafx-base-18-win.jar;C:\Users\Lenovo\.m2\repository\org\apache\commons\commons-lang3\3.11\commons-lang3-3.11.jar;C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-fxml\18\javafx-fxml-18-win.jar;C:\Users\Lenovo\.m2\repository\io\rest-assured\json-path\5.1.1\json-path-5.1.1.jar;C:\Users\Lenovo\.m2\repository\io\rest-assured\rest-assured\5.1.1\rest-assured-5.1.1.jar;C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-graphics\18\javafx-graphics-18-win.jar;C:\Users\Lenovo\.m2\repository\com\googlecode\json-simple\json-simple\1.1.1\json-simple-1.1.1.jar;C:\Users\Lenovo\.m2\repository\org\openjfx\javafx-controls\18\javafx-controls-18-win.jar;C:\Users\Lenovo\.m2\repository\org\controlsfx\controlsfx\11.1.1\controlsfx-11.1.1.jar -m com.vinh.testing/com.vinh.testing.AutomationTesting
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at javafx.fxml@18/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1857)
at javafx.fxml@18/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1724)
at javafx.base@18/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at javafx.base@18/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
at javafx.base@18/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at javafx.base@18/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at javafx.base@18/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at javafx.base@18/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base@18/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base@18/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base@18/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base@18/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base@18/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at javafx.base@18/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.base@18/javafx.event.Event.fireEvent(Event.java:198)
at javafx.graphics@18/javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3586)
at javafx.graphics@18/javafx.scene.Scene$MouseHandler.process(Scene.java:3890)
at javafx.graphics@18/javafx.scene.Scene.processMouseEvent(Scene.java:1874)
at javafx.graphics@18/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2607)
at javafx.graphics@18/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
at javafx.graphics@18/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at javafx.graphics@18/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
at javafx.graphics@18/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
at javafx.graphics@18/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
at javafx.graphics@18/com.sun.glass.ui.View.handleMouseEvent(View.java:551)
at javafx.graphics@18/com.sun.glass.ui.View.notifyMouse(View.java:937)
at javafx.graphics@18/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics@18/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:77)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at javafx.base@18/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:275)
at javafx.fxml@18/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:84)
at javafx.fxml@18/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1854)
... 29 more
Caused by: org.testng.TestNGException:
An error occurred while instantiating class tests.LoginTest: Unable to make public tests.LoginTest() accessible: module com.vinh.testing does not "exports tests" to module org.testng
at [email protected]/org.testng.internal.objects.SimpleObjectDispenser.createInstance(SimpleObjectDispenser.java:99)
at [email protected]/org.testng.internal.objects.SimpleObjectDispenser.dispense(SimpleObjectDispenser.java:40)
at [email protected]/org.testng.internal.objects.GuiceBasedObjectDispenser.dispense(GuiceBasedObjectDispenser.java:28)
at [email protected]/org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:106)
at [email protected]/org.testng.internal.ClassImpl.getInstances(ClassImpl.java:136)
at [email protected]/org.testng.TestClass.getInstances(TestClass.java:129)
at [email protected]/org.testng.TestClass.initTestClassesAndInstances(TestClass.java:109)
at [email protected]/org.testng.TestClass.init(TestClass.java:101)
at [email protected]/org.testng.TestClass.<init>(TestClass.java:66)
at [email protected]/org.testng.TestRunner.initMethods(TestRunner.java:463)
at [email protected]/org.testng.TestRunner.init(TestRunner.java:335)
at [email protected]/org.testng.TestRunner.init(TestRunner.java:288)
at [email protected]/org.testng.TestRunner.<init>(TestRunner.java:178)
at [email protected]/org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:639)
at [email protected]/org.testng.SuiteRunner.init(SuiteRunner.java:225)
at [email protected]/org.testng.SuiteRunner.<init>(SuiteRunner.java:115)
at [email protected]/org.testng.TestNG.createSuiteRunner(TestNG.java:1349)
at [email protected]/org.testng.TestNG.createSuiteRunners(TestNG.java:1325)
at [email protected]/org.testng.TestNG.runSuitesLocally(TestNG.java:1167)
at [email protected]/org.testng.TestNG.runSuites(TestNG.java:1099)
at [email protected]/org.testng.TestNG.run(TestNG.java:1067)
at com.vinh.testing/com.vinh.testing.CallTest.TestLoginCall.CallTestLogin(TestLoginCall.java:16)
at com.vinh.testing/com.vinh.testing.Controller.Test(Controller.java:63)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
... 36 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make public tests.LoginTest() accessible: module com.vinh.testing does not "exports tests" to module org.testng
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:191)
at java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:184)
at [email protected]/org.testng.internal.objects.SimpleObjectDispenser.instantiateUsingDefaultConstructor(SimpleObjectDispenser.java:177)
at [email protected]/org.testng.internal.objects.SimpleObjectDispenser.createInstance(SimpleObjectDispenser.java:87)
... 59 more
Im new to TestNG, pls help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论