Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.ILogListener


   * Before jumping into an Eclipse test, this method should be called
   * so we can catch any exceptions that occur during loading, and
   * print them out to the log.
   */
  protected void addLogListener() {
    Platform.addLogListener(new ILogListener() {
      @Override
      public void logging(IStatus status, String plugin) {
        // rethrow if exception is caught
        if (status.getSeverity() == IStatus.ERROR) {
          // JUnit won't actually catch this, because the Platform is
View Full Code Here


            "  }",
            "}");
    frame.refresh();
    // add log listener for exception validation
    ILog log = DesignerPlugin.getDefault().getLog();
    ILogListener logListener = new ILogListener() {
      public void logging(IStatus status, String plugin) {
        assertEquals(IStatus.ERROR, status.getSeverity());
        Throwable exception = status.getException();
        assertThat(exception).isExactlyInstanceOf(IllegalStateException.class);
        assertEquals("Bad getElement()", exception.getMessage());
View Full Code Here

    frame.refresh();
    String originalSource = m_lastEditor.getSource();
    // add log listener for exception validation
    final AtomicInteger exceptionCount = new AtomicInteger();
    ILog log = DesignerPlugin.getDefault().getLog();
    ILogListener logListener = new ILogListener() {
      public void logging(IStatus status, String plugin) {
        exceptionCount.getAndIncrement();
      }
    };
    // temporary intercept logging
View Full Code Here

  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_unknownProperty() throws Exception {
    ILog log = DesignerPlugin.getDefault().getLog();
    ILogListener logListener = new ILogListener() {
      public void logging(IStatus status, String plugin) {
        assertEquals(IStatus.ERROR, status.getSeverity());
        assertEquals(DesignerPlugin.PLUGIN_ID, status.getPlugin());
        assertEquals(IStatus.ERROR, status.getCode());
        assertInstanceOf(IllegalArgumentException.class, status.getException());
View Full Code Here

  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_unknownProperty() throws Exception {
    ILog log = DesignerPlugin.getDefault().getLog();
    ILogListener logListener = new ILogListener() {
      public void logging(IStatus status, String plugin) {
        assertEquals(IStatus.ERROR, status.getSeverity());
        assertEquals(DesignerPlugin.PLUGIN_ID, status.getPlugin());
        assertEquals(IStatus.ERROR, status.getCode());
        assertInstanceOf(IllegalArgumentException.class, status.getException());
View Full Code Here

  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_unknownProperty() throws Exception {
    ILog log = DesignerPlugin.getDefault().getLog();
    ILogListener logListener = new ILogListener() {
      public void logging(IStatus status, String plugin) {
        assertEquals(IStatus.ERROR, status.getSeverity());
        assertEquals(DesignerPlugin.PLUGIN_ID, status.getPlugin());
        assertEquals(IStatus.ERROR, status.getCode());
        assertInstanceOf(IllegalArgumentException.class, status.getException());
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.ILogListener

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.