I'm just learning cucumber for test automation, and would like to know if it's possible to use it to debug the application the automation is for?
So basically I'd like to know if it can be used to debug the application being developed?
Thanks.
Les
Yes, as long as your running the instance of the application under test in debug mode you can set breakpoints and debug as you normally would when interacting with it manually. Cucumber does nothing that would prevent this.
You can start any java application (say you have prepared build for testing) with remote debugging enabled. So that your steps would be:
Start app you would like to test with remote debugging enabled (see docs here)
In IDE open that app sources and connect to that debugger port you have set up on step 1
Put some breakpoints
Run your cucumber tests
Since now as soon as your Cucumber tests will make your app hit break-point the service will stop and you will be able to manipulate the state through IDE.
P.S. - Since your Cucumber tests will be running separately in regular way, stopping the service at the breakpoint will lead to timeout error on client side after certain time of connection inactivity. Possible solution is to configure your client to accept longer pauses.
Related
I am trying to create a RESTful website using Spring Tool Suite. I am getting the error:
"Failed to refresh live data from process 90196 - com.example.demo.DemoApplication after retries: 10."
I am unsure why I am getting this error. Any suggestions on how to fix it?
Yes, I can explain that... :-) This is part of this feature of the tooling:
https://github.com/spring-projects/sts4/wiki/Live-Application-Information
The aim of this feature is to provide live information from a running Spring application and merge that information with the source code of your workspace, so that you get live information in-place right within your editor.
This information that the IDE uses is provided by the Spring Boot actuators. In order to make this as automatic and easy to use as possible, the IDE automatically tries to connect to a running Spring process and tries to identify that live information. This might not work for various reasons (like the process is not responding, the Spring app doesn't have the actuators on the classpath, JMX connection isn't working, whatever). After trying to get the data for a specific process 10 times, the tooling gives up (assuming there is no live data to extract from the process) and shows the above message.
You can disable this "automatically try to connect to a running process" in the Preferences -> Language Servers -> Spring Language Server -> Spring Boot Language Server -> Spring Boot Java and disable Live Information - Automatic Process Tracking Enabled. If you want to display that live information nevertheless, you can connect to a running process manually, too (using the quick access or the action the boot dashboard views menu). In that case, take care to add the actuators to the Spring Boot project before starting up the app.
Hope that helps!
We are working on a project and Im involved in continuous integration testing.
I need to
deploy the new project code on a staging server, not using Jenkins, but ftp;
after the deploy an email is sent to indicate successfull deploy and we need it to start my integration tests;
integration tests, if successfull, will start a deploy on integration server.
I am going to write a java program that will login to Jenkins and execute the integration tests.
Question is: how can the email message activate the java program?
EDIT: Normally, jenkins offers a feature that starts a job after getting an email, but we are having a security problem with that
Make a program or script which will peridically poll a mail server box and upon getting an appropirate email will run another java program.
Please read Jenkins documentation thoroughly. If you are using a version control system, Jenkins can automatically pull the code and run test cases on it. You can notify Jenkins using various methods... including webhooks.
Do go through various plugins for Jenkins.
Update:
I have not used this myself. But looks like this is what you want: Mail Commander Plugin
And the command you send can be something like this:
curl --data '' http://<server>:<port>/job/<projectname>/build
Can I use Jenkins to test to see if a VM(server) is up and running? We have alot of VMs(servers) with JBoss, LDAP, MySQL etc on them and I would like to know if I can somehow have Jenkins ping a server to see if the SA shut it down or something..
I was thinking of using a selenium test. I was going to have a Maven project with a selenium java test in it to check of the server is up. but how can I tell Jenkins to run the test every hour and do you think this is the right way to go?
I would say the simplest possible solution is to use Site Monitor plug-in.
It is simple, reliable and it also allows to reuse build status notifications, provided by your jenkins instance. The only limitation is you should have some http server up and running, but I bet you have at least default page available.
Configuration is simple:
Jenkins does not have a plugin for managing (or monitoring) VMs, AFAIK, but you can use Perl or PowerShell for that - both have a good set of tools for that.
Let that tool return error when the server is not available, and you can even use the API to boot a hosted machine.
Cheers
I have an application that uses Spring-Batch and its jobs are launched through Quartz.
The problem is that my application starts using the debugging mode on, I have set some breakpoints but my application never stops on my breakpoints.
I have tested the ports, also enabled the debug on suspend mode so I can confirm that my app is connected well to the debug port.
On the other hand, I have tested my other applications that use spring-core and everything work fine, the only problem is in my app that use spring-batch and quartz which the debugger doesn't work.
Does anybody know what is happening? Why the debugger doesn't stop on my breakpoints? Do I have to configure anything in Quartz or spring-batch to allow debugging?
Thanks a lot in advance
I have a webapp developped in Java, using GWT, Spring and Hibernate.
This app has a cronTriggered job (which extends QuartzJobBean), set in a application-context.xml file.
How do I debug that job (which is triggered to run every minute) ?
I have tried to set breakpoints in the method executeInternal() of the job class (I am using Eclipse Java EE Helios), but they don't seem to be reached.
Change how the app is started to include the remote debugging agent. That way, you can attach to it from Eclipse. Once attached, it should respond to breakpoints set within Eclipse and from there you are in a typical debugging session. Be aware if the app uses timeouts, they can trigger while you are stopped at a breakpoint which can make it difficult to continue execution afterwards.