Search in sources :

Example 1 with MpmcArrayQueue

use of org.jctools.queues.MpmcArrayQueue in project logging-log4j2 by apache.

the class RecyclerFactoriesTest method test_RecyclerFactoryConverter_using_XML_config.

@Test
@LoggerContextSource("recyclerFactoryCustomizedJsonTemplateLayoutLogging.xml")
void test_RecyclerFactoryConverter_using_XML_config(@Named(value = "List") final ListAppender appender) throws Exception {
    final JsonTemplateLayout layout = (JsonTemplateLayout) appender.getLayout();
    final Field field = JsonTemplateLayout.class.getDeclaredField("contextRecycler");
    field.setAccessible(true);
    final QueueingRecycler<?> contextRecycler = (QueueingRecycler<?>) field.get(layout);
    final MpmcArrayQueue<?> queue = (MpmcArrayQueue<?>) contextRecycler.getQueue();
    Assertions.assertThat(queue.capacity()).isEqualTo(512);
}
Also used : Field(java.lang.reflect.Field) MpmcArrayQueue(org.jctools.queues.MpmcArrayQueue) JsonTemplateLayout(org.apache.logging.log4j.layout.template.json.JsonTemplateLayout) Test(org.junit.jupiter.api.Test) LoggerContextSource(org.apache.logging.log4j.core.test.junit.LoggerContextSource)

Aggregations

Field (java.lang.reflect.Field)1 LoggerContextSource (org.apache.logging.log4j.core.test.junit.LoggerContextSource)1 JsonTemplateLayout (org.apache.logging.log4j.layout.template.json.JsonTemplateLayout)1 MpmcArrayQueue (org.jctools.queues.MpmcArrayQueue)1 Test (org.junit.jupiter.api.Test)1