1
0

Format nits

This commit is contained in:
Gary Gregory
2023-11-19 16:24:55 -05:00
parent a39a6d1234
commit a06ae06925
9 changed files with 31 additions and 54 deletions

View File

@@ -25,94 +25,76 @@ import junit.framework.TestCase;
* This is the minimum requirement for any well behaved logger
* and so this test should be run for each kind.
*/
public class BasicOperationsTestCase extends TestCase
{
public void executeIsEnabledTest(final Log log)
{
try
{
public class BasicOperationsTestCase extends TestCase {
public void executeIsEnabledTest(final Log log) {
try {
log.isTraceEnabled();
log.isDebugEnabled();
log.isInfoEnabled();
log.isWarnEnabled();
log.isErrorEnabled();
log.isFatalEnabled();
}
catch (final Throwable t)
{
} catch (final Throwable t) {
t.printStackTrace();
fail("Exception thrown: " + t);
}
}
public void executeMessageWithExceptionTest(final Log log)
{
try
{
public void executeMessageWithExceptionTest(final Log log) {
try {
log.trace("Hello, Mum", new ArithmeticException());
log.debug("Hello, Mum", new ArithmeticException());
log.info("Hello, Mum", new ArithmeticException());
log.warn("Hello, Mum", new ArithmeticException());
log.error("Hello, Mum", new ArithmeticException());
log.fatal("Hello, Mum", new ArithmeticException());
}
catch (final Throwable t)
{
} catch (final Throwable t) {
t.printStackTrace();
fail("Exception thrown: " + t);
}
}
public void executeMessageWithoutExceptionTest(final Log log)
{
try
{
public void executeMessageWithoutExceptionTest(final Log log) {
try {
log.trace("Hello, Mum");
log.debug("Hello, Mum");
log.info("Hello, Mum");
log.warn("Hello, Mum");
log.error("Hello, Mum");
log.fatal("Hello, Mum");
}
catch (final Throwable t)
{
} catch (final Throwable t) {
t.printStackTrace();
fail("Exception thrown: " + t);
}
}
public void testIsEnabledClassLog()
{
public void testIsEnabledClassLog() {
final Log log = LogFactory.getLog(BasicOperationsTestCase.class);
executeIsEnabledTest(log);
}
public void testIsEnabledNamedLog()
{
public void testIsEnabledNamedLog() {
final Log log = LogFactory.getLog(BasicOperationsTestCase.class.getName());
executeIsEnabledTest(log);
}
public void testMessageWithExceptionClassLog()
{
public void testMessageWithExceptionClassLog() {
final Log log = LogFactory.getLog(BasicOperationsTestCase.class);
executeMessageWithExceptionTest(log);
}
public void testMessageWithExceptionNamedLog()
{
public void testMessageWithExceptionNamedLog() {
final Log log = LogFactory.getLog(BasicOperationsTestCase.class.getName());
executeMessageWithExceptionTest(log);
}
public void testMessageWithoutExceptionClassLog()
{
public void testMessageWithoutExceptionClassLog() {
final Log log = LogFactory.getLog(BasicOperationsTestCase.class);
executeMessageWithoutExceptionTest(log);
}
public void testMessageWithoutExceptionNamedLog()
{
public void testMessageWithoutExceptionNamedLog() {
final Log log = LogFactory.getLog(BasicOperationsTestCase.class.getName());
executeMessageWithoutExceptionTest(log);
}

View File

@@ -24,6 +24,7 @@ import junit.framework.TestCase;
* test to emulate container and application isolated from container
*/
public class LoadTestCase extends TestCase {
/**
* A custom classloader which "duplicates" logging classes available
* in the parent classloader into itself.

View File

@@ -16,13 +16,10 @@
*/
package org.apache.commons.logging;
public class LogTestCase extends AbstractLogTest
{
public class LogTestCase extends AbstractLogTest {
@Override
public Log getLogObject()
{
public Log getLogObject() {
/**
* Pickup whatever is found/configured!
*/

View File

@@ -18,11 +18,9 @@ package org.apache.commons.logging;
import org.apache.commons.logging.impl.SimpleLog;
public class SimpleLogTestCase extends AbstractLogTest
{
public class SimpleLogTestCase extends AbstractLogTest {
@Override
public Log getLogObject()
{
public Log getLogObject() {
return new SimpleLog(this.getClass().getName());
}
}

View File

@@ -32,8 +32,7 @@ import org.apache.commons.logging.impl.NoOpLog;
* <p>
* This simply applies the tests defined in AbstractLogTest to this class.
*/
public class NoOpLogTestCase extends AbstractLogTest
{
public class NoOpLogTestCase extends AbstractLogTest {
private void checkLog(final Log log) {
assertNotNull("Log exists", log);

View File

@@ -41,8 +41,8 @@ import junit.framework.TestCase;
* PathableClassLoader approach to ensure each test is run in its own
* classloader, and use a separate test class for each test.
*/
public class SecurityAllowedTestCase extends TestCase
{
public class SecurityAllowedTestCase extends TestCase {
// Dummy special hashtable, so we can tell JCL to use this instead of
// the standard one.
public static class CustomHashtable extends Hashtable {

View File

@@ -46,8 +46,8 @@ import junit.framework.TestCase;
* PathableClassLoader approach to ensure each test is run in its own
* classloader, and use a separate test class for each test.
*/
public class SecurityForbiddenTestCase extends TestCase
{
public class SecurityForbiddenTestCase extends TestCase {
// Dummy special hashtable, so we can tell JCL to use this instead of
// the standard one.
public static class CustomHashtable extends Hashtable {