Skip to content

Commit

Permalink
#128 all tests are private
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Dec 26, 2023
1 parent a6a88c5 commit 14ea160
Show file tree
Hide file tree
Showing 22 changed files with 70 additions and 70 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -134,7 +134,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
<plugin>
<groupId>com.qulice</groupId>
<artifactId>qulice-maven-plugin</artifactId>
<version>0.21.1</version>
<version>0.22.0</version>
<configuration>
<excludes combine.children="append">
<exclude>findbugs:.*</exclude>
Expand Down
Expand Up @@ -60,7 +60,7 @@ public final class MulticolorLayoutIntegrationTest {
* when -Dcom.jcabi.log.coloring=false.
*/
@Test
public void disablesDefaultColor() {
void disablesDefaultColor() {
final MulticolorLayout layout = new MulticolorLayout();
layout.setConversionPattern(
MulticolorLayoutIntegrationTest.CONV_PATTERN
Expand Down Expand Up @@ -97,7 +97,7 @@ public void disablesDefaultColor() {
* MulticolorLayout disables the color that overwrites the default one.
*/
@Test
public void disablesOverridenDefaultColor() {
void disablesOverridenDefaultColor() {
final MulticolorLayout layout = new MulticolorLayout();
layout.setConversionPattern("[%color{%p}] %m");
layout.setLevels("DEBUG:2;10");
Expand Down Expand Up @@ -134,7 +134,7 @@ public void disablesOverridenDefaultColor() {
* when -Dcom.jcabi.log.coloring=false.
*/
@Test
public void disablesConstantColor() {
void disablesConstantColor() {
final MulticolorLayout layout = new MulticolorLayout();
layout.setConversionPattern("[%color-blue{%p}] %color-blue{%m}");
final LoggingEvent event = Mockito.mock(LoggingEvent.class);
Expand Down Expand Up @@ -169,7 +169,7 @@ public void disablesConstantColor() {
* MulticolorLayout disables the color that overwrites the constant one.
*/
@Test
public void disablesOverridenConstantColor() {
void disablesOverridenConstantColor() {
final MulticolorLayout layout = new MulticolorLayout();
layout.setConversionPattern("[%color-red{%p}] %color-red{%m}");
layout.setColors("red:12");
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/com/jcabi/log/ConversionPatternTest.java
Expand Up @@ -50,7 +50,7 @@ public final class ConversionPatternTest {
private static final Colors COLORS = new Colors();

@Test
public void testGenerateNoReplacement() {
void testGenerateNoReplacement() {
MatcherAssert.assertThat(
convert(""),
Matchers.equalTo("")
Expand All @@ -74,15 +74,15 @@ public void testGenerateNoReplacement() {
}

@Test
public void testGenerateEmpty() {
void testGenerateEmpty() {
MatcherAssert.assertThat(
convert("%color{}"),
Matchers.equalTo(colorWrap(""))
);
}

@Test
public void testGenerateSimple() {
void testGenerateSimple() {
MatcherAssert.assertThat(
convert("%color{Hello World}"),
Matchers.equalTo(colorWrap("Hello World"))
Expand All @@ -100,7 +100,7 @@ public void testGenerateSimple() {
}

@Test
public void testGenerateCurlyBraces() {
void testGenerateCurlyBraces() {
MatcherAssert.assertThat(
ConversionPatternTest.convert("%color{%c{1}}"),
Matchers.equalTo(ConversionPatternTest.colorWrap("%c{1}"))
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/jcabi/log/DecorsManagerTest.java
Expand Up @@ -41,15 +41,15 @@
public final class DecorsManagerTest {

@Test
public void hasBuiltInDecors() throws Exception {
void hasBuiltInDecors() throws Exception {
MatcherAssert.assertThat(
DecorsManager.decor("nano", 1L),
Matchers.instanceOf(NanoDecor.class)
);
}

@Test
public void throwsExceptionForAbsentDecor() {
void throwsExceptionForAbsentDecor() {
Assertions.assertThrows(
DecorException.class,
() -> DecorsManager.decor("non-existing-formatter", null)
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/jcabi/log/DomDecorTest.java
Expand Up @@ -46,7 +46,7 @@
public final class DomDecorTest {

@Test
public void convertsDocumentToText() throws Exception {
void convertsDocumentToText() throws Exception {
final Document doc = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().newDocument();
doc.appendChild(doc.createElement("root"));
Expand All @@ -60,7 +60,7 @@ public void convertsDocumentToText() throws Exception {
}

@Test
public void convertsNullToText() throws Exception {
void convertsNullToText() throws Exception {
final Formattable decor = new DomDecor(null);
final Appendable dest = Mockito.mock(Appendable.class);
final Formatter fmt = new Formatter(dest);
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/jcabi/log/ExceptionDecorTest.java
Expand Up @@ -44,7 +44,7 @@
public final class ExceptionDecorTest {

@Test
public void convertsExceptionToText() throws Exception {
void convertsExceptionToText() throws Exception {
final Formattable decor = new ExceptionDecor(new IOException("ouch!"));
final Appendable dest = Mockito.mock(Appendable.class);
final Formatter fmt = new Formatter(dest);
Expand All @@ -64,7 +64,7 @@ public void convertsExceptionToText() throws Exception {
}

@Test
public void convertsNullToText() throws Exception {
void convertsNullToText() throws Exception {
final Formattable decor = new ExceptionDecor(null);
final Appendable dest = Mockito.mock(Appendable.class);
final Formatter fmt = new Formatter(dest);
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/jcabi/log/FileDecorTest.java
Expand Up @@ -49,7 +49,7 @@
public final class FileDecorTest {

@Test
public void simplyWorks() {
void simplyWorks() {
MatcherAssert.assertThat(
new Printed(new FileDecor("/tmp/test-me.txt"), 0, 0, 0).toString(),
Matchers.endsWith("test-me.txt")
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/jcabi/log/LineNumberTest.java
Expand Up @@ -54,7 +54,7 @@ public final class LineNumberTest {
private static final String CONV_PATTERN = "%c:%L";

@Test
public void testLineNumber() throws Exception {
void testLineNumber() throws Exception {
final PatternLayout layout = new PatternLayout();
layout.setConversionPattern(LineNumberTest.CONV_PATTERN);
final org.apache.log4j.Logger root = LogManager.getRootLogger();
Expand Down
22 changes: 11 additions & 11 deletions src/test/java/com/jcabi/log/LoggerTest.java
Expand Up @@ -47,38 +47,38 @@
public final class LoggerTest {

@Test
public void detectsLoggerNameCorrectly() {
void detectsLoggerNameCorrectly() {
// not implemented yet
}

@Test
public void detectsNameOfStaticSource() {
void detectsNameOfStaticSource() {
// not implemented yet
}

@Test
public void setsLoggingLevel() {
void setsLoggingLevel() {
// not implemented yet
}

@Test
public void doesntFormatArraysSinceTheyAreVarArgs() {
void doesntFormatArraysSinceTheyAreVarArgs() {
Assertions.assertThrows(
IllegalArgumentException.class,
() -> Logger.format("array: %[list]s", new Object[] {"hi", 1})
);
}

@Test
public void interpretsArraysAsVarArgs() {
void interpretsArraysAsVarArgs() {
MatcherAssert.assertThat(
Logger.format("array: %s : %d", new Object[] {"hello", 2}),
Matchers.is("array: hello : 2")
);
}

@Test
public void providesOutputStream() throws Exception {
void providesOutputStream() throws Exception {
final OutputStream stream = Logger.stream(Level.INFO, this);
final PrintWriter writer = new PrintWriter(
new OutputStreamWriter(stream, "UTF-8")
Expand All @@ -90,23 +90,23 @@ public void providesOutputStream() throws Exception {
}

@Test
public void throwsWhenParamsLessThanFormatArgs() {
void throwsWhenParamsLessThanFormatArgs() {
Assertions.assertThrows(
ArrayIndexOutOfBoundsException.class,
() -> Logger.format("String %s Char %c Number %d", "howdy", 'x')
);
}

@Test
public void throwsWhenParamsMoreThanFormatArgs() {
void throwsWhenParamsMoreThanFormatArgs() {
Assertions.assertThrows(
IllegalArgumentException.class,
() -> Logger.format("String %s Number %d Char %c", "hey", 1, 'x', 2)
);
}

@Test
public void checksLogLevel() throws Exception {
void checksLogLevel() throws Exception {
LogManager.getRootLogger().setLevel(org.apache.log4j.Level.INFO);
TimeUnit.MILLISECONDS.sleep(1L);
MatcherAssert.assertThat(
Expand All @@ -120,12 +120,12 @@ public void checksLogLevel() throws Exception {
}

@Test
public void usesStringAsLoggerName() {
void usesStringAsLoggerName() {
Logger.info("com.jcabi.log...why.not", "hello, %s!", "world!");
}

@Test
public void findsArgsByPositions() {
void findsArgsByPositions() {
final String first = "xyz";
final String second = "ddd";
MatcherAssert.assertThat(
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/jcabi/log/MsDecorTest.java
Expand Up @@ -70,7 +70,7 @@ public void testLogsRight(final long value, final String text,
}

@Test
public void testPrintsNullRight() {
void testPrintsNullRight() {
MatcherAssert.assertThat(
new Logged(new MsDecor(null), 0, 0, 0),
Matchers.hasToString("NULL")
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/jcabi/log/MulticolorLayoutTest.java
Expand Up @@ -51,7 +51,7 @@ public final class MulticolorLayoutTest {
private static final String CONV_PATTERN = "[%color{%p}] %color{%m}";

@Test
public void transformsLoggingEventToText() {
void transformsLoggingEventToText() {
final MulticolorLayout layout = new MulticolorLayout();
layout.setConversionPattern(MulticolorLayoutTest.CONV_PATTERN);
final LoggingEvent event = Mockito.mock(LoggingEvent.class);
Expand All @@ -66,7 +66,7 @@ public void transformsLoggingEventToText() {
}

@Test
public void overwriteDefaultColor() {
void overwriteDefaultColor() {
final MulticolorLayout layout = new MulticolorLayout();
layout.setConversionPattern(MulticolorLayoutTest.CONV_PATTERN);
layout.setLevels("INFO:2;10");
Expand All @@ -82,7 +82,7 @@ public void overwriteDefaultColor() {
}

@Test
public void rendersCustomConstantColor() {
void rendersCustomConstantColor() {
final MulticolorLayout layout = new MulticolorLayout();
layout.setConversionPattern("%color-red{%p} %m");
final LoggingEvent event = Mockito.mock(LoggingEvent.class);
Expand All @@ -95,7 +95,7 @@ public void rendersCustomConstantColor() {
}

@Test
public void overwriteCustomConstantColor() {
void overwriteCustomConstantColor() {
final MulticolorLayout layout = new MulticolorLayout();
layout.setConversionPattern("%color-white{%p} %m");
layout.setColors("white:10");
Expand All @@ -109,7 +109,7 @@ public void overwriteCustomConstantColor() {
}

@Test
public void rendersAnsiConstantColor() {
void rendersAnsiConstantColor() {
final MulticolorLayout layout = new MulticolorLayout();
layout.setConversionPattern("%color-0;0;31{%p} %m");
final LoggingEvent event = Mockito.mock(LoggingEvent.class);
Expand All @@ -122,7 +122,7 @@ public void rendersAnsiConstantColor() {
}

@Test
public void throwsOnIllegalColorName() {
void throwsOnIllegalColorName() {
Assertions.assertThrows(
IllegalArgumentException.class,
() -> {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/jcabi/log/NanoDecorTest.java
Expand Up @@ -70,7 +70,7 @@ public void testLogsRight(final long nano, final String text,
}

@Test
public void testPrintsNullRight() {
void testPrintsNullRight() {
MatcherAssert.assertThat(
new Logged(new NanoDecor(null), 0, 0, 0),
Matchers.hasToString("NULL")
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/jcabi/log/ParseableInformationTest.java
Expand Up @@ -60,7 +60,7 @@ public final void parsesTheInformationCorrectly() {
* ParseableInformation can throw an an exception when parsing wrong info.
*/
@Test
public final void throwsAnExceptionWhenParsingSomethingWrong() {
final void throwsAnExceptionWhenParsingSomethingWrong() {
final String white = "white";
try {
new ParseableInformation(white).information();
Expand Down
Expand Up @@ -61,7 +61,7 @@ public final void parsesCorrectlyTheInformation() {
* not with the right pattern.
*/
@Test
public final void throwsAnExceptionWhenParsingIncorrectInformation() {
final void throwsAnExceptionWhenParsingIncorrectInformation() {
final String wrong = "INFO;10,WARN;32";
try {
new ParseableLevelInformation(wrong).information();
Expand All @@ -85,7 +85,7 @@ public final void throwsAnExceptionWhenParsingIncorrectInformation() {
* with a wrong type of level.
*/
@Test
public final void throwsAnExceptionWhenParsingWrongLevelType() {
final void throwsAnExceptionWhenParsingWrongLevelType() {
try {
new ParseableLevelInformation(
"INFO:2;10,EXTREME:2;32"
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/com/jcabi/log/PreFormatterTest.java
Expand Up @@ -43,7 +43,7 @@ public final class PreFormatterTest {
* PreFormatter can format simple texts.
*/
@Test
public void decoratesArguments() {
void decoratesArguments() {
final PreFormatter pre = new PreFormatter(
"%[com.jcabi.log.DecorMocker]-5.2f and %1$+.6f",
1.0d
Expand All @@ -62,7 +62,7 @@ public void decoratesArguments() {
* PreFormatter can handle missed decors.
*/
@Test
public void formatsEvenWithMissedDecors() {
void formatsEvenWithMissedDecors() {
final PreFormatter pre =
new PreFormatter("ouch: %[missed]s", "test");
MatcherAssert.assertThat(
Expand All @@ -79,7 +79,7 @@ public void formatsEvenWithMissedDecors() {
* PreFormatter can handle directly provided decors.
*/
@Test
public void formatsWithDirectlyProvidedDecors() {
void formatsWithDirectlyProvidedDecors() {
final DecorMocker decor = new DecorMocker("a");
final PreFormatter pre = new PreFormatter("test: %s", decor);
MatcherAssert.assertThat(
Expand All @@ -92,7 +92,7 @@ public void formatsWithDirectlyProvidedDecors() {
* PreFormatter can handle new line specifier.
*/
@Test
public void handleNewLineSpecifier() {
void handleNewLineSpecifier() {
final String fmt = "%s%n%s";
final Object[] args = {"new", "line"};
final PreFormatter pre = new PreFormatter(fmt, args);
Expand All @@ -110,7 +110,7 @@ public void handleNewLineSpecifier() {
* PreFormatter can handle percent specifier.
*/
@Test
public void handlePercentSpecifier() {
void handlePercentSpecifier() {
final String fmt = "%s%%";
final Object[] args = {"percent: "};
final PreFormatter pre = new PreFormatter(fmt, args);
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/jcabi/log/SizeDecorTest.java
Expand Up @@ -70,7 +70,7 @@ public void testLogsRight(final long size, final String text,
}

@Test
public void testPrintsNullRight() {
void testPrintsNullRight() {
MatcherAssert.assertThat(
new Logged(new SizeDecor(null), 0, 0, 0),
Matchers.hasToString("NULL")
Expand Down

0 comments on commit 14ea160

Please sign in to comment.