# HG changeset patch # User one # Date 1349280319 -32400 # Node ID a2abe67d7c7aac1c59658df2a31b92adc5a2540c # Parent bc3ac73320f9e6e1954dac7a66b1fb5666f63ca7 fix createMention action bug diff -r bc3ac73320f9 -r a2abe67d7c7a app/controllers/Claim.java --- a/app/controllers/Claim.java Thu Oct 04 00:31:09 2012 +0900 +++ b/app/controllers/Claim.java Thu Oct 04 01:05:19 2012 +0900 @@ -81,7 +81,7 @@ public static Result createMention(String mentionType, String id) { if ( !(mentionType.equals(NodeModel.L_QUESTION) ||mentionType.equals(NodeModel.L_REFUTATION) - ||mentionType.equals(NodeModel.L_QUESTION))) { + ||mentionType.equals(NodeModel.L_SUGGESTION))) { return badRequest("Wrong mention type."); } JsonNode json = request().body().asJson(); diff -r bc3ac73320f9 -r a2abe67d7c7a app/models/ClaimModel.java --- a/app/models/ClaimModel.java Thu Oct 04 00:31:09 2012 +0900 +++ b/app/models/ClaimModel.java Thu Oct 04 01:05:19 2012 +0900 @@ -55,7 +55,7 @@ pipeChildVertex.start(e).inV(); ClaimModel childClaim = new ClaimModel(pipeChildVertex.next()); info.put(CLAIM, childClaim.getClaimInfoTraverse()); - info.put(MENTIONS, Json.toJson(childClaim.getClaimMentionsRecursive())); + info.put(ID, Json.toJson(childClaim.getId())); array.add(info); } return array.toArray(); diff -r bc3ac73320f9 -r a2abe67d7c7a logs/application.log --- a/logs/application.log Thu Oct 04 00:31:09 2012 +0900 +++ b/logs/application.log Thu Oct 04 01:05:19 2012 +0900 @@ -1,12 +1,24 @@ -2012-10-03 23:52:13,026 - [INFO] - from play in main +2012-10-04 00:57:27,766 - [INFO] - from play in main Listening for HTTP on port 9000... -2012-10-03 23:52:27,823 - [INFO] - from play in play-akka.actor.default-dispatcher-2 +2012-10-04 00:57:32,759 - [INFO] - from play in play-akka.actor.default-dispatcher-1 +Application started (Dev) + +2012-10-04 01:01:31,070 - [INFO] - from application in play-akka.actor.default-dispatcher-1 +Application shutdown... + +2012-10-04 01:01:31,090 - [INFO] - from play in play-akka.actor.default-dispatcher-1 Application started (Dev) -2012-10-03 23:55:53,105 - [INFO] - from application in play-akka.actor.default-dispatcher-2 +2012-10-04 01:04:06,784 - [INFO] - from application in play-akka.actor.default-dispatcher-2 Application shutdown... -2012-10-03 23:55:53,125 - [INFO] - from play in play-akka.actor.default-dispatcher-2 +2012-10-04 01:04:06,801 - [INFO] - from play in play-akka.actor.default-dispatcher-2 Application started (Dev) +2012-10-04 01:04:11,405 - [INFO] - from application in play-akka.actor.default-dispatcher-2 +Application shutdown... + +2012-10-04 01:04:11,430 - [INFO] - from play in play-akka.actor.default-dispatcher-2 +Application started (Dev) + diff -r bc3ac73320f9 -r a2abe67d7c7a test/RequestTest.java --- a/test/RequestTest.java Thu Oct 04 00:31:09 2012 +0900 +++ b/test/RequestTest.java Thu Oct 04 01:05:19 2012 +0900 @@ -20,10 +20,12 @@ String user1 = "akifumi"; String user2 = "takaaki"; String user3 = "yosiaki"; + String user4 = "suzuki"; createUser(user1); createUser(user2); createUser(user3); - String[] users1 = {user2,user3}; + createUser(user4); + String[] users1 = {user2,user3,user4}; createClaim(user1, users1); String[] users2 = {user2}; createClaim(user1, users2); @@ -36,21 +38,27 @@ int claimId = user1Claim.get(i).asInt(); createMention(user2, users3, NodeModel.L_QUESTION, claimId); createMention(user3, users3, NodeModel.L_REFUTATION, claimId); - getClaimInfo(claimId); } + JsonNode user2Claim = getUserInfo(user2,"claims/"); + for (int i=0; i