@Override protected void fillBuffer(CyclicBuffer<ILoggingEvent> cb, StringBuffer sbuf) { int len = cb.length(); for (int i = 0; i < len; i++) { ILoggingEvent event = cb.get(); sbuf.append(layout.doLayout(event)); } }
public int getLength() { if (isStarted()) { return cb.length(); } else { return 0; } }
public List<E> asList() { List<E> tList = new ArrayList<E>(); for(int i = 0; i < length(); i++) { tList.add(get(i)); } return tList; }
@Override protected void fillBuffer(CyclicBuffer<ILoggingEvent> cb, StringBuffer sbuf) { int len = cb.length(); for (int i = 0; i < len; i++) { ILoggingEvent event = cb.get(); sbuf.append(layout.doLayout(event)); } }
public int getLength() { if (isStarted()) { return cb.length(); } else { return 0; } }
public int getLength() { if (isStarted()) { return cb.length(); } else { return 0; } }
public List<E> asList() { List<E> tList = new ArrayList<E>(); for (int i = 0; i < length(); i++) { tList.add(get(i)); } return tList; }
public List<E> asList() { List<E> tList = new ArrayList<E>(); for(int i = 0; i < length(); i++) { tList.add(get(i)); } return tList; }
public List<E> asList() { List<E> tList = new ArrayList<E>(); for (int i = 0; i < length(); i++) { tList.add(get(i)); } return tList; }
public List<E> asList() { List<E> tList = new ArrayList<E>(); for(int i = 0; i < length(); i++) { tList.add(get(i)); } return tList; }
public List<E> asList() { List<E> tList = new ArrayList<E>(); for(int i = 0; i < length(); i++) { tList.add(get(i)); } return tList; }
@Override protected void fillBuffer(CyclicBuffer<IAccessEvent> cb, StringBuffer sbuf) { int len = cb.length(); for (int i = 0; i < len; i++) { // sbuf.append(MimeUtility.encodeText(layout.format(cb.getOrCreate()))); IAccessEvent event = cb.get(); sbuf.append(layout.doLayout(event)); } }
@Override protected void fillBuffer(StringBuffer sbuf) { int len = cb.length(); for (int i = 0; i < len; i++) { // sbuf.append(MimeUtility.encodeText(layout.format(cb.get()))); ILoggingEvent event = cb.get(); sbuf.append(layout.doLayout(event)); } }
@Override protected void fillBuffer(CyclicBuffer<ILoggingEvent> cb, StringBuffer sbuf) { int len = cb.length(); for (int i = 0; i < len; i++) { ILoggingEvent event = cb.get(); sbuf.append(layout.doLayout(event)); } }
@Override protected void fillBuffer(CyclicBuffer<ILoggingEvent> cb, StringBuffer sbuf) { int len = cb.length(); for (int i = 0; i < len; i++) { ILoggingEvent event = cb.get(); sbuf.append(layout.doLayout(event)); } }
@Override protected void fillBuffer(CyclicBuffer<ILoggingEvent> cb, StringBuffer sbuf) { int len = cb.length(); for (int i = 0; i < len; i++) { ILoggingEvent event = cb.get(); sbuf.append(layout.doLayout(event)); } }
@Override protected void fillBuffer(CyclicBuffer<ILoggingEvent> cb, StringBuffer sbuf) { int len = cb.length(); for (int i = 0; i < len; i++) { ILoggingEvent event = cb.get(); sbuf.append(layout.doLayout(event)); } }
void assertSize(CyclicBuffer<String> cb, int size) { assertEquals(size, cb.length()); } @Test
@Test public void testAppendNonTriggeringEvent() { LoggingEvent event = new LoggingEvent(); event.setThreadName("thead name"); event.setLevel(Level.DEBUG); appender.subAppend(cb, event); assertEquals(1, cb.length()); }
@Test public void destroy() { long now = 3000; CyclicBuffer<Object> cb = tracker.getOrCreate(key, now); cb.add(new Object()); assertEquals(1, cb.length()); tracker.endOfLife(key); now += CyclicBufferTracker.LINGERING_TIMEOUT + 10; tracker.removeStaleComponents(now); assertEquals(0, tracker.liveKeysAsOrderedList().size()); assertEquals(0, tracker.getComponentCount()); assertEquals(0, cb.length()); }