Mercurial > hg > Members > nobuyasu > Consensus
changeset 43:4fb303b7d661
modified Claim/setClaimProperties
author | one |
---|---|
date | Thu, 04 Oct 2012 04:22:43 +0900 |
parents | 4321d97da830 |
children | 853bc291a3bb |
files | app/models/ClaimModel.java target/scala-2.9.1/cache/compile/compile test/RequestTest.java |
diffstat | 3 files changed, 6 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/app/models/ClaimModel.java Thu Oct 04 04:15:14 2012 +0900 +++ b/app/models/ClaimModel.java Thu Oct 04 04:22:43 2012 +0900 @@ -194,7 +194,9 @@ t.put(BACKING, b); t.put(REBUTTLE, r); setProperty(TYPE, type); - setProperty(STATUS, UNKNOWN); // Default Status is unknown. + if (getProperty(STATUS) == null) { + setProperty(STATUS, UNKNOWN); // Default Status is unknown. + } setProperty(TOULMIN, t); }
--- a/test/RequestTest.java Thu Oct 04 04:15:14 2012 +0900 +++ b/test/RequestTest.java Thu Oct 04 04:22:43 2012 +0900 @@ -12,17 +12,14 @@ import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; - public class RequestTest { final static String SERVER_ROOT_URI = "http://localhost:9000"; public static void main(String[] args) { - String user1 = "akifumi"; String user2 = "takaaki"; String user3 = "yosiaki"; String user4 = "suzuki"; - createUser(user1); createUser(user2); createUser(user3); @@ -35,16 +32,15 @@ getClaimInfo(user1Claim.get(0).asInt()); editClaimInfo(user1, users2, user1Claim.get(0).asInt()); getClaimInfo(user1Claim.get(0).asInt()); - String[] users3 = {user1}; for (int i=0; i<user1Claim.size(); i++) { int claimId = user1Claim.get(i).asInt(); - createMention(user2, users3, NodeModel.L_QUESTION, claimId); - createMention(user3, users3, NodeModel.L_REFUTATION, claimId); + String[] users = {user1}; + createMention(user2, users, NodeModel.L_QUESTION, claimId); + createMention(user3, users, NodeModel.L_REFUTATION, claimId); } JsonNode user2Claim = getUserInfo(user2,"claims/"); for (int i=0; i<user2Claim.size(); i++) { int claimId = user2Claim.get(user2Claim.size()-1).asInt(); - System.out.println("claimId = "+claimId); String[] users = {user2}; createMention(user1, users, NodeModel.L_SUGGESTION, claimId); }