Can i create a Customized reporting in CitrusFramework - citrus-framework

My Current project i have used a Extent Reporting"http://extentreports.com/".
Is there a way where i can read the Summary Report of Citrus and Print it into Extent Report Format.
Attached Sample Report for Citrus Framework,enter image description here

Citrus provides several reporting and listener interfaces that get informed about test state such as success or failure. You can add custom implementations of these interfaces to the Spring application context. The custom reporting class may then create Extent reports via Java API.
The listener interfaces are located in com.consol.citrus.report package: MessageListener, TestSuiteListener, TestListener, TestActionListener, TestReporter
You can have a look at the default LoggingReporter as a sample implementation.

Related

MarkLogic Customized REST API Creation without Gradle or Roxy Framework

I want to create a brand new REST API using MarkLogic 9.x.x but without using Roxy or Gradle. I want to point to a file which has list of customized endpoints in basic MarkLogic setup and then keep my customized logic in those modules.
I've gone through the REST API documentation to create one by using CURL so that we can use default APIs provided by MarkLogic.
Any detailed explanation is appreciated.
Management REST api is really your best friend here, it is designed for this purpose. However, creating scripts that make the appropriate REST calls can be cumbersome. ml-gradle can support you with that though. It can generate a shell-script with all curl-statements for you, which you could run as-is, or use as starting point to build out your own set of deploy scripts. For details see:
https://github.com/marklogic-community/ml-gradle/wiki/Generating-a-shell-script
HTH!
Have you considered using XQRS ?, you can create custom REST endpoints with ease using intuitive Function Annotations much like one would do with JAX-RS or Java Spring REST Services. It can be installed and used with or with-out Gradle.
You can keep your custom logic either in these REST functions, or you could write your custom logic in JavaScript code that you then import/invoke from these functions. XQRS provides you with total flexibility. You can make beautiful REST APIs with Human-Friendly URLs that sit directly on MarkLogic, taking complete control of the URL Path. It's solid as a rock and unit tested to death. It scales with MarkLogic - i.e. you add more MarkLogic e-nodes and you automatically scale your REST servers, it's totally free and open source. The project is actively maintained and support is available on GitHub. If you've got a Swagger/OpenAPI interface file, you can generate a MarkLogic Stub too which could save you a lot of time.
Functions simply become available as REST Services based on the Annotations you place on them - and you can pass query/form parameters, cookies and the request body via the Annotations. Check out this snippet for a sample flavour.
declare
%rest:path("/factory/warehouse/wheel/{$wheel-id}")
%rest:GET
function get-wheel($wheel-id as xs:string) {
fn:doc($wheel-id)
};
declare
%rest:path("/factory/warehouse/wheel/{$wheel-id}")
%rest:PUT("{$doc}")
%xdmp:update
function put-wheel($wheel-id as xs:string, $doc as document-node(element())) {
xdmp:document-insert($wheel-id, $doc, map:entry("collections", "wheels"))
};
declare
%rest:path("/factory/warehouse/wheel")
function list-wheels() {
<wheels>{
fn:collection("wheels")
}</wheels>
};
Both responses to date are correct and accurate and help, however the original question is self-answered.
I've gone through the REST API documentation to create one by using
CURL so that we can use default APIs provided by MarkLogic.
That is in fact the answer to your question as stated.
To manually deploy ML rest API, please follow below steps
Create Module DB
Create App Server
Provide details for Module DB, database, port, URL rewriter
Deploy xquery, xsl using qConsole
let URI = path of file
let path = xdmp:document-get($FilePath)
xdmp:document-insert($URI,$path,(), ())
where endpoints.xqy will contains defined custom endpoint for your rest API and internally you can call search:search function to call data from MarkLogic
module namespace endpoints="urn:overstory:rest:modules:endpoints";
declare namespace rest="http://marklogic.com/appservices/rest";
(: ---------------------------------------------------------------------- :)
declare private variable $endpoints as element(rest:options) :=
<request uri="^/getcontent$" endpoint="<xqy file" user-params="allow">
<http method="GET"/>
</request>
Hope this will help

Does Citrus Framework for Integration testing(Java) supports Object to Object Asserts as in Junit?

I am working on Citrus Integration Testing for a Web-service. I need to use the same DB used by the application. I am wondering if I can get response in Citrus in form of Objects, so that I can use the Object in Assert.
Citrus is able to automatically map message payloads into domain objects. You need to setup a marshaller (Xml) or object mapper (Json) in Citrus. Then you will be able to use domain object instances in send and receive operations.
See these samples for details:
https://github.com/christophd/citrus-samples/tree/master/sample-databind
https://github.com/christophd/citrus-samples/tree/master/sample-oxm
Hope this helps

GWT with Apache CXF

I am working with gwt code which involves call to web-service. We generated stub for web-service using Apache CXF. It generates all the request and response types. (I am not gwt expert) What I understand is, you need to have Common Data Models( Serilizable ) for accessing model classes on client side. Can we access model classes generated by Apache CXF on client side also ? Or Do we need to replicate all these classes for accessing them in client side ?
You need to first reference this before deciding which approach suits you best.
Depending on your performance requirements and screen type ( form vs chart vs tabular data ) you would have to choose the server communication type.
I am guessing RPC Or Json with Requestbuilder will serve you best. In both cases you might choose to have your own model classes layer on client side ( to be lightweight ).
If you intend to use CXF generated models then you would need to put them in shared folder of GWT and avoid pushing in data that is not serializable by GWT.

File handling in GWT(at server side)

I have some doubt regarding gwt file handling.
How to do file handling in gwt(at server side). How to create simple file. I mean which class is particularly used for CREATING and HANDLING it ??
Where is the file created. Is it under server package or somewhere else ??
How to resolve serialization and serialization problem. ??
GWT is a client-side technology. It's server-agnostic (and can also be used client-only, e.g. mobile apps, Chrome apps, browser extensions). GWT-RPC and RequestFactory use Java servlets by default (nothing precludes implementing RequestFactory in other languages/technologies) but have otherwise no requirement or limitations.
So, server-side, it's all just Java in most of the cases, and depends on your deployment target (e.g. AppEngine restricts what you can do, servlet containers can also have security policies in place, and you're of course dependent on authorizations at the filesystem level)
Since GWT is a pure client-side technology you have all possible options like plain Servlets for example. You are not limited in any way in picking the upload approach.
However, there is a number of open source projects, which make possible to use nice features like progress bars and multiple file uploads. And those come integrated with some GWT widgets as well. Check this project for example http://code.google.com/p/gwtupload/

SmartGWT Datasource customization tutorial

I'm looking for a good tutorial on how to customize a DataSource in SmartGWT (a code sample will also do for now).
Some details:
I have a GWT project which uses a proprietary client-server protocol for fetching data (with an extensive API based on GWT classes). The server is non-GWT based, i.e. GWT is used only for client side.
I'd like to use SmartGWT's widgets with this data by creating a custom DataSource which will interact with the existing GWT infrastructure.
Does anybody know of such a resource?
EDIT:
Charles Kendrick's answer worked for me.
For a working code example, you can see this.
You do this via overrides of transformRequest and transformResponse - see the documentation of these methods for an overview:
http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/data/DataSource.html#transformRequest(com.smartgwt.client.data.DSRequest)
http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/data/DataSource.html#transformResponse(com.smartgwt.client.data.DSResponse,%20com.smartgwt.client.data.DSRequest,%20java.lang.Object)