Examples of SimpleMessage


Examples of org.apache.logging.log4j.message.SimpleMessage

    public void testFull1() {
        final RootThrowablePatternConverter converter = RootThrowablePatternConverter.newInstance(null);
        final Throwable cause = new NullPointerException("null pointer");
        final Throwable parent = new IllegalArgumentException("IllegalArgument", cause);
        final LogEvent event = new Log4jLogEvent("testLogger", null, this.getClass().getName(), Level.DEBUG,
                new SimpleMessage("test exception"), parent);
        final StringBuilder sb = new StringBuilder();
        converter.format(event, sb);
        final String result = sb.toString();
        // System.out.print(result);
        assertTrue("Missing Exception",
View Full Code Here

Examples of org.apache.logging.log4j.message.SimpleMessage

            }
        } catch (IllegalArgumentException e) {
            parent = e;
        }
        final LogEvent event = new Log4jLogEvent("testLogger", null, this.getClass().getName(), Level.DEBUG,
                new SimpleMessage("test exception"), parent);
        final StringBuilder sb = new StringBuilder();
        converter.format(event, sb);
        final String result = sb.toString();
        // System.out.print(result);
        assertTrue("Missing Exception",
View Full Code Here

Examples of org.apache.logging.log4j.message.SimpleMessage

    @Test
    public void testSerialization() throws Exception {
        final SerializedLayout layout = SerializedLayout.createLayout();
        final Throwable throwable = new LoggingException("Test");
        final LogEvent event = new Log4jLogEvent(this.getClass().getName(), null,
            "org.apache.logging.log4j.core.Logger", Level.INFO, new SimpleMessage("Hello, world!"), throwable);
        final byte[] result = layout.toByteArray(event);
        assertNotNull(result);
        FileOutputStream fos = new FileOutputStream(DAT_PATH);
        fos.write(layout.getHeader());
        fos.write(result);
View Full Code Here

Examples of org.apache.logging.log4j.message.SimpleMessage

        System.clearProperty(ClockFactory.PROPERTY_NAME);
    }

    @Test
    public void testJavaIoSerializable() throws Exception {
        final Log4jLogEvent evt = new Log4jLogEvent("some.test", null, Strings.EMPTY, Level.INFO, new SimpleMessage(
                "abc"), null);

        byte[] binary = serialize(evt);
        final Log4jLogEvent evt2 = deserialize(binary);
View Full Code Here

Examples of org.apache.logging.log4j.message.SimpleMessage

    }

    @Test
    public void testJavaIoSerializableWithThrown() throws Exception {
        final Error thrown = new InternalError("test error");
        final Log4jLogEvent evt = new Log4jLogEvent("some.test", null, Strings.EMPTY, Level.INFO, new SimpleMessage(
                "abc"), thrown);

        byte[] binary = serialize(evt);
        final Log4jLogEvent evt2 = deserialize(binary);
View Full Code Here

Examples of org.apache.logging.log4j.message.SimpleMessage

    public void testJavaIoSerializableWithUnknownThrowable() throws Exception {
        final String loggerName = "some.test";
        final Marker marker = null;
        final String loggerFQN = Strings.EMPTY;
        final Level level = Level.INFO;
        final Message msg = new SimpleMessage("abc");
        final String threadName = Thread.currentThread().getName();
        final String errorMessage = "OMG I've been deleted!";
       
        // DO NOT DELETE THIS COMMENT:
        // UNCOMMENT TO RE-GENERATE SERIALIZED EVENT WHEN UPDATING THIS TEST.
View Full Code Here

Examples of org.apache.logging.log4j.message.SimpleMessage

    @Test
    public void testNullLevelReplacedWithOFF() throws Exception {
        final Marker marker = null;
        final Throwable t = null;
        final Level NULL_LEVEL = null;
        final Log4jLogEvent evt = new Log4jLogEvent("some.test", marker, Strings.EMPTY, NULL_LEVEL, new SimpleMessage(
                "abc"), t);
        assertEquals(Level.OFF, evt.getLevel());
    }
View Full Code Here

Examples of org.beangle.notification.SimpleMessage

public class ConsoleNotifierTest {

  @Test
  public void testSendMessage() throws Exception {
    Notifier<Message> notifier = new ConsoleNotifier();
    SimpleMessage context = new SimpleMessage();
    context.setText("hello world");
    notifier.deliver(context);
  }
View Full Code Here

Examples of org.codehaus.groovy.control.messages.SimpleMessage

            }
            consideredClass = consideredClass.getSuperClass();
        }
        if (foundAdd || foundRemove || foundFire) {
            sourceUnit.getErrorCollector().addErrorAndContinue(
                new SimpleMessage("@Bindable cannot be processed on "
                    + declaringClass.getName()
                    + " because some but not all of addPropertyChangeListener, removePropertyChange, and firePropertyChange were declared in the current or super classes.",
                sourceUnit)
            );
            return false;
View Full Code Here

Examples of org.codehaus.groovy.control.messages.SimpleMessage

            }
            consideredClass = consideredClass.getSuperClass();
        }
        if (foundAdd || foundRemove || foundFire) {
            sourceUnit.getErrorCollector().addErrorAndContinue(
                new SimpleMessage("@Vetoable cannot be processed on "
                    + declaringClass.getName()
                    + " because some but not all of addVetoableChangeListener, removeVetoableChange, and fireVetoableChange were declared in the current or super classes.",
                sourceUnit)
            );
            return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.