use of com.vip.saturn.job.executor.utils.LogbackListAppender in project Saturn by vipshop.
the class JsonParseObjectTest method test_E_lessFieldReturnCode.
/**
* 少returnCode,默认为0
*/
@Test
public void test_E_lessFieldReturnCode() throws Exception {
LogbackListAppender logbackListAppender = new LogbackListAppender();
logbackListAppender.addToLogger(ScriptJobRunner.class);
logbackListAppender.start();
SaturnJobReturn saturnJobReturn = readSaturnJobReturn("/SaturnJobReturnLessFieldReturnCode");
SaturnJobReturn expect = new SaturnJobReturn(0, "hello world", 200);
HashMap<String, String> prop = new HashMap();
prop.put("key", "value");
expect.setProp(prop);
assertThat(logbackListAppender.getLastMessage()).isNull();
assertThat(saturnJobReturn).isNotNull().isEqualToComparingFieldByField(expect);
}
use of com.vip.saturn.job.executor.utils.LogbackListAppender in project Saturn by vipshop.
the class JsonParseObjectTest method test_A_normal.
@Test
public void test_A_normal() throws Exception {
LogbackListAppender logbackListAppender = new LogbackListAppender();
logbackListAppender.addToLogger(ScriptJobRunner.class);
logbackListAppender.start();
SaturnJobReturn saturnJobReturn = readSaturnJobReturn("/SaturnJobReturnNormal");
SaturnJobReturn expect = new SaturnJobReturn(500, "hello world", 200);
HashMap<String, String> prop = new HashMap();
prop.put("key", "value");
expect.setProp(prop);
assertThat(logbackListAppender.getLastMessage()).isNull();
assertThat(saturnJobReturn).isNotNull().isEqualToComparingFieldByField(expect);
}
use of com.vip.saturn.job.executor.utils.LogbackListAppender in project Saturn by vipshop.
the class JsonParseObjectTest method test_D_lessFieldProp.
/**
* 少prop,默认为空
*/
@Test
public void test_D_lessFieldProp() throws Exception {
LogbackListAppender logbackListAppender = new LogbackListAppender();
logbackListAppender.addToLogger(ScriptJobRunner.class);
logbackListAppender.start();
SaturnJobReturn saturnJobReturn = readSaturnJobReturn("/SaturnJobReturnLessFieldProp");
SaturnJobReturn expect = new SaturnJobReturn(500, "hello world", 200);
assertThat(logbackListAppender.getLastMessage()).isNull();
assertThat(saturnJobReturn).isNotNull().isEqualToComparingFieldByField(expect);
}
use of com.vip.saturn.job.executor.utils.LogbackListAppender in project Saturn by vipshop.
the class JsonParseObjectTest method test_F_lessFieldReturnMsg.
/**
* 少returnMsg,默认为空
*/
@Test
public void test_F_lessFieldReturnMsg() throws Exception {
LogbackListAppender logbackListAppender = new LogbackListAppender();
logbackListAppender.addToLogger(ScriptJobRunner.class);
logbackListAppender.start();
SaturnJobReturn saturnJobReturn = readSaturnJobReturn("/SaturnJobReturnLessFieldReturnMsg");
SaturnJobReturn expect = new SaturnJobReturn(500, null, 200);
HashMap<String, String> prop = new HashMap();
prop.put("key", "value");
expect.setProp(prop);
assertThat(logbackListAppender.getLastMessage()).isNull();
assertThat(saturnJobReturn).isNotNull().isEqualToComparingFieldByField(expect);
}
use of com.vip.saturn.job.executor.utils.LogbackListAppender in project Saturn by vipshop.
the class JsonParseObjectTest method test_H_blank.
/**
* 没有内容
*/
@Test
public void test_H_blank() throws Exception {
LogbackListAppender logbackListAppender = new LogbackListAppender();
logbackListAppender.addToLogger(ScriptJobRunner.class);
logbackListAppender.start();
SaturnJobReturn saturnJobReturn = readSaturnJobReturn("/SaturnJobReturnBlank");
assertThat(logbackListAppender.getLastMessage()).isNull();
assertThat(saturnJobReturn).isNull();
}
Aggregations