|
|
@@ -17,8 +17,8 @@ import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
|
|
class SeecoderBokClientTest {
|
|
|
|
|
|
- // private final SeecoderBokClient seecoderBokClient = new SeecoderBokClient("http://bok.seec.seecoder.cn");
|
|
|
- private final SeecoderBokClient seecoderBokClient = new SeecoderBokClient("http://localhost:8080");
|
|
|
+ private final SeecoderBokClient seecoderBokClient = new SeecoderBokClient("http://bok.seec.seecoder.cn");
|
|
|
+// private final SeecoderBokClient seecoderBokClient = new SeecoderBokClient("http://localhost:8080");
|
|
|
|
|
|
@Test
|
|
|
void getKnowledgeNode() {
|
|
|
@@ -46,12 +46,42 @@ class SeecoderBokClientTest {
|
|
|
|
|
|
@Test
|
|
|
void getQuestionById() {
|
|
|
- QuestionVO questionVO = seecoderBokClient.getQuestionById("[test]a+b").get();
|
|
|
- assertEquals("1017", questionVO.getId());
|
|
|
+ QuestionVO questionVO = seecoderBokClient.getQuestionById("test-1").get();
|
|
|
+ assertEquals("test-1", questionVO.getId());
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- void updateQuestion() {
|
|
|
+ void updateQuestion1() {
|
|
|
+ CodeQuestionVO codeQuestionVO = new CodeQuestionVO();
|
|
|
+ Map<String, String> inputOutputMapping = new HashMap<>();
|
|
|
+ inputOutputMapping.put("1 2\n", "3\n");
|
|
|
+ inputOutputMapping.put("2 3\n", "5\n");
|
|
|
+ codeQuestionVO.setInputOutputMapping(inputOutputMapping);
|
|
|
+ codeQuestionVO.setStem("a + b");
|
|
|
+ codeQuestionVO.setTitle("测试用_a+b");
|
|
|
+ codeQuestionVO.setId("test-1");
|
|
|
+ codeQuestionVO.setMemoryLimit(100000);
|
|
|
+ codeQuestionVO.setMillisecondLimit(3000);
|
|
|
+ seecoderBokClient.createQuestion(QuestionVOMapper.INSTANCE.codeQuestionToQuestion(codeQuestionVO));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ void updateQuestion2() {
|
|
|
+ CodeQuestionVO codeQuestionVO = new CodeQuestionVO();
|
|
|
+ Map<String, String> inputOutputMapping = new HashMap<>();
|
|
|
+ inputOutputMapping.put("1\n14", "3\n");
|
|
|
+ inputOutputMapping.put("2\n14\n10", "3\n2\n");
|
|
|
+ codeQuestionVO.setInputOutputMapping(inputOutputMapping);
|
|
|
+ codeQuestionVO.setStem("1^2 + 2^2 + ... + n^2");
|
|
|
+ codeQuestionVO.setTitle("测试用_平方和");
|
|
|
+ codeQuestionVO.setId("test-3");
|
|
|
+ codeQuestionVO.setMemoryLimit(100000);
|
|
|
+ codeQuestionVO.setMillisecondLimit(3000);
|
|
|
+ seecoderBokClient.createQuestion(QuestionVOMapper.INSTANCE.codeQuestionToQuestion(codeQuestionVO));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ void updateQuestion3() {
|
|
|
CodeQuestionVO codeQuestionVO = new CodeQuestionVO();
|
|
|
Map<String, String> inputOutputMapping = new HashMap<>();
|
|
|
inputOutputMapping.put("3 2\n", "1\n");
|
|
|
@@ -59,9 +89,9 @@ class SeecoderBokClientTest {
|
|
|
codeQuestionVO.setInputOutputMapping(inputOutputMapping);
|
|
|
codeQuestionVO.setStem("a - b");
|
|
|
codeQuestionVO.setTitle("测试用_a-b");
|
|
|
- codeQuestionVO.setId("test-2");
|
|
|
+ codeQuestionVO.setId("test-3");
|
|
|
codeQuestionVO.setMemoryLimit(100000);
|
|
|
- codeQuestionVO.setMillisecondLimit(3000);
|
|
|
+ codeQuestionVO.setMillisecondLimit(30000);
|
|
|
seecoderBokClient.createQuestion(QuestionVOMapper.INSTANCE.codeQuestionToQuestion(codeQuestionVO));
|
|
|
}
|
|
|
|