Java Code Examples for java.util.logging.LogManager#addLogger()
The following examples show how to use
java.util.logging.LogManager#addLogger() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClassLogger.java From ProjectAres with GNU Affero General Public License v3.0 | 6 votes |
public static ClassLogger get(@Nullable Logger parent, Class<?> klass, @Nullable String instanceKey) { if(parent == null) { parent = Logger.getLogger(""); } ClassLogger logger = find(parent, klass, instanceKey); if(logger == null) { logger = new ClassLogger(parent, klass, instanceKey); // TODO: call addLogger from the constructuor, when it's no longer public final LogManager logManager = LogManager.getLogManager(); if(logManager.addLogger(logger)) { // addLogger will set the parent, so we have to set it back again logger.setParent(parent); } else { // Logger was created by another thread logger = find(parent, klass, instanceKey); if(logger == null) { throw new IllegalStateException("Failed to register logger " + getName(klass, instanceKey)); } } } return logger; }
Example 2
Source File: NoVelocityLoggingTest.java From RetroFacebook with Apache License 2.0 | 5 votes |
private void doTestDontLog(File log) throws IOException { // Set things up so that if Velocity is successfully logging then we will see its log output // in the temporary file we have created. This depends on Velocity falling back on JDK logging, // so this test won't do anything useful if its classpath contains Log4J or Commons Logging or // any of the other exotic logging systems that Velocity will pounce on if it sees them. FileHandler fileHandler = new FileHandler(log.getPath()); fileHandler.setFormatter(new SimpleFormatter()); Logger logger = Logger.getLogger(JdkLogChute.DEFAULT_LOG_NAME); logger.addHandler(fileHandler); logger.setLevel(Level.ALL); LogManager logManager = LogManager.getLogManager(); logManager.addLogger(logger); // Now do a random compilation that implies using RetroFacebookProcessor. JavaFileObject javaFileObject = JavaFileObjects.forSourceLines( "foo.bar.Baz", "package foo.bar;", "", "import retrofacebook.RetroFacebook;", "", "@RetroFacebook", "public abstract class Baz {", " public abstract int buh();", "", " public static Baz create(int buh) {", " return new RetroFacebook_Baz(buh);", " }", "}"); assert_().about(javaSource()) .that(javaFileObject) .processedWith(new RetroFacebookProcessor()) .compilesWithoutError(); // The log file should be empty. fileHandler.close(); assertEquals("", Files.toString(log, StandardCharsets.UTF_8)); }
Example 3
Source File: NoVelocityLoggingTest.java From RetroFacebook with Apache License 2.0 | 5 votes |
private void doTestDontLog(File log) throws IOException { // Set things up so that if Velocity is successfully logging then we will see its log output // in the temporary file we have created. This depends on Velocity falling back on JDK logging, // so this test won't do anything useful if its classpath contains Log4J or Commons Logging or // any of the other exotic logging systems that Velocity will pounce on if it sees them. FileHandler fileHandler = new FileHandler(log.getPath()); fileHandler.setFormatter(new SimpleFormatter()); Logger logger = Logger.getLogger(JdkLogChute.DEFAULT_LOG_NAME); logger.addHandler(fileHandler); logger.setLevel(Level.ALL); LogManager logManager = LogManager.getLogManager(); logManager.addLogger(logger); // Now do a random compilation that implies using RetroFacebookProcessor. JavaFileObject javaFileObject = JavaFileObjects.forSourceLines( "foo.bar.Baz", "package foo.bar;", "", "import retrofacebook.RetroFacebook;", "", "@RetroFacebook", "public abstract class Baz {", " public abstract int buh();", "", " public static Baz create(int buh) {", " return new RetroFacebook_Baz(buh);", " }", "}"); assert_().about(javaSource()) .that(javaFileObject) .processedWith(new RetroFacebookProcessor()) .compilesWithoutError(); // The log file should be empty. fileHandler.close(); assertEquals("", Files.toString(log, StandardCharsets.UTF_8)); }
Example 4
Source File: TestAppletLoggerContext.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSeven() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(""); Logger logger1b = manager.getLogger(""); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); Logger logger3 = manager.getLogger(""); Logger logger3b = manager.getLogger(""); assertNull(logger3); assertNull(logger3b); Logger root = new Bridge.CustomLogger(""); manager.addLogger(root); Logger logger4 = manager.getLogger(""); Logger logger4b = manager.getLogger(""); assertNotNull(logger4); assertNotNull(logger4b); assertEquals(logger4, root); assertEquals(logger4b, root); for (int j = 0 ; j < 3 ; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = (System.getSecurityManager() == null ? root : null); assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); if (System.getSecurityManager() != null) { assertNull(manager.getLogger(Logger.GLOBAL_LOGGER_NAME)); } else { assertEquals(global, manager.getLogger(Logger.GLOBAL_LOGGER_NAME)); } Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger6 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger6b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger expectedGlobal = (System.getSecurityManager() == null ? global : global2); assertNotNull(logger6); assertNotNull(logger6b); assertEquals(logger6, expectedGlobal); assertEquals(logger6b, expectedGlobal); if (System.getSecurityManager() != null) { assertNull(manager.getLogger("")); } else { assertEquals(root, manager.getLogger("")); } Logger root2 = new Bridge.CustomLogger(""); manager.addLogger(root2); expectedRoot = (System.getSecurityManager() == null ? root : root2); Logger logger7 = manager.getLogger(""); Logger logger7b = manager.getLogger(""); assertNotNull(logger7); assertNotNull(logger7b); assertEquals(logger7, expectedRoot); assertEquals(logger7b, expectedRoot); } } }
Example 5
Source File: TestAppletLoggerContext.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSix() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger1b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); assertNull(manager.getLogger("")); assertNull(manager.getLogger("")); for (int j = 0; j<3; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger expected = (System.getSecurityManager() == null ? global : null); Logger logger3 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger3b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertEquals(expected, logger3); assertEquals(expected, logger3b); Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger4 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger4b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger4); assertNotNull(logger4b); expected = (System.getSecurityManager() == null ? global : global2);; assertEquals(logger4, expected); assertEquals(logger4b, expected); Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = null; assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); } } }
Example 6
Source File: TestAppletLoggerContext.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSix() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger1b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); assertNull(manager.getLogger("")); assertNull(manager.getLogger("")); for (int j = 0; j<3; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger expected = (System.getSecurityManager() == null ? global : null); Logger logger3 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger3b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertEquals(expected, logger3); assertEquals(expected, logger3b); Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger4 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger4b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger4); assertNotNull(logger4b); expected = (System.getSecurityManager() == null ? global : global2);; assertEquals(logger4, expected); assertEquals(logger4b, expected); Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = null; assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); } } }
Example 7
Source File: TestAppletLoggerContext.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSeven() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(""); Logger logger1b = manager.getLogger(""); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); Logger logger3 = manager.getLogger(""); Logger logger3b = manager.getLogger(""); assertNull(logger3); assertNull(logger3b); Logger root = new Bridge.CustomLogger(""); manager.addLogger(root); Logger logger4 = manager.getLogger(""); Logger logger4b = manager.getLogger(""); assertNotNull(logger4); assertNotNull(logger4b); assertEquals(logger4, root); assertEquals(logger4b, root); for (int j = 0 ; j < 3 ; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = (System.getSecurityManager() == null ? root : null); assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); if (System.getSecurityManager() != null) { assertNull(manager.getLogger(Logger.GLOBAL_LOGGER_NAME)); } else { assertEquals(global, manager.getLogger(Logger.GLOBAL_LOGGER_NAME)); } Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger6 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger6b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger expectedGlobal = (System.getSecurityManager() == null ? global : global2); assertNotNull(logger6); assertNotNull(logger6b); assertEquals(logger6, expectedGlobal); assertEquals(logger6b, expectedGlobal); if (System.getSecurityManager() != null) { assertNull(manager.getLogger("")); } else { assertEquals(root, manager.getLogger("")); } Logger root2 = new Bridge.CustomLogger(""); manager.addLogger(root2); expectedRoot = (System.getSecurityManager() == null ? root : root2); Logger logger7 = manager.getLogger(""); Logger logger7b = manager.getLogger(""); assertNotNull(logger7); assertNotNull(logger7b); assertEquals(logger7, expectedRoot); assertEquals(logger7b, expectedRoot); } } }
Example 8
Source File: TestAppletLoggerContext.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSix() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger1b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); assertNull(manager.getLogger("")); assertNull(manager.getLogger("")); for (int j = 0; j<3; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger expected = (System.getSecurityManager() == null ? global : null); Logger logger3 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger3b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertEquals(expected, logger3); assertEquals(expected, logger3b); Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger4 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger4b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger4); assertNotNull(logger4b); expected = (System.getSecurityManager() == null ? global : global2);; assertEquals(logger4, expected); assertEquals(logger4b, expected); Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = null; assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); } } }
Example 9
Source File: TestAppletLoggerContext.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSix() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger1b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); assertNull(manager.getLogger("")); assertNull(manager.getLogger("")); for (int j = 0; j<3; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger expected = (System.getSecurityManager() == null ? global : null); Logger logger3 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger3b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertEquals(expected, logger3); assertEquals(expected, logger3b); Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger4 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger4b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger4); assertNotNull(logger4b); expected = (System.getSecurityManager() == null ? global : global2);; assertEquals(logger4, expected); assertEquals(logger4b, expected); Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = null; assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); } } }
Example 10
Source File: TestAppletLoggerContext.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSix() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger1b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); assertNull(manager.getLogger("")); assertNull(manager.getLogger("")); for (int j = 0; j<3; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger expected = (System.getSecurityManager() == null ? global : null); Logger logger3 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger3b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertEquals(expected, logger3); assertEquals(expected, logger3b); Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger4 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger4b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger4); assertNotNull(logger4b); expected = (System.getSecurityManager() == null ? global : global2);; assertEquals(logger4, expected); assertEquals(logger4b, expected); Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = null; assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); } } }
Example 11
Source File: TestAppletLoggerContext.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSeven() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(""); Logger logger1b = manager.getLogger(""); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); Logger logger3 = manager.getLogger(""); Logger logger3b = manager.getLogger(""); assertNull(logger3); assertNull(logger3b); Logger root = new Bridge.CustomLogger(""); manager.addLogger(root); Logger logger4 = manager.getLogger(""); Logger logger4b = manager.getLogger(""); assertNotNull(logger4); assertNotNull(logger4b); assertEquals(logger4, root); assertEquals(logger4b, root); for (int j = 0 ; j < 3 ; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = (System.getSecurityManager() == null ? root : null); assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); if (System.getSecurityManager() != null) { assertNull(manager.getLogger(Logger.GLOBAL_LOGGER_NAME)); } else { assertEquals(global, manager.getLogger(Logger.GLOBAL_LOGGER_NAME)); } Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger6 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger6b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger expectedGlobal = (System.getSecurityManager() == null ? global : global2); assertNotNull(logger6); assertNotNull(logger6b); assertEquals(logger6, expectedGlobal); assertEquals(logger6b, expectedGlobal); if (System.getSecurityManager() != null) { assertNull(manager.getLogger("")); } else { assertEquals(root, manager.getLogger("")); } Logger root2 = new Bridge.CustomLogger(""); manager.addLogger(root2); expectedRoot = (System.getSecurityManager() == null ? root : root2); Logger logger7 = manager.getLogger(""); Logger logger7b = manager.getLogger(""); assertNotNull(logger7); assertNotNull(logger7b); assertEquals(logger7, expectedRoot); assertEquals(logger7b, expectedRoot); } } }
Example 12
Source File: TestAppletLoggerContext.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSix() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger1b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); assertNull(manager.getLogger("")); assertNull(manager.getLogger("")); for (int j = 0; j<3; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger expected = (System.getSecurityManager() == null ? global : null); Logger logger3 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger3b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertEquals(expected, logger3); assertEquals(expected, logger3b); Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger4 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger4b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger4); assertNotNull(logger4b); expected = (System.getSecurityManager() == null ? global : global2);; assertEquals(logger4, expected); assertEquals(logger4b, expected); Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = null; assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); } } }
Example 13
Source File: TestAppletLoggerContext.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSeven() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(""); Logger logger1b = manager.getLogger(""); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); Logger logger3 = manager.getLogger(""); Logger logger3b = manager.getLogger(""); assertNull(logger3); assertNull(logger3b); Logger root = new Bridge.CustomLogger(""); manager.addLogger(root); Logger logger4 = manager.getLogger(""); Logger logger4b = manager.getLogger(""); assertNotNull(logger4); assertNotNull(logger4b); assertEquals(logger4, root); assertEquals(logger4b, root); for (int j = 0 ; j < 3 ; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = (System.getSecurityManager() == null ? root : null); assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); if (System.getSecurityManager() != null) { assertNull(manager.getLogger(Logger.GLOBAL_LOGGER_NAME)); } else { assertEquals(global, manager.getLogger(Logger.GLOBAL_LOGGER_NAME)); } Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger6 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger6b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger expectedGlobal = (System.getSecurityManager() == null ? global : global2); assertNotNull(logger6); assertNotNull(logger6b); assertEquals(logger6, expectedGlobal); assertEquals(logger6b, expectedGlobal); if (System.getSecurityManager() != null) { assertNull(manager.getLogger("")); } else { assertEquals(root, manager.getLogger("")); } Logger root2 = new Bridge.CustomLogger(""); manager.addLogger(root2); expectedRoot = (System.getSecurityManager() == null ? root : root2); Logger logger7 = manager.getLogger(""); Logger logger7b = manager.getLogger(""); assertNotNull(logger7); assertNotNull(logger7b); assertEquals(logger7, expectedRoot); assertEquals(logger7b, expectedRoot); } } }
Example 14
Source File: TestAppletLoggerContext.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSix() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger1b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); assertNull(manager.getLogger("")); assertNull(manager.getLogger("")); for (int j = 0; j<3; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger expected = (System.getSecurityManager() == null ? global : null); Logger logger3 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger3b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertEquals(expected, logger3); assertEquals(expected, logger3b); Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger4 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger4b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger4); assertNotNull(logger4b); expected = (System.getSecurityManager() == null ? global : global2);; assertEquals(logger4, expected); assertEquals(logger4b, expected); Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = null; assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); } } }
Example 15
Source File: TestAppletLoggerContext.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSeven() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(""); Logger logger1b = manager.getLogger(""); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); Logger logger3 = manager.getLogger(""); Logger logger3b = manager.getLogger(""); assertNull(logger3); assertNull(logger3b); Logger root = new Bridge.CustomLogger(""); manager.addLogger(root); Logger logger4 = manager.getLogger(""); Logger logger4b = manager.getLogger(""); assertNotNull(logger4); assertNotNull(logger4b); assertEquals(logger4, root); assertEquals(logger4b, root); for (int j = 0 ; j < 3 ; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = (System.getSecurityManager() == null ? root : null); assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); if (System.getSecurityManager() != null) { assertNull(manager.getLogger(Logger.GLOBAL_LOGGER_NAME)); } else { assertEquals(global, manager.getLogger(Logger.GLOBAL_LOGGER_NAME)); } Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger6 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger6b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger expectedGlobal = (System.getSecurityManager() == null ? global : global2); assertNotNull(logger6); assertNotNull(logger6b); assertEquals(logger6, expectedGlobal); assertEquals(logger6b, expectedGlobal); if (System.getSecurityManager() != null) { assertNull(manager.getLogger("")); } else { assertEquals(root, manager.getLogger("")); } Logger root2 = new Bridge.CustomLogger(""); manager.addLogger(root2); expectedRoot = (System.getSecurityManager() == null ? root : root2); Logger logger7 = manager.getLogger(""); Logger logger7b = manager.getLogger(""); assertNotNull(logger7); assertNotNull(logger7b); assertEquals(logger7, expectedRoot); assertEquals(logger7b, expectedRoot); } } }
Example 16
Source File: TestAppletLoggerContext.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSix() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger1b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); assertNull(manager.getLogger("")); assertNull(manager.getLogger("")); for (int j = 0; j<3; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger expected = (System.getSecurityManager() == null ? global : null); Logger logger3 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger3b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertEquals(expected, logger3); assertEquals(expected, logger3b); Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger4 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger4b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger4); assertNotNull(logger4b); expected = (System.getSecurityManager() == null ? global : global2);; assertEquals(logger4, expected); assertEquals(logger4b, expected); Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = null; assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); } } }
Example 17
Source File: TestAppletLoggerContext.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSeven() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(""); Logger logger1b = manager.getLogger(""); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); Logger logger3 = manager.getLogger(""); Logger logger3b = manager.getLogger(""); assertNull(logger3); assertNull(logger3b); Logger root = new Bridge.CustomLogger(""); manager.addLogger(root); Logger logger4 = manager.getLogger(""); Logger logger4b = manager.getLogger(""); assertNotNull(logger4); assertNotNull(logger4b); assertEquals(logger4, root); assertEquals(logger4b, root); for (int j = 0 ; j < 3 ; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = (System.getSecurityManager() == null ? root : null); assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); if (System.getSecurityManager() != null) { assertNull(manager.getLogger(Logger.GLOBAL_LOGGER_NAME)); } else { assertEquals(global, manager.getLogger(Logger.GLOBAL_LOGGER_NAME)); } Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger6 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger6b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger expectedGlobal = (System.getSecurityManager() == null ? global : global2); assertNotNull(logger6); assertNotNull(logger6b); assertEquals(logger6, expectedGlobal); assertEquals(logger6b, expectedGlobal); if (System.getSecurityManager() != null) { assertNull(manager.getLogger("")); } else { assertEquals(root, manager.getLogger("")); } Logger root2 = new Bridge.CustomLogger(""); manager.addLogger(root2); expectedRoot = (System.getSecurityManager() == null ? root : root2); Logger logger7 = manager.getLogger(""); Logger logger7b = manager.getLogger(""); assertNotNull(logger7); assertNotNull(logger7b); assertEquals(logger7, expectedRoot); assertEquals(logger7b, expectedRoot); } } }
Example 18
Source File: TestAppletLoggerContext.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSix() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger1b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); assertNull(manager.getLogger("")); assertNull(manager.getLogger("")); for (int j = 0; j<3; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger expected = (System.getSecurityManager() == null ? global : null); Logger logger3 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger3b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertEquals(expected, logger3); assertEquals(expected, logger3b); Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger4 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger4b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger4); assertNotNull(logger4b); expected = (System.getSecurityManager() == null ? global : global2);; assertEquals(logger4, expected); assertEquals(logger4b, expected); Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = null; assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); } } }
Example 19
Source File: TestAppletLoggerContext.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSix() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger1b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); assertNull(manager.getLogger("")); assertNull(manager.getLogger("")); for (int j = 0; j<3; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger expected = (System.getSecurityManager() == null ? global : null); Logger logger3 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger3b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertEquals(expected, logger3); assertEquals(expected, logger3b); Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger4 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger4b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger4); assertNotNull(logger4b); expected = (System.getSecurityManager() == null ? global : global2);; assertEquals(logger4, expected); assertEquals(logger4b, expected); Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = null; assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); } } }
Example 20
Source File: TestAppletLoggerContext.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
/** * This test is designed to test the behavior of additional LogManager instances. * It must be noted that if the security manager is off, then calling * Bridge.changeContext() has actually no effect - which explains why we have * some differences between the cases security manager on & security manager * off. **/ public static void testSeven() { for (int i=0; i<3 ; i++) { Bridge.desactivate(); LogManager manager = new LogManager() {}; Logger logger1 = manager.getLogger(""); Logger logger1b = manager.getLogger(""); assertNull(logger1); assertNull(logger1b); Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global); Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); assertNotNull(logger2); assertNotNull(logger2b); assertEquals(logger2, global); assertEquals(logger2b, global); Logger logger3 = manager.getLogger(""); Logger logger3b = manager.getLogger(""); assertNull(logger3); assertNull(logger3b); Logger root = new Bridge.CustomLogger(""); manager.addLogger(root); Logger logger4 = manager.getLogger(""); Logger logger4b = manager.getLogger(""); assertNotNull(logger4); assertNotNull(logger4b); assertEquals(logger4, root); assertEquals(logger4b, root); for (int j = 0 ; j < 3 ; j++) { Bridge.changeContext(); // this is not a supported configuration: // We are in an applet context with several log managers. // We however need to check our assumptions... // Applet context => root logger and global logger should also be null. Logger logger5 = manager.getLogger(""); Logger logger5b = manager.getLogger(""); Logger expectedRoot = (System.getSecurityManager() == null ? root : null); assertEquals(logger5, expectedRoot); assertEquals(logger5b, expectedRoot); if (System.getSecurityManager() != null) { assertNull(manager.getLogger(Logger.GLOBAL_LOGGER_NAME)); } else { assertEquals(global, manager.getLogger(Logger.GLOBAL_LOGGER_NAME)); } Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); manager.addLogger(global2); Logger logger6 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger6b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger expectedGlobal = (System.getSecurityManager() == null ? global : global2); assertNotNull(logger6); assertNotNull(logger6b); assertEquals(logger6, expectedGlobal); assertEquals(logger6b, expectedGlobal); if (System.getSecurityManager() != null) { assertNull(manager.getLogger("")); } else { assertEquals(root, manager.getLogger("")); } Logger root2 = new Bridge.CustomLogger(""); manager.addLogger(root2); expectedRoot = (System.getSecurityManager() == null ? root : root2); Logger logger7 = manager.getLogger(""); Logger logger7b = manager.getLogger(""); assertNotNull(logger7); assertNotNull(logger7b); assertEquals(logger7, expectedRoot); assertEquals(logger7b, expectedRoot); } } }