Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
a little more fakery to get checkpoints working.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Newson committed Jun 12, 2011
1 parent afcbe69 commit 3edcdd8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/com/github/rnewson/cl/web/DatabaseResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
@Consumes({ "text/plain", "application/json" })
public final class DatabaseResource {

private static final String FAKE_INSTANCE_START_TIME = "1307900650417";
private static final String FAKE_REV = "1-967a00dff5e02add41819138abb3284d";
private static final Version _VERSION = Version.LUCENE_32;
private static final Analyzer ANALYZER = new StandardAnalyzer(_VERSION);
Expand Down Expand Up @@ -91,8 +92,7 @@ public Response create(@PathParam("db") final String db) throws IOException {
public Response ensureFullCommit(@PathParam("db") final String db) {
final ObjectNode node = MAPPER.createObjectNode();
node.put("ok", true);
node.put("instance_start_time",
Long.toString(System.currentTimeMillis()));
node.put("instance_start_time",FAKE_INSTANCE_START_TIME);
return Response.status(201).entity(node.toString()).build();
}

Expand All @@ -112,6 +112,7 @@ public String info(@PathParam("db") final String db) {
final ObjectNode node = MAPPER.createObjectNode();
node.put("db_name", db);
node.put("update_seq", 0);
node.put("instance_start_time",FAKE_INSTANCE_START_TIME);
return node.toString();
}

Expand Down Expand Up @@ -145,6 +146,7 @@ public String missingRevs(@PathParam("db") final String db,
return response.toString();
}

// FOR THINGS WITH ATTACHMENTS!
@PUT
@Consumes("multipart/related")
@Path("/{id}")
Expand All @@ -158,7 +160,9 @@ public Response updateDocument(@PathParam("db") final String db,

final ObjectNode node = MAPPER.createObjectNode();
node.put("ok", true);
return Response.ok().entity(node.toString()).build();
node.put("id", id);
node.put("rev", FAKE_REV);
return Response.status(201).entity(node.toString()).build();
}

private Directory getDirectory(final String db) {
Expand Down

0 comments on commit 3edcdd8

Please sign in to comment.