이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 13. Testing the native executable
Test the application running in the native mode to test the functionality of the native executable. Use @NativeImageTest annotation to build the native executable and run test against the http endpoints.
Procedure
Open the
pom.xmlfile and verify that thenativeprofile contains the following elements:Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
failsafe-maven-pluginruns integration test and indicates the location of the produced native executable.Open the
src/test/java/org/acme/quickstart/NativeGreetingResourceIT.javafile and verify that it includes the following content:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the test:
./mvnw verify -Pnative
./mvnw verify -PnativeCopy to Clipboard Copied! Toggle word wrap Toggle overflow The following example shows the output of this command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteQuarkus waits for 60 seconds for the native image to start before automatically failing the native tests. You can change this duration using the
quarkus.test.native-image-wait-timesystem property.You can extend the wait time using the following command where
<duration>is the wait time in seconds:./mvnw verify -Pnative -Dquarkus.test.native-image-wait-time=<duration>
./mvnw verify -Pnative -Dquarkus.test.native-image-wait-time=<duration>Copy to Clipboard Copied! Toggle word wrap Toggle overflow