mcouch-core

CouchDB Mocking

License

License

GroupId

GroupId

io.bdrc
ArtifactId

ArtifactId

mcouch-core
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

mcouch-core
CouchDB Mocking
Source Code Management

Source Code Management

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

Download mcouch-core

How to add to project

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

Dependencies

compile (8)

Group / Artifact Type Version
commons-io : commons-io jar 2.5
com.fasterxml.jackson.core : jackson-annotations jar 2.8.0
com.fasterxml.jackson.core : jackson-core jar 2.8.0
com.fasterxml.jackson.core : jackson-databind jar 2.8.0
org.mozilla : rhino jar 1.7.7.1
org.apache.httpcomponents : httpclient jar 4.5.3
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