Skip to content

Commit

Permalink
Merge pull request #2 from gorillalabs/v0.3.0
Browse files Browse the repository at this point in the history
add tests
  • Loading branch information
jenslehnhoff authored Jul 28, 2016
2 parents 0ea3177 + 940010a commit 9ce1b12
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
29 changes: 3 additions & 26 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
# Release Notes

## v0.3.0 - July 27st, 2016
## v0.3.0 - July 28st, 2016

....



# Release Notes

## v0.2.0 - July 21st, 2016

- [#2](https://github.com/walmartlabs/logback-riemann-appender/pull/2) - Allow configuration via system property ([@dbriones](https://github.com/dbriones))
- [#1](https://github.com/walmartlabs/logback-riemann-appender/pull/1) - 109827790 reimann logback appender tcp support ([@hlship](https://github.com/hlship))

The RiemannAdapter can now be configured to use TCP, with the new `tcp` property.
The default (for now) is to continue using UDP.

Incompatible changes:

Some properties of RiemannAdapter have changed from string to an appropriate type
(int or boolean);

- [80bd900](https://github.com/walmartlabs/logback-riemann-appender/commit/80bd9003e79ad48ae23c946f614aae19276f6ef7) - Revert project version to 0.1.5 in advance of release (Dante Briones)
- [2a54605](https://github.com/walmartlabs/logback-riemann-appender/commit/2a54605a2d17e5f34b1174268ef0079531c9b8c5) - Log the contents of the MDC in debug mode. (Dante Briones)
- [29e3588](https://github.com/walmartlabs/logback-riemann-appender/commit/29e358802d7b01c526ef9b015b8419db190ebd2f) - Revert `riemann-java-client` to 0.2.8 (Dante Briones)

Pivotal issues closed:
- [109827790](https://www.pivotaltracker.com/story/show/109827790) - Add TCP support to `logback-riemann-appender`
- [#2](https://github.com/gorillalabs/logback-riemann-appender/pull/2) - add junit tests
- [#1](https://github.com/gorillalabs/logback-riemann-appender/pull/1) - 0ea3177 add missing service name and event state
20 changes: 20 additions & 0 deletions test/java/com/walmartlabs/logback/RiemannAppenderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.classic.spi.LoggingEvent;
import com.aphyr.riemann.client.EventDSL;
import org.junit.Test;

import java.lang.reflect.Method;
import java.net.InetAddress;
import java.util.Map;
import java.util.UUID;
Expand Down Expand Up @@ -66,6 +68,20 @@ public void hostnameShouldDefaultToAddressOfLocalMachine() throws Exception {
assertThat(appender.toString(), containsString("hostname=" + hostname));
}

@Test
public void serviceShouldDefault() throws Exception {
RiemannAppender<ILoggingEvent> appender = new RiemannAppender<ILoggingEvent>();
assertThat(appender.toString(), containsString("serviceName=*no-service-name*"));
}

@Test
public void serviceName() throws Exception {
String serviceName = UUID.randomUUID().toString();
RiemannAppender<ILoggingEvent> appender = new RiemannAppender<ILoggingEvent>();
appender.setServiceName(serviceName);
assertThat(appender.toString(), containsString("serviceName=" + serviceName));
}

@Test
public void hostnameShouldBeOverridableViaSystemProperty() throws Exception {
String hostname = UUID.randomUUID().toString();
Expand Down Expand Up @@ -115,4 +131,8 @@ private static class TestErrorEvent extends LoggingEvent {
private static class TestInfoEvent extends LoggingEvent {
public Level getLevel() { return Level.INFO; }
}

private static class TestDebugEvent extends LoggingEvent {
public Level getLevel() { return Level.DEBUG; }
}
}

0 comments on commit 9ce1b12

Please sign in to comment.