How to intercept log messages from Quarkus/Camel for testing purposes? - testing

I'm building a Java application with Quarkus/Camel which generates some logstatements here and there. I want to be able to verify if the correct logstatements are generated so I have a need to intercept the logmessages. The problem is that I have a logtemplate specified in the Quarkus application.properties file, but this template is not used when running tests. As a result, I cannot verify the correctness of the logstatements.
I have tried to copy the logtemplate to the testbranch but it is nog picked up by Quarkus. Does somebody know how I can pursuade my tests to use the proper logtemplate?

Related

web.show_document uses different base url when used from java webstart

Forms 12.2.1.4. Using web.show_document I see different behavior when running the Forms using Java Plugin (JPI) or using Java Webstart (JWS).
Same form, when run using JPI, web.show_document tries to open: http://server:port/forms/ + (uri you send in web.show_document ('uri').
That same form, when run using JWS, tries to open: http://server:port/forms/java/ + (uri you send in web.show_document('uri')
So:
1.- JWS uses as base url http://server:port/forms/java, while JPI http://server:port/forms/
Do you know the reason? I have a testcase and reproduce internally....I see no differences in configuration between JPI and JWS config.
2.- Another option to solve this could be use a different web.show_document call depending on wheter form is being run using JPI or JWS..... Is there a way to check at runtime if forms is being run using JWS or JPI?
I don't see it possible using get_application_property().
Thanks in advance.
Using below code solved my problem:
WEB.SHOW_DOCUMENT('/'||:block3.item4);

Codeception: Force PhpBrowser to use custom environment

I have a page with a text field and button. After I fill out text field and press a button my controller is connecting to an API and getting some data based on the text.
I prepared a FAKE_API for testing. Both REAL_API and FAKE_API are in the service container. The FAKE_API is being prioritized when the environment is set to test (.env.test file). The controller gets the API object via dependency injection (constructor argument).
When I am testing using PhpBrowser from Codeception, the environment of the test itself is set to test - this can be checked by var_dump($_ENV['APP_ENV']) from the test.
However, (and this is the issue), if I add var_dump($_ENV['APP_ENV']) to the controller code and run the same test, I can see that the controller actually uses the regular 'dev' environment (set in .env file). This means that the REAL API is being used instead of my FAKE_API.
How can I force PhpBrowser tests to use my .env.test? Is it even possible?
You can't do that.
PhpBrowser communicates to system under test via HTTP, so it can't set environment variables of the system.
Your options are:
Deploy API in test configuration
Pass environment using GET or POST parameters or headers and make your app code accept it. (this is a bad idea)

Jmeter View Results Tree doesn't return anything in Response Data

I sent a HTTP request. There is an error in View Results Tree. But In the Response Data doesn't seem anything.
How can I see the error logs?
Don't use JMeter GUI to run performance tests. Run test in command-line non-GUI mode instead.
Don't use View Results Tree listener for anything but tests development or single-threaded debugging, it's too memory intensive and basically stores all requests/responses details in the memory. It might be the cause of errors you're getting. As per documentation
View Results Tree MUST NOT BE USED during load test as it consumes a lot of resources (memory and CPU). Use it only for either functional testing or during Test Plan debugging and Validation.
If you need to store response data on error in .jtl results file add the following line to user.properties file (it usually lives under /bin folder of your JMeter installation)
jmeter.save.saveservice.response_data.on_error=true
Alternatively you can use a sniffer tool like Wireshark to capture full requests/responses details for later inspection.

How can I start a process using activiti-restapi and soapui or restclient

I want to start a simple process that can be in activiti-explorer or I deployed,using activiti-rest api. I use SoapUI or RESTClient.Actually I wrote URL and I can see all of the process,after I start the process with rest-services, I can see the process started in SoapUI,becasuse the reponse is true,but in activiti-explorer,process isn t starting.What should I do? I m waiting your helps
Thanks
My guess is that you deployed the activiti-webapp-explorer2 and activiti-webapp-rest as separate war files and each is using an in memory database.
This means, the applications are essentially seperate.
You have two choices.
Deploy as separate webapps but set them to use the same database instance/
Merge the rest API jar into the explorer webapp.
Both methods are acceptable.

Object Builder Exception while using Enterprise Liabrary

I have an WCF application which has seperate client and server application. When I running the application runs fine, but when I try to unit test the application methods the object builder exception is generated. Can somebody help?
I think you should check your test setting of your test project. You have to mention the necessary files that are required for the deployment. Also check whether the test.testsettings file is included in the project and it is properly configured.