-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from eBay/byarger/logger
Fix for ISSUE 7 - Custom logger runtime argument needs default package value
- Loading branch information
Showing
5 changed files
with
53 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
NST/src/test/java/com/ebay/runtime/arguments/CustomLoggersLocationArgumentTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.ebay.runtime.arguments; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.equalTo; | ||
import static org.hamcrest.Matchers.is; | ||
|
||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Test; | ||
|
||
public class CustomLoggersLocationArgumentTest { | ||
|
||
private CustomLoggersLocationArgument logger; | ||
|
||
@BeforeMethod(alwaysRun = true) | ||
public void reset() { | ||
logger = new CustomLoggersLocationArgument(); | ||
} | ||
|
||
@Test | ||
public void getKey() { | ||
String key = logger.getRuntimeArgumentKey(); | ||
assertThat(key, is(equalTo(CustomLoggersLocationArgument.KEY))); | ||
} | ||
|
||
@Test | ||
public void defaultPackageReturned() { | ||
String value = logger.getRuntimeArgumentValue(); | ||
assertThat(value, is(equalTo("com.ebay.custom.loggers"))); | ||
} | ||
|
||
@Test | ||
public void customPackageReturned() { | ||
String input = "com.ebay.test"; | ||
logger.parseRuntimeArgument(input); | ||
String value = logger.getRuntimeArgumentValue(); | ||
assertThat(value, is(equalTo(input))); | ||
} | ||
|
||
@Test | ||
public void overridePackage() { | ||
String input = "com.ebay.test"; | ||
String override = "com.ebay.override"; | ||
logger.parseRuntimeArgument(input); | ||
logger.override(override); | ||
String value = logger.getRuntimeArgumentValue(); | ||
assertThat(value, is(equalTo(override))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters