### Question:
SyslogStartConverter extends ClassicConverter { public String convert(ILoggingEvent event) { StringBuilder sb = new StringBuilder(); int pri = facility + LevelToSyslogSeverity.convert(event); sb.append("<"); sb.append(pri); sb.append(">"); sb.append(computeTimeStampString(event.getTimeStamp())); sb.append(' '); sb.append(localHostName); sb.append(' '); return sb.toString(); }  void start(); String convert(ILoggingEvent event);  }### Answer:
@Test public void datesLessThanTen() { LoggingEvent le = createLoggingEvent(); calendar.set(2012, Calendar.AUGUST, 7, 13, 15, 0); le.setTimeStamp(calendar.getTimeInMillis()); assertEquals("<191>Aug 7 13:15:00 " + HOSTNAME + " ", converter.convert(le)); }
@Test public void datesGreaterThanTen() { LoggingEvent le = createLoggingEvent(); calendar.set(2012, Calendar.OCTOBER, 11, 22, 14, 15); le.setTimeStamp(calendar.getTimeInMillis()); assertEquals("<191>Oct 11 22:14:15 " + HOSTNAME + " ", converter.convert(le)); }
@Test public void multipleConversions() { LoggingEvent le = createLoggingEvent(); calendar.set(2012, Calendar.OCTOBER, 11, 22, 14, 15); le.setTimeStamp(calendar.getTimeInMillis()); assertEquals("<191>Oct 11 22:14:15 " + HOSTNAME + " ", converter.convert(le)); assertEquals("<191>Oct 11 22:14:15 " + HOSTNAME + " ", converter.convert(le)); calendar.set(2012, Calendar.OCTOBER, 11, 22, 14, 16); le.setTimeStamp(calendar.getTimeInMillis()); assertEquals("<191>Oct 11 22:14:16 " + HOSTNAME + " ", converter.convert(le)); }
@Test public void hostnameShouldNotIncludeDomain() throws Exception { String host = HOSTNAME; final int firstPeriod = host.indexOf("."); if (firstPeriod != -1) { host = host.substring(0, firstPeriod); } LoggingEvent le = createLoggingEvent(); calendar.set(2012, Calendar.OCTOBER, 11, 22, 14, 15); le.setTimeStamp(calendar.getTimeInMillis()); assertEquals("<191>Oct 11 22:14:15 " + host + " ", converter.convert(le)); }