mcouch-ektorp

CouchDB Mocking

License

License

GroupId

GroupId

io.bdrc
ArtifactId

ArtifactId

mcouch-ektorp
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

mcouch-ektorp
CouchDB Mocking
Source Code Management

Source Code Management

http://github.com/BuddhistDigitalResourceCenter/mcouch/tree/master/mcouch-ektorp

Download mcouch-ektorp

How to add to project

<!-- https://jarcasting.com/artifacts/io.bdrc/mcouch-ektorp/ -->
<dependency>
    <groupId>io.bdrc</groupId>
    <artifactId>mcouch-ektorp</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.bdrc/mcouch-ektorp/
implementation 'io.bdrc:mcouch-ektorp:1.1.0'
// https://jarcasting.com/artifacts/io.bdrc/mcouch-ektorp/
implementation ("io.bdrc:mcouch-ektorp:1.1.0")
'io.bdrc:mcouch-ektorp:jar:1.1.0'
<dependency org="io.bdrc" name="mcouch-ektorp" rev="1.1.0">
  <artifact name="mcouch-ektorp" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.bdrc', module='mcouch-ektorp', version='1.1.0')
)
libraryDependencies += "io.bdrc" % "mcouch-ektorp" % "1.1.0"
[io.bdrc/mcouch-ektorp "1.1.0"]

Dependencies

compile (5)

Group / Artifact Type Version
io.bdrc : mcouch-core jar 1.1.0
org.ektorp : org.ektorp jar 1.4.4
org.ektorp : org.ektorp.spring jar 1.4.4
org.springframework : spring-core jar 4.3.8.RELEASE
org.slf4j : slf4j-api jar 1.7.25

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.slf4j : slf4j-simple jar 1.7.5

Project Modules

There are no modules declared in this project.

mCouch - in memory CouchDB mocking

This package provides in memory implementation of couch db which can be used in unit testing to speed up the performance of your tests. No meant to be used for production. It supports:

  • PUT, POST, DELETE and GET of documents.
  • Bulk API, add, update and delete of documents.
  • Execution of views.
  • Supports count as standard reducer.

It Does not implement:

  • Replication
  • Document conflict checks
  • Custom reducers

It uses Rhino to interpret the JavaScript map functions and Jackson for JSON parsing. It is based on stubbing of Apache Commons HTTP client.

Installation

With maven:

    <dependency>
      <groupId>io.bdrc</groupId>
      <artifactId>mcouch</artifactId>
      <version>1.0.0</version>
    </dependency>

Usage

Building an HttpClient linked to the CouchDB mock:

HttpClient couchDbClient = new InMemoryCouchDb();
couchDbClient.createDatabase(databaseName);

With Ektorp:

InMemoryCouchDb couchDbClient = new InMemoryCouchDb();
couchDbClient.createDatabase(databaseName);
StdHttpClient stdHttpClient = new StdHttpClient(couchDbClient);
StdCouchDbInstance stdCouchDbInstance = new StdCouchDbInstance(stdHttpClient);
return new StdCouchDbConnector(databaseName, stdCouchDbInstance);

Change history

See Change log.

License

The code is Copyright Vivek Singh 2012, distributed under the Apache 2.0 License.

Versions

Version
1.1.0
1.0.0