Package ch.qos.logback.core.status

Examples of ch.qos.logback.core.status.Status


      appendThrowable(sb, s.getThrowable());
    }
    if (s.hasChildren()) {
      Iterator<Status> ite = s.iterator();
      while (ite.hasNext()) {
        Status child = ite.next();
        buildStr(sb, indentation + "  ", child);
      }
    }
  }
View Full Code Here


    assertTrue(result.contains("|-INFO in "+this.getClass().getName()));
  }

  @Test
  public void testNested() {
    Status s0 = new ErrorStatus("test0", this);
    Status s1 = new InfoStatus("test1", this);
    Status s11 = new InfoStatus("test11", this);
    Status s12 = new InfoStatus("test12", this);
    s1.add(s11);
    s1.add(s12);
   
    Status s2 = new InfoStatus("test2", this);
    Status s21 = new InfoStatus("test21", this);
    Status s211 = new WarnStatus("test211", this);
   
    Status s22 = new InfoStatus("test22", this);
    s2.add(s21);
    s2.add(s22);
    s21.add(s211);
   
   
View Full Code Here

    assertTrue(result.contains("    |-WARN in "+this.getClass().getName()));
  }

  @Test
  public void testWithException() {
    Status s0 = new ErrorStatus("test0", this);
    Status s1 = new InfoStatus("test1", this, new Exception("testEx"));
    Status s11 = new InfoStatus("test11", this);
    Status s12 = new InfoStatus("test12", this);
    s1.add(s11);
    s1.add(s12);
   
    Status s2 = new InfoStatus("test2", this);
    Status s21 = new InfoStatus("test21", this);
    Status s211 = new WarnStatus("test211", this);
   
    Status s22 = new InfoStatus("test22", this);
    s2.add(s21);
    s2.add(s22);
    s21.add(s211);
   
    Context context = new ContextBase();
View Full Code Here

    } catch (Exception e) {
      assertTrue(e.getMessage().startsWith("Could not open ["));
    }
    assertTrue(tsl.list.size() + " should be greater than or equal to 1",
            tsl.list.size() >= 1);
    Status s0 = tsl.list.get(0);
    assertTrue(s0.getMessage().startsWith("Could not open ["));
  }
View Full Code Here

    try {
      doTest(filename);
    } catch (Exception e) {
    }
    assertEquals(1, tsl.list.size());
    Status s0 = tsl.list.get(0);
    assertTrue(s0.getMessage().startsWith(CoreConstants.XML_PARSING));
  }
View Full Code Here

      assertEquals(expectedInt, i);
    }

    // check the existence of an ERROR status
    List<Status> statusList = sm.getCopyOfStatusList();
    Status s0 = statusList.get(0);
    assertEquals(Status.ERROR, s0.getLevel());
    assertTrue(s0.getThrowable().getClass() == exceptionClass);
  }
View Full Code Here

    assertTrue(appender.isStarted());
    IOException ex = new IOException("test exception");
    runner.setStopException(ex);
    appender.stop();
   
    Status status = context.getLastStatus();
    assertNotNull(status);   
    assertTrue(status instanceof ErrorStatus);
    assertTrue(status.getMessage().contains(ex.getMessage()));
    assertSame(ex, status.getThrowable());
  }
View Full Code Here

  @Test
  public void testStartNoRemoteAddress() throws Exception {
    receiver.start();
    assertFalse(receiver.isStarted());
    int count = lc.getStatusManager().getCount();
    Status status = lc.getStatusManager().getCopyOfStatusList().get(count - 1);
    assertTrue(status.getMessage().contains("host"));
  }
View Full Code Here

  public void testStartNoPort() throws Exception {
    receiver.setRemoteHost(TEST_HOST_NAME);
    receiver.start();
    assertFalse(receiver.isStarted());
    int count = lc.getStatusManager().getCount();
    Status status = lc.getStatusManager().getCopyOfStatusList().get(count - 1);
    assertTrue(status.getMessage().contains("port"));
  }
View Full Code Here

    receiver.setPort(6000);
    receiver.setRemoteHost(TEST_HOST_NAME);
    receiver.start();
    assertFalse(receiver.isStarted());
    int count = lc.getStatusManager().getCount();
    Status status = lc.getStatusManager().getCopyOfStatusList().get(count - 1);
    assertTrue(status.getMessage().contains("unknown host"));
  }
View Full Code Here

TOP

Related Classes of ch.qos.logback.core.status.Status

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.