| |
---|
| | |
---|
| | import main.RestApi.Method; |
---|
| | |
---|
| | public class Main { |
---|
| | |
---|
| | static RestApi api = new RestApi(); |
---|
| | static ArrayList<RestParam> queryParam = new ArrayList<>(); |
---|
| | static ArrayList<RestParam> formParam = new ArrayList<>(); |
---|
| | static ArrayList<String> pathParam = new ArrayList<>(); |
---|
| | |
---|
| | public static void main(String[] args) { |
---|
| | RestApi api = new RestApi(); |
---|
| | ArrayList<RestParam> queryParam = new ArrayList<>(); |
---|
| | ArrayList<RestParam> formParam = new ArrayList<>(); |
---|
| | ArrayList<String> pathParam = new ArrayList<>(); |
---|
| | api.setAccount("http://nitta-lab-www.is.konan-u.ac.jp/CactusServer/rest/accounts/"); |
---|
| | formParam.add(new RestParam("userID", "yyy")); |
---|
| | formParam.add(new RestParam("userName", "abc")); |
---|
| | formParam.add(new RestParam("userPass", "abc")); |
---|
| | init(); |
---|
| | api.setupRestTest(Method.POST, queryParam, formParam, pathParam); |
---|
| | api.doRestTest(); |
---|
| | for (String result : api.getResults()) { |
---|
| | System.out.println(result); |
---|
| | } |
---|
| | System.out.println(api.getJudgeResult()); |
---|
| | } |
---|
| | |
---|
| | private void init() { |
---|
| | |
---|
| | static private void init() { |
---|
| | api.setAccount("http://nitta-lab-www.is.konan-u.ac.jp/CactusServer/rest/accounts/"); |
---|
| | formParam.add(new RestParam("userID", "yyy")); |
---|
| | formParam.add(new RestParam("userName", "abc")); |
---|
| | formParam.add(new RestParam("userPass", "abc")); |
---|
| | } |
---|
| | |
---|
| | } |
---|
| | |
---|
| | |