call java void method from feature file in karate framework [duplicate] - frameworks

This question already has an answer here:
How can I integrate socket.io on Karate
(1 answer)
Closed 1 year ago.
We are using ReadyAPI for API testing, Mocking and JMeter for performance testing and looking into the possibility to migrate everything to Karate framework. Would be handy to have all in one open source framework. But the main question is: can Karate framework handle JMS calls? Because 80% of our service testing is via JMS (with Hermes in ReadyAPI). I know SOAP and REST are supported but can't find anything about JMS.

Yes, you have to write a Java adapter (one-time work).
Please look at these 2 references:
https://twitter.com/getkarate/status/1128170638223364097
A great example that shows off Karate's
Java / JS interop - and built-in async support
first we call custom code to listen to an ApacheActiveMQ queue
an HTTP POST is made
we wait for the JMS message
and assert that the message is as expected
https://github.com/intuit/karate/tree/master/karate-netty#consumer-provider-example
https://twitter.com/getkarate/status/1417023536082812935
How Java interop and mocks can come together for advanced async / messaging flows such as JMS or apachekafka
link to full example: https://github.com/intuit/karate/tree/develop/karate-demo/src/test/java/mock/async

Related

How it's using vert.x

A question is running into my mind for a several days ago.
I read several docs about vert.x and quarkus.
Which kind of message are sent throuh event-bus? Only received http request?
Has it sense to configure an clustered eventbus inside a quarkus application? Any example?
Those above question have not been able to find some lights.
Any ideas?
You can send any type of message through the Vert.x Event Bus, as long as a codec exists for this particular type. There are several built-in codecs, but you can register custom codecs too.
Quarkus does not support clustering officially so far. You can make it work with some tweaks, though.
From my perspective (I'm a Vert.x development team member), it can be useful to have a clustered eventbus inside Quarkus, just as it can be useful inside a Vert.x application. There are plenty of articles on the web about use cases.

Integration testing framework for rest Kafka and soap services

Hi there I would like to build an integration test framework that supports testing soap services mq Kafka and rest services - can someone say if citrus framework would be a better choice ? And some p tutorial to refer at ?
Thanks
Citrus already covers all of those features mentioned so I would suggest to have a look and try before heading to something else or implement it yourself.
The framework is Open Source so you can also contribute to it and enhance where you feel it is necessary.
I often give reference to the samples section where you find running samples of all features you have mentioned.
https://citrusframework.org/samples/

Developing a Java based web service client

I have a couple of web services running on JBoss 5.1.0 GA with JBossWs native stack (shipped with JBoss 5.1.0 GA binary)
These web services are simple POJO services. Many of the WebMethods exposed by the services are of Complex Object type (I call these Complex types as DTO's) and a lot of custom defined exceptions. These DTO's are also bundled in a jar file, so that they can be used at the Client end as well.
I started creating a client using Eclipse (which I understand is using wsconsume to generate the client stub) and I saw that the utility would generate the DTO's from the WSDL and I could not find any way of enforcing the utility to use the DTO & exception classes provided in the jar file.
I had earlier asked a question on this on SO and could not find any answers.
From reading of various resources on wsconsume and generating client stub using eclipse (which would use JBossWS) i have now started to believe that what I am trying to achieve might not actually be possible using wsconsume.
My question is:
Is there a better way to create a client stub which would use the DTO classes from the jar files. I am open on changing the Client generation mechanism and move to axis or any other library for Client generation if that is possible. It would also be ideal if an ant task can be created for Client stub generation.
PS: My knowledge on web services is very limited and if I am being stupid with my question here, please pardon me for that.
Why do you want to use Data Transfer Objects in Your Web Service ? Is that necessary? Because If you use such objects, those web services can be use only in Java I think. That is a interoperability issue. So If you can avoid those kind of objects that will be a good practice.

Comet with scala

I am developing one application with GWT as client and my server side code written in Java servelt and I am fetching some data from another server. that another server code is in Scala. so the question is how can i push data from another server to my main server and display that data to client using comet ( gwt-comet.jar)
Please help me.
Thanks
Comet is something that your web server must support, via continuations or some other implementation (see this as an example). Usually web frameworks (like Lift) have some wrapper around this mechanism to facilitate using it.
I'm no expert on GWT, but for what you say it seems it has a Comet library. Using it should be as simple as to implement classes following this library specifications and using a server that supports Comet.

searching for a working GWT RPC library

im searching for a GWT-RPC lib for the client side to communicate with a zend framework php server
thus rpc like json, xml or rest would be interesting
all i find are projects which have been stuck in years 2007/08 which dont seem to work anymore
so is there anyone who can suggest a working library?
thx
As far as I know nobody has built a GWT-RPC to communicate with a non-Java server, to allow you to have the automatic object sharing between client (written in Java) and server (written in non-Java) that GWT-RPC provides.
Luckily, GWT provides a mechanism for communicating with a server in regular JSON, using RequestBuilder. See this link for more information about making regular HTTP requests in GWT.