Gaurav,

For Unit testing, what one usually do is to use a mocking library to mock the 
server response to the connector. If you are writing in Java, you can use 
EasyMock to accomplish this. This is the same pattern as say, unit testing a 
client to a relational database server, or a RESTful server.

For Integration testing, you code hits the real server, which you can download 
and run a free one as David mentioned.

Hope this helps,
Shan Jiang
Senior Consultant
MarkLogic

________________________________
From: [email protected] 
[[email protected]] on behalf of David Lee 
[[email protected]]
Sent: Sunday, November 29, 2015 9:32 AM
To: gaurav gupta; MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Mock marklogic server for writing unit 
tests

There is no 'mock server' that I know of.
You can, however, download and run the 'real' one for free as a developer 
(using the developer license).
If you don't put heavy demand on it, it can run in reasonable constraints -- 
very commonly used on laptops as 'just another program'

You can then write 'mock' responses to your code.
Depending on what your code does and how 'real' the 'mock' needs to be -- it 
maybe easier to make use of testing frameworks that allow client side mock 
injection.



-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
[email protected]
Phone: +1 812-482-5224
Cell:  +1 812-630-7622
www.marklogic.com<http://www.marklogic.com/>

From: [email protected] 
[mailto:[email protected]] On Behalf Of gaurav gupta
Sent: Sunday, November 29, 2015 3:59 AM
To: [email protected]
Subject: Re: [MarkLogic Dev General] Mock marklogic server for writing unit 
tests

Guys,

Any pointers to this?

Thanks
Gaurav


On Sunday, November 22, 2015 10:47 PM, gaurav gupta 
<[email protected]<mailto:[email protected]>> wrote:

Hi,

I am writing a connector to write to mark logic server. For unit tests for my 
code I need mock server. I could not find one. Can you please point me to the 
correct location from where I can download mock server?

Thanks
Gaurav

_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to