Examples of StringFormatterMessageFactory


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

    @Test
    public void testDoEndTagStringFactoryVarPageScope() throws Exception {
        this.tag.setLogger("testDoEndTagStringFactoryVarPageScope");

        MessageFactory factory = new StringFormatterMessageFactory();

        this.tag.setFactory(factory);
        this.tag.setVar("goodbyeCruelWorld");

        assertNull("The default logger should be null.", TagUtils.getDefaultLogger(this.context));
View Full Code Here

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

    @Test
    public void testDoEndTagStringFactoryVarApplicationScope() throws Exception {
        this.tag.setLogger("testDoEndTagStringFactoryVarApplicationScope");

        MessageFactory factory = new StringFormatterMessageFactory();

        this.tag.setFactory(factory);
        this.tag.setVar("goodbyeCruelWorld");
        this.tag.setScope("application");
View Full Code Here

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

    @Test
    public void testDoEndTagStringFactoryDefault() throws Exception {
        this.tag.setLogger("testDoEndTagStringFactoryDefault");

        MessageFactory factory = new StringFormatterMessageFactory();

        this.tag.setFactory(factory);

        assertNull("The default logger should be null.", TagUtils.getDefaultLogger(this.context));
        assertEquals("The return value is not correct.", Tag.EVAL_PAGE, this.tag.doEndTag());
View Full Code Here

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

    @Test
    public void getLogger_Object_StringFormatterMessageFactory() {
        // The TestLogger logger was already created in an instance variable for this class.
        // The message factory is only used when the logger is created.
        final StringFormatterMessageFactory messageFactory = StringFormatterMessageFactory.INSTANCE;
        final TestLogger testLogger = (TestLogger) LogManager.getLogger(new TestStringFormatterMessageFactory(),
                messageFactory);
        assertNotNull(testLogger);
        assertEquals(messageFactory, testLogger.getMessageFactory());
        testLogger.debug("%,d", Integer.MAX_VALUE);
View Full Code Here

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

        assertEquals(" DEBUG " + Integer.MAX_VALUE, testLogger.getEntries().get(0));
    }

    @Test
    public void getLogger_String_StringFormatterMessageFactory() {
        final StringFormatterMessageFactory messageFactory = StringFormatterMessageFactory.INSTANCE;
        final TestLogger testLogger = (TestLogger) LogManager.getLogger("getLogger_String_StringFormatterMessageFactory",
                messageFactory);
        assertNotNull(testLogger);
        assertEquals(messageFactory, testLogger.getMessageFactory());
        testLogger.debug("%,d", Integer.MAX_VALUE);
View Full Code Here

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

        assertEquals(String.format(" DEBUG %,d", Integer.MAX_VALUE), testLogger.getEntries().get(0));
    }

    @Test
    public void getFormatterLogger_String() {
        final StringFormatterMessageFactory messageFactory = StringFormatterMessageFactory.INSTANCE;
        final TestLogger testLogger = (TestLogger) LogManager.getFormatterLogger("getLogger_String_StringFormatterMessageFactory");
        assertNotNull(testLogger);
        assertTrue(testLogger.getMessageFactory() instanceof StringFormatterMessageFactory);
        assertEquals(messageFactory, testLogger.getMessageFactory());
        testLogger.debug("%,d", Integer.MAX_VALUE);
View Full Code Here

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

        assertEquals(String.format(" DEBUG %,d", Integer.MAX_VALUE), testLogger.getEntries().get(0));
    }

    @Test
    public void getLogger_String_MessageFactoryMismatch() {
        final StringFormatterMessageFactory messageFactory = StringFormatterMessageFactory.INSTANCE;
        final TestLogger testLogger = (TestLogger) LogManager.getLogger("getLogger_String_MessageFactoryMismatch",
                messageFactory);
        assertNotNull(testLogger);
        assertEquals(messageFactory, testLogger.getMessageFactory());
        final TestLogger testLogger2 = (TestLogger) LogManager.getLogger("getLogger_String_MessageFactoryMismatch",
View Full Code Here

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

    @Test
    public void getLogger_Object_StringFormatterMessageFactory() {
        // The TestLogger logger was already created in an instance variable for this class.
        // The message factory is only used when the logger is created.
        final StringFormatterMessageFactory messageFactory = StringFormatterMessageFactory.INSTANCE;
        final TestLogger testLogger = (TestLogger) LogManager.getLogger(new TestStringFormatterMessageFactory(),
                messageFactory);
        assertNotNull(testLogger);
        assertEquals(messageFactory, testLogger.getMessageFactory());
        testLogger.debug("%,d", Integer.MAX_VALUE);
View Full Code Here

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

        assertEquals(" DEBUG " + Integer.MAX_VALUE, testLogger.getEntries().get(0));
    }

    @Test
    public void getLogger_String_StringFormatterMessageFactory() {
        final StringFormatterMessageFactory messageFactory = StringFormatterMessageFactory.INSTANCE;
        final TestLogger testLogger = (TestLogger) LogManager.getLogger("getLogger_String_StringFormatterMessageFactory",
                messageFactory);
        assertNotNull(testLogger);
        assertEquals(messageFactory, testLogger.getMessageFactory());
        testLogger.debug("%,d", Integer.MAX_VALUE);
View Full Code Here

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

        assertEquals(String.format(" DEBUG %,d", Integer.MAX_VALUE), testLogger.getEntries().get(0));
    }

    @Test
    public void getFormatterLogger_String() {
        final StringFormatterMessageFactory messageFactory = StringFormatterMessageFactory.INSTANCE;
        final TestLogger testLogger = (TestLogger) LogManager.getFormatterLogger("getLogger_String_StringFormatterMessageFactory");
        assertNotNull(testLogger);
        assertTrue(testLogger.getMessageFactory() instanceof StringFormatterMessageFactory);
        assertEquals(messageFactory, testLogger.getMessageFactory());
        testLogger.debug("%,d", Integer.MAX_VALUE);
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.