From 14ea160a719c8b4ca05fb83e2d0e3516a3803393 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Tue, 26 Dec 2023 14:44:31 +0300 Subject: [PATCH] #128 all tests are private --- pom.xml | 2 +- .../log/MulticolorLayoutIntegrationTest.java | 8 +++---- .../com/jcabi/log/ConversionPatternTest.java | 8 +++---- .../java/com/jcabi/log/DecorsManagerTest.java | 4 ++-- src/test/java/com/jcabi/log/DomDecorTest.java | 4 ++-- .../com/jcabi/log/ExceptionDecorTest.java | 4 ++-- .../java/com/jcabi/log/FileDecorTest.java | 2 +- .../java/com/jcabi/log/LineNumberTest.java | 2 +- src/test/java/com/jcabi/log/LoggerTest.java | 22 +++++++++---------- src/test/java/com/jcabi/log/MsDecorTest.java | 2 +- .../com/jcabi/log/MulticolorLayoutTest.java | 12 +++++----- .../java/com/jcabi/log/NanoDecorTest.java | 2 +- .../jcabi/log/ParseableInformationTest.java | 2 +- .../log/ParseableLevelInformationTest.java | 4 ++-- .../java/com/jcabi/log/PreFormatterTest.java | 10 ++++----- .../java/com/jcabi/log/SizeDecorTest.java | 2 +- .../com/jcabi/log/SupplierLoggerTest.java | 10 ++++----- .../java/com/jcabi/log/TextDecorTest.java | 2 +- .../com/jcabi/log/VerboseCallableTest.java | 2 +- .../com/jcabi/log/VerboseProcessTest.java | 20 ++++++++--------- .../com/jcabi/log/VerboseRunnableTest.java | 12 +++++----- .../com/jcabi/log/VerboseThreadsTest.java | 4 ++-- 22 files changed, 70 insertions(+), 70 deletions(-) diff --git a/pom.xml b/pom.xml index 820fe10d..2c24c251 100644 --- a/pom.xml +++ b/pom.xml @@ -134,7 +134,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE. com.qulice qulice-maven-plugin - 0.21.1 + 0.22.0 findbugs:.* diff --git a/src/it/it-decoloring/src/test/java/com/jcabi/log/MulticolorLayoutIntegrationTest.java b/src/it/it-decoloring/src/test/java/com/jcabi/log/MulticolorLayoutIntegrationTest.java index e850f8a9..60b340d7 100644 --- a/src/it/it-decoloring/src/test/java/com/jcabi/log/MulticolorLayoutIntegrationTest.java +++ b/src/it/it-decoloring/src/test/java/com/jcabi/log/MulticolorLayoutIntegrationTest.java @@ -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 @@ -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"); @@ -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); @@ -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"); diff --git a/src/test/java/com/jcabi/log/ConversionPatternTest.java b/src/test/java/com/jcabi/log/ConversionPatternTest.java index a224a3f2..4c1ffe74 100644 --- a/src/test/java/com/jcabi/log/ConversionPatternTest.java +++ b/src/test/java/com/jcabi/log/ConversionPatternTest.java @@ -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("") @@ -74,7 +74,7 @@ public void testGenerateNoReplacement() { } @Test - public void testGenerateEmpty() { + void testGenerateEmpty() { MatcherAssert.assertThat( convert("%color{}"), Matchers.equalTo(colorWrap("")) @@ -82,7 +82,7 @@ public void testGenerateEmpty() { } @Test - public void testGenerateSimple() { + void testGenerateSimple() { MatcherAssert.assertThat( convert("%color{Hello World}"), Matchers.equalTo(colorWrap("Hello World")) @@ -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}")) diff --git a/src/test/java/com/jcabi/log/DecorsManagerTest.java b/src/test/java/com/jcabi/log/DecorsManagerTest.java index b2564d5a..53ca4238 100644 --- a/src/test/java/com/jcabi/log/DecorsManagerTest.java +++ b/src/test/java/com/jcabi/log/DecorsManagerTest.java @@ -41,7 +41,7 @@ public final class DecorsManagerTest { @Test - public void hasBuiltInDecors() throws Exception { + void hasBuiltInDecors() throws Exception { MatcherAssert.assertThat( DecorsManager.decor("nano", 1L), Matchers.instanceOf(NanoDecor.class) @@ -49,7 +49,7 @@ public void hasBuiltInDecors() throws Exception { } @Test - public void throwsExceptionForAbsentDecor() { + void throwsExceptionForAbsentDecor() { Assertions.assertThrows( DecorException.class, () -> DecorsManager.decor("non-existing-formatter", null) diff --git a/src/test/java/com/jcabi/log/DomDecorTest.java b/src/test/java/com/jcabi/log/DomDecorTest.java index 5038295c..d658dd96 100644 --- a/src/test/java/com/jcabi/log/DomDecorTest.java +++ b/src/test/java/com/jcabi/log/DomDecorTest.java @@ -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")); @@ -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); diff --git a/src/test/java/com/jcabi/log/ExceptionDecorTest.java b/src/test/java/com/jcabi/log/ExceptionDecorTest.java index 112009a8..3efd9b7b 100644 --- a/src/test/java/com/jcabi/log/ExceptionDecorTest.java +++ b/src/test/java/com/jcabi/log/ExceptionDecorTest.java @@ -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); @@ -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); diff --git a/src/test/java/com/jcabi/log/FileDecorTest.java b/src/test/java/com/jcabi/log/FileDecorTest.java index ae2c5fcd..a84073c2 100644 --- a/src/test/java/com/jcabi/log/FileDecorTest.java +++ b/src/test/java/com/jcabi/log/FileDecorTest.java @@ -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") diff --git a/src/test/java/com/jcabi/log/LineNumberTest.java b/src/test/java/com/jcabi/log/LineNumberTest.java index 95825430..cd4767fb 100644 --- a/src/test/java/com/jcabi/log/LineNumberTest.java +++ b/src/test/java/com/jcabi/log/LineNumberTest.java @@ -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(); diff --git a/src/test/java/com/jcabi/log/LoggerTest.java b/src/test/java/com/jcabi/log/LoggerTest.java index abf1e66d..42848b57 100644 --- a/src/test/java/com/jcabi/log/LoggerTest.java +++ b/src/test/java/com/jcabi/log/LoggerTest.java @@ -47,22 +47,22 @@ 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}) @@ -70,7 +70,7 @@ public void doesntFormatArraysSinceTheyAreVarArgs() { } @Test - public void interpretsArraysAsVarArgs() { + void interpretsArraysAsVarArgs() { MatcherAssert.assertThat( Logger.format("array: %s : %d", new Object[] {"hello", 2}), Matchers.is("array: hello : 2") @@ -78,7 +78,7 @@ public void interpretsArraysAsVarArgs() { } @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") @@ -90,7 +90,7 @@ 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') @@ -98,7 +98,7 @@ public void throwsWhenParamsLessThanFormatArgs() { } @Test - public void throwsWhenParamsMoreThanFormatArgs() { + void throwsWhenParamsMoreThanFormatArgs() { Assertions.assertThrows( IllegalArgumentException.class, () -> Logger.format("String %s Number %d Char %c", "hey", 1, 'x', 2) @@ -106,7 +106,7 @@ public void throwsWhenParamsMoreThanFormatArgs() { } @Test - public void checksLogLevel() throws Exception { + void checksLogLevel() throws Exception { LogManager.getRootLogger().setLevel(org.apache.log4j.Level.INFO); TimeUnit.MILLISECONDS.sleep(1L); MatcherAssert.assertThat( @@ -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( diff --git a/src/test/java/com/jcabi/log/MsDecorTest.java b/src/test/java/com/jcabi/log/MsDecorTest.java index 9f90ca47..872c424d 100644 --- a/src/test/java/com/jcabi/log/MsDecorTest.java +++ b/src/test/java/com/jcabi/log/MsDecorTest.java @@ -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") diff --git a/src/test/java/com/jcabi/log/MulticolorLayoutTest.java b/src/test/java/com/jcabi/log/MulticolorLayoutTest.java index 6b5d42b4..85fd1e4a 100644 --- a/src/test/java/com/jcabi/log/MulticolorLayoutTest.java +++ b/src/test/java/com/jcabi/log/MulticolorLayoutTest.java @@ -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); @@ -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"); @@ -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); @@ -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"); @@ -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); @@ -122,7 +122,7 @@ public void rendersAnsiConstantColor() { } @Test - public void throwsOnIllegalColorName() { + void throwsOnIllegalColorName() { Assertions.assertThrows( IllegalArgumentException.class, () -> { diff --git a/src/test/java/com/jcabi/log/NanoDecorTest.java b/src/test/java/com/jcabi/log/NanoDecorTest.java index 4a01d29e..f7fa9b52 100644 --- a/src/test/java/com/jcabi/log/NanoDecorTest.java +++ b/src/test/java/com/jcabi/log/NanoDecorTest.java @@ -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") diff --git a/src/test/java/com/jcabi/log/ParseableInformationTest.java b/src/test/java/com/jcabi/log/ParseableInformationTest.java index cef6efa7..7266e3e7 100644 --- a/src/test/java/com/jcabi/log/ParseableInformationTest.java +++ b/src/test/java/com/jcabi/log/ParseableInformationTest.java @@ -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(); diff --git a/src/test/java/com/jcabi/log/ParseableLevelInformationTest.java b/src/test/java/com/jcabi/log/ParseableLevelInformationTest.java index 246ab87c..3ccb8c1f 100644 --- a/src/test/java/com/jcabi/log/ParseableLevelInformationTest.java +++ b/src/test/java/com/jcabi/log/ParseableLevelInformationTest.java @@ -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(); @@ -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" diff --git a/src/test/java/com/jcabi/log/PreFormatterTest.java b/src/test/java/com/jcabi/log/PreFormatterTest.java index 6819c310..072b1ab5 100644 --- a/src/test/java/com/jcabi/log/PreFormatterTest.java +++ b/src/test/java/com/jcabi/log/PreFormatterTest.java @@ -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 @@ -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( @@ -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( @@ -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); @@ -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); diff --git a/src/test/java/com/jcabi/log/SizeDecorTest.java b/src/test/java/com/jcabi/log/SizeDecorTest.java index 648972c4..dc03ef66 100644 --- a/src/test/java/com/jcabi/log/SizeDecorTest.java +++ b/src/test/java/com/jcabi/log/SizeDecorTest.java @@ -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") diff --git a/src/test/java/com/jcabi/log/SupplierLoggerTest.java b/src/test/java/com/jcabi/log/SupplierLoggerTest.java index 89be084f..f26bd79a 100644 --- a/src/test/java/com/jcabi/log/SupplierLoggerTest.java +++ b/src/test/java/com/jcabi/log/SupplierLoggerTest.java @@ -46,7 +46,7 @@ public final class SupplierLoggerTest { @Test - public void debugIsDisabled() { + void debugIsDisabled() { final String name = "nodebug"; final String appender = "nodebugapp"; final org.apache.log4j.Logger logger = this.loggerForTest( @@ -82,7 +82,7 @@ public void debugIsEnabled() { } @Test - public void traceIsDisabled() { + void traceIsDisabled() { final String name = "notrace"; final String appender = "notraceapp"; final org.apache.log4j.Logger logger = this.loggerForTest( @@ -99,7 +99,7 @@ public void traceIsDisabled() { } @Test - public void traceIsEnabled() { + void traceIsEnabled() { final String name = "enabledtrace"; final String appender = "traceapp"; final org.apache.log4j.Logger logger = this.loggerForTest( @@ -117,7 +117,7 @@ public void traceIsEnabled() { } @Test - public void warnIsDisabled() { + void warnIsDisabled() { final String name = "nowarn"; final String appender = "nowarnapp"; final org.apache.log4j.Logger logger = this.loggerForTest( @@ -153,7 +153,7 @@ public void warnIsEnabled() { } @Test - public void infoIsDisabled() { + void infoIsDisabled() { final String name = "noinfo"; final String appender = "noinfoapp"; final org.apache.log4j.Logger logger = this.loggerForTest( diff --git a/src/test/java/com/jcabi/log/TextDecorTest.java b/src/test/java/com/jcabi/log/TextDecorTest.java index e64983c3..258d088d 100644 --- a/src/test/java/com/jcabi/log/TextDecorTest.java +++ b/src/test/java/com/jcabi/log/TextDecorTest.java @@ -79,7 +79,7 @@ public void testLogsRight(final String obj, final String text, * Test for a long text. */ @Test - public void compressesLongText() { + void compressesLongText() { final int len = 1000; final String text = StringUtils.repeat('x', len); final Formattable fmt = new TextDecor(text); diff --git a/src/test/java/com/jcabi/log/VerboseCallableTest.java b/src/test/java/com/jcabi/log/VerboseCallableTest.java index 84113ef5..5e993fa6 100644 --- a/src/test/java/com/jcabi/log/VerboseCallableTest.java +++ b/src/test/java/com/jcabi/log/VerboseCallableTest.java @@ -43,7 +43,7 @@ public final class VerboseCallableTest { * VerboseCallable can log exceptions inside Callable. */ @Test - public void logsExceptionsInCallable() { + void logsExceptionsInCallable() { Assertions.assertThrows( IllegalArgumentException.class, () -> new VerboseCallable( diff --git a/src/test/java/com/jcabi/log/VerboseProcessTest.java b/src/test/java/com/jcabi/log/VerboseProcessTest.java index 18e5d9d8..551e808a 100644 --- a/src/test/java/com/jcabi/log/VerboseProcessTest.java +++ b/src/test/java/com/jcabi/log/VerboseProcessTest.java @@ -98,7 +98,7 @@ public void echosUnicodeCorrectly() { } @Test - public void runsACommandLineScriptWithException() { + void runsACommandLineScriptWithException() { Assumptions.assumeFalse(SystemUtils.IS_OS_WINDOWS, ""); final VerboseProcess process = new VerboseProcess( new ProcessBuilder("cat", "/non-existing-file.txt") @@ -116,7 +116,7 @@ public void runsACommandLineScriptWithException() { } @Test - public void runsACommandLineScriptWithExceptionNoRedir() throws Exception { + void runsACommandLineScriptWithExceptionNoRedir() throws Exception { Assumptions.assumeFalse(SystemUtils.IS_OS_WINDOWS, ""); final VerboseProcess process = new VerboseProcess( new ProcessBuilder("cat", "/non-existing-file.txt") @@ -133,7 +133,7 @@ public void runsACommandLineScriptWithExceptionNoRedir() throws Exception { } @Test - public void handlesLongRunningCommand() { + void handlesLongRunningCommand() { Assumptions.assumeFalse(SystemUtils.IS_OS_WINDOWS, ""); final VerboseProcess process = new VerboseProcess( new ProcessBuilder("/bin/bash", "-c", "sleep 2; echo 'done'") @@ -145,7 +145,7 @@ public void handlesLongRunningCommand() { } @Test - public void rejectsNullProcesses() { + void rejectsNullProcesses() { Assertions.assertThrows( RuntimeException.class, () -> { @@ -156,7 +156,7 @@ public void rejectsNullProcesses() { } @Test - public void rejectsStdoutWithLevelAll() { + void rejectsStdoutWithLevelAll() { try { new VerboseProcess( Mockito.mock(Process.class), Level.ALL, Level.INFO @@ -176,7 +176,7 @@ public void rejectsStdoutWithLevelAll() { } @Test - public void rejectsStderrWithLevelAll() { + void rejectsStderrWithLevelAll() { try { new VerboseProcess( Mockito.mock(Process.class), Level.INFO, Level.ALL @@ -222,7 +222,7 @@ public void quietlyTerminatesLongRunningProcess() throws Exception { } @Test - public void stdoutQuietlyLogsErrors() { + void stdoutQuietlyLogsErrors() { final StringWriter writer = new StringWriter(); org.apache.log4j.Logger.getRootLogger().addAppender( new WriterAppender(new SimpleLayout(), writer) @@ -279,20 +279,20 @@ public void logsErrorWhenUnderlyingStreamIsClosed() throws Exception { } @Test - public void terminatesMonitorsAndProcessIfClosedInstantly() + void terminatesMonitorsAndProcessIfClosedInstantly() throws Exception { this.terminatesMonitorsAndProcessIfClosed(0L); } @Test - public void terminatesMonitorsAndProcessIfClosedShortly() + void terminatesMonitorsAndProcessIfClosedShortly() throws Exception { // @checkstyle MagicNumberCheck (1 line) this.terminatesMonitorsAndProcessIfClosed(50L); } @Test - public void terminatesMonitorsAndProcessIfClosedNormal() throws Exception { + void terminatesMonitorsAndProcessIfClosedNormal() throws Exception { final long delay = 400L; this.terminatesMonitorsAndProcessIfClosed(delay); } diff --git a/src/test/java/com/jcabi/log/VerboseRunnableTest.java b/src/test/java/com/jcabi/log/VerboseRunnableTest.java index 0076c64a..6690d62f 100644 --- a/src/test/java/com/jcabi/log/VerboseRunnableTest.java +++ b/src/test/java/com/jcabi/log/VerboseRunnableTest.java @@ -48,7 +48,7 @@ public final class VerboseRunnableTest { @Test - public void logsExceptionsInRunnable() { + void logsExceptionsInRunnable() { Assertions.assertThrows( IllegalArgumentException.class, () -> new VerboseRunnable( @@ -60,7 +60,7 @@ public void logsExceptionsInRunnable() { } @Test - public void swallowsExceptionsInRunnable() { + void swallowsExceptionsInRunnable() { new VerboseRunnable( (Runnable) () -> { throw new IllegalArgumentException("boom"); @@ -70,7 +70,7 @@ public void swallowsExceptionsInRunnable() { } @Test - public void swallowsExceptionsInCallable() { + void swallowsExceptionsInCallable() { new VerboseRunnable( () -> { throw new IllegalArgumentException("boom-2"); @@ -80,7 +80,7 @@ public void swallowsExceptionsInCallable() { } @Test - public void translatesToStringFromUnderlyingRunnable() { + void translatesToStringFromUnderlyingRunnable() { final String text = "some text abc"; final Runnable verbose = new VerboseRunnable( new Runnable() { @@ -102,7 +102,7 @@ public String toString() { } @Test - public void translatesToStringFromUnderlyingCallable() { + void translatesToStringFromUnderlyingCallable() { final String text = "some text abc-2"; final Runnable verbose = new VerboseRunnable( new Callable() { @@ -125,7 +125,7 @@ public String toString() { } @Test - public void preservesInterruptedStatus() throws Exception { + void preservesInterruptedStatus() throws Exception { final ScheduledExecutorService svc = Executors.newSingleThreadScheduledExecutor(); final AtomicReference thread = new AtomicReference<>(); diff --git a/src/test/java/com/jcabi/log/VerboseThreadsTest.java b/src/test/java/com/jcabi/log/VerboseThreadsTest.java index 669ab690..84090120 100644 --- a/src/test/java/com/jcabi/log/VerboseThreadsTest.java +++ b/src/test/java/com/jcabi/log/VerboseThreadsTest.java @@ -43,7 +43,7 @@ public final class VerboseThreadsTest { @Test - public void instantiatesThreadsOnDemand() throws Exception { + void instantiatesThreadsOnDemand() throws Exception { final ExecutorService service = Executors .newSingleThreadExecutor(new VerboseThreads("foo")); service.execute( @@ -56,7 +56,7 @@ public void instantiatesThreadsOnDemand() throws Exception { } @Test - public void logsWhenThreadsAreNotDying() throws Exception { + void logsWhenThreadsAreNotDying() throws Exception { final ExecutorService service = Executors .newSingleThreadExecutor(new VerboseThreads(this)); final Future future = service.submit(