Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for addHandler (0.42 sec)

  1. guava-testlib/test/com/google/common/testing/TestLogHandlerTest.java

      protected void setUp() throws Exception {
        super.setUp();
    
        handler = new TestLogHandler();
    
        // You could also apply it higher up the Logger hierarchy than this
        ExampleClassUnderTest.logger.addHandler(handler);
    
        ExampleClassUnderTest.logger.setUseParentHandlers(false); // optional
    
        stack.addTearDown(
            new TearDown() {
              @Override
              public void tearDown() throws Exception {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.8K bytes
    - Viewed (0)
  2. android/guava-testlib/test/com/google/common/testing/TestLogHandlerTest.java

      protected void setUp() throws Exception {
        super.setUp();
    
        handler = new TestLogHandler();
    
        // You could also apply it higher up the Logger hierarchy than this
        ExampleClassUnderTest.logger.addHandler(handler);
    
        ExampleClassUnderTest.logger.setUseParentHandlers(false); // optional
    
        stack.addTearDown(
            new TearDown() {
              @Override
              public void tearDown() throws Exception {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.8K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/io/CharSourceTest.java

        if (Closer.create().suppressor instanceof LoggingSuppressor) {
          // test that exceptions are logged
    
          TestLogHandler logHandler = new TestLogHandler();
          Closeables.logger.addHandler(logHandler);
          try {
            for (CharSource in : BROKEN_SOURCES) {
              runFailureTest(in, newNormalCharSink());
              assertTrue(logHandler.getStoredLogRecords().isEmpty());
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 12K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/io/CloserTest.java

            new Suppression(c1, c3Exception, c1Exception));
      }
    
      public static void testLoggingSuppressor() throws IOException {
        TestLogHandler logHandler = new TestLogHandler();
    
        Closeables.logger.addHandler(logHandler);
        try {
          Closer closer = new Closer(new Closer.LoggingSuppressor());
    
          TestCloseable c1 = closer.register(TestCloseable.throwsOnClose(new IOException()));
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Mar 06 15:15:46 GMT 2024
    - 13.6K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/util/concurrent/ListenerCallQueueTest.java

        Logger logger = Logger.getLogger(ListenerCallQueue.class.getName());
        logger.setLevel(Level.SEVERE);
        TestLogHandler logHandler = new TestLogHandler();
        logger.addHandler(logHandler);
        try {
          queue.dispatch();
        } finally {
          logger.removeHandler(logHandler);
        }
    
        assertEquals(1, logHandler.getStoredLogRecords().size());
        assertEquals(
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/util/concurrent/ExecutionSequencerTest.java

          }
        };
      }
    
      public void testCancellationDuringReentrancy() throws Exception {
        TestLogHandler logHandler = new TestLogHandler();
        Logger.getLogger(AbstractFuture.class.getName()).addHandler(logHandler);
    
        List<Future<?>> results = new ArrayList<>();
        final Runnable[] manualExecutorTask = new Runnable[1];
        Executor manualExecutor =
            new Executor() {
              @Override
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 16.8K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/util/concurrent/ExecutionSequencerTest.java

          }
        };
      }
    
      public void testCancellationDuringReentrancy() throws Exception {
        TestLogHandler logHandler = new TestLogHandler();
        Logger.getLogger(AbstractFuture.class.getName()).addHandler(logHandler);
    
        List<Future<?>> results = new ArrayList<>();
        final Runnable[] manualExecutorTask = new Runnable[1];
        Executor manualExecutor =
            new Executor() {
              @Override
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 16.8K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/util/concurrent/ServiceManagerTest.java

       */
      public void testEmptyServiceManager() {
        Logger logger = Logger.getLogger(ServiceManager.class.getName());
        logger.setLevel(Level.FINEST);
        TestLogHandler logHandler = new TestLogHandler();
        logger.addHandler(logHandler);
        ServiceManager manager = new ServiceManager(Arrays.<Service>asList());
        RecordingListener listener = new RecordingListener();
        manager.addListener(listener, directExecutor());
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Oct 02 17:20:27 GMT 2023
    - 23.2K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/io/CloserTest.java

            new Suppression(c1, c3Exception, c1Exception));
      }
    
      public static void testLoggingSuppressor() throws IOException {
        TestLogHandler logHandler = new TestLogHandler();
    
        Closeables.logger.addHandler(logHandler);
        try {
          Closer closer = new Closer(new Closer.LoggingSuppressor());
    
          TestCloseable c1 = closer.register(TestCloseable.throwsOnClose(new IOException()));
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Mar 06 15:15:46 GMT 2024
    - 13.6K bytes
    - Viewed (0)
  10. guava-testlib/src/com/google/common/testing/TestLogHandler.java

     *
     * <pre>
     *   TestLogHandler handler;
     *
     *   protected void setUp() throws Exception {
     *     super.setUp();
     *     handler = new TestLogHandler();
     *     SomeClass.logger.addHandler(handler);
     *     addTearDown(new TearDown() {
     *       public void tearDown() throws Exception {
     *         SomeClass.logger.removeHandler(handler);
     *       }
     *     });
     *   }
     *
     *   public void test() {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Apr 26 20:07:17 GMT 2023
    - 2.6K bytes
    - Viewed (0)
Back to top