use of org.apache.dubbo.common.status.Status in project dubbo by alibaba.
the class LoadStatusCheckerTest method test.
@Test
public void test() throws Exception {
LoadStatusChecker statusChecker = new LoadStatusChecker();
Status status = statusChecker.check();
assertThat(status, notNullValue());
logger.info("load status level: " + status.getLevel());
logger.info("load status message: " + status.getMessage());
}
use of org.apache.dubbo.common.status.Status in project dubbo by alibaba.
the class StatusUtilsTest method testGetSummaryStatus1.
@Test
public void testGetSummaryStatus1() throws Exception {
Status status1 = new Status(Status.Level.ERROR);
Status status2 = new Status(Status.Level.WARN);
Status status3 = new Status(Status.Level.OK);
Map<String, Status> statuses = new HashMap<String, Status>();
statuses.put("status1", status1);
statuses.put("status2", status2);
statuses.put("status3", status3);
Status status = StatusUtils.getSummaryStatus(statuses);
assertThat(status.getLevel(), is(Status.Level.ERROR));
assertThat(status.getMessage(), containsString("status1"));
assertThat(status.getMessage(), containsString("status2"));
assertThat(status.getMessage(), not(containsString("status3")));
}
use of org.apache.dubbo.common.status.Status in project dubbo by alibaba.
the class StatusUtilsTest method testGetSummaryStatus3.
@Test
public void testGetSummaryStatus3() throws Exception {
Status status1 = new Status(Status.Level.OK);
Map<String, Status> statuses = new HashMap<String, Status>();
statuses.put("status1", status1);
Status status = StatusUtils.getSummaryStatus(statuses);
assertThat(status.getLevel(), is(Status.Level.OK));
assertThat(status.getMessage(), isEmptyOrNullString());
}
use of org.apache.dubbo.common.status.Status in project dubbo by alibaba.
the class SpringStatusCheckerTest method testWithoutApplicationContext.
@Test
public void testWithoutApplicationContext() {
Status status = springStatusChecker.check();
assertThat(status.getLevel(), is(Status.Level.UNKNOWN));
}
use of org.apache.dubbo.common.status.Status in project dubbo by alibaba.
the class SpringStatusCheckerTest method testGenericWebApplicationContext.
@Test
public void testGenericWebApplicationContext() {
SpringExtensionFactory.clearContexts();
GenericWebApplicationContext context = new GenericWebApplicationContext();
SpringExtensionFactory.addApplicationContext(context);
SpringStatusChecker checker = new SpringStatusChecker();
Status status = checker.check();
Assertions.assertEquals(Status.Level.UNKNOWN, status.getLevel());
}
Aggregations