comparison test/RequestTest.java @ 38:a2abe67d7c7a

fix createMention action bug
author one
date Thu, 04 Oct 2012 01:05:19 +0900
parents bc3ac73320f9
children 870553e92e3e
comparison
equal deleted inserted replaced
37:bc3ac73320f9 38:a2abe67d7c7a
18 18
19 public static void main(String[] args) { 19 public static void main(String[] args) {
20 String user1 = "akifumi"; 20 String user1 = "akifumi";
21 String user2 = "takaaki"; 21 String user2 = "takaaki";
22 String user3 = "yosiaki"; 22 String user3 = "yosiaki";
23 String user4 = "suzuki";
23 createUser(user1); 24 createUser(user1);
24 createUser(user2); 25 createUser(user2);
25 createUser(user3); 26 createUser(user3);
26 String[] users1 = {user2,user3}; 27 createUser(user4);
28 String[] users1 = {user2,user3,user4};
27 createClaim(user1, users1); 29 createClaim(user1, users1);
28 String[] users2 = {user2}; 30 String[] users2 = {user2};
29 createClaim(user1, users2); 31 createClaim(user1, users2);
30 JsonNode user1Claim = getUserInfo(user1,"consensus/"); 32 JsonNode user1Claim = getUserInfo(user1,"consensus/");
31 getClaimInfo(user1Claim.get(0).asInt()); 33 getClaimInfo(user1Claim.get(0).asInt());
34 String[] users3 = {user1}; 36 String[] users3 = {user1};
35 for (int i=0; i<user1Claim.size(); i++) { 37 for (int i=0; i<user1Claim.size(); i++) {
36 int claimId = user1Claim.get(i).asInt(); 38 int claimId = user1Claim.get(i).asInt();
37 createMention(user2, users3, NodeModel.L_QUESTION, claimId); 39 createMention(user2, users3, NodeModel.L_QUESTION, claimId);
38 createMention(user3, users3, NodeModel.L_REFUTATION, claimId); 40 createMention(user3, users3, NodeModel.L_REFUTATION, claimId);
39 getClaimInfo(claimId);
40 } 41 }
42 JsonNode user2Claim = getUserInfo(user2,"claims/");
43 for (int i=0; i<user2Claim.size(); i++) {
44 int claimId = user2Claim.get(i).asInt();
45 System.out.println("claimId = "+claimId);
46 String[] users = {user2};
47 createMention(user1, users, NodeModel.L_SUGGESTION, claimId);
48 }
49
50 /*
41 getUserInfo(user1,"requests/"); 51 getUserInfo(user1,"requests/");
42 getUserInfo(user1,"consensus/"); 52 getUserInfo(user1,"consensus/");
43 getUserInfo(user2,"claims/"); 53 getUserInfo(user2,"claims/");
54
44 getUserInfo(user2,"consensus/"); 55 getUserInfo(user2,"consensus/");
45 getUserInfo(user3,"claims/"); 56 getUserInfo(user3,"claims/");
46 getUserInfo(user3,"consensus/"); 57 getUserInfo(user3,"consensus/");
58 */
47 for (int i=0; i<user1Claim.size(); i++) { 59 for (int i=0; i<user1Claim.size(); i++) {
48 int id = user1Claim.get(i).asInt(); 60 int id = user1Claim.get(i).asInt();
49 getClaimTree(id); 61 getClaimTree(id);
50 getClaimInfo(user1Claim.get(i).asInt());
51 editClaimInfo(user1, users1, id);
52 getClaimInfo(user1Claim.get(i).asInt());
53 break;
54 } 62 }
55 } 63 }
56 64
57 public static JsonNode editClaimInfo(String author, String[] users, int id) { 65 public static JsonNode editClaimInfo(String author, String[] users, int id) {
58 ObjectNode jobj = createEditClaimParameter(author,users); 66 ObjectNode jobj = createEditClaimParameter(author,users);