Examples of StreamHandler


Examples of java.util.logging.StreamHandler

  /*
   * Test isLoggable(), null log record, having output stream. Handler should
   * call ErrorManager to handle exceptional case
   */
  public void testIsLoggable_Null() {
    StreamHandler h = new StreamHandler(new ByteArrayOutputStream(),
        new SimpleFormatter());
    assertFalse(h.isLoggable(null));
  }
View Full Code Here

Examples of java.util.logging.StreamHandler

  /*
   * Test isLoggable(), null log record, without output stream
   */
  public void testIsLoggable_Null_NoOutputStream() {
    StreamHandler h = new StreamHandler();
    assertFalse(h.isLoggable(null));
  }
View Full Code Here

Examples of java.util.logging.StreamHandler

  /*
   * Test publish(), use no filter, having output stream, normal log record.
   */
  public void testPublish_NoOutputStream() {
    StreamHandler h = new StreamHandler();
    LogRecord r = new LogRecord(Level.INFO, "testPublish_NoOutputStream");
    h.publish(r);

    h.setLevel(Level.WARNING);
    h.publish(r);

    h.setLevel(Level.CONFIG);
    h.publish(r);

    r.setLevel(Level.OFF);
    h.setLevel(Level.OFF);
    h.publish(r);
  }
View Full Code Here

Examples of java.util.logging.StreamHandler

  /*
   * Test publish(), use no filter, having output stream, normal log record.
   */
  public void testPublish_NoFilter() {
    ByteArrayOutputStream aos = new ByteArrayOutputStream();
    StreamHandler h = new StreamHandler(aos, new MockFormatter());

    LogRecord r = new LogRecord(Level.INFO, "testPublish_NoFilter");
    h.setLevel(Level.INFO);
    h.publish(r);
    h.flush();
    assertEquals("MockFormatter_Head" + "testPublish_NoFilter", aos
        .toString());

    h.setLevel(Level.WARNING);
    h.publish(r);
    h.flush();
    assertEquals("MockFormatter_Head" + "testPublish_NoFilter", aos
        .toString());

    h.setLevel(Level.CONFIG);
    h.publish(r);
    h.flush();
    assertEquals("MockFormatter_Head" + "testPublish_NoFilter"
        + "testPublish_NoFilter", aos.toString());

    r.setLevel(Level.OFF);
    h.setLevel(Level.OFF);
    h.publish(r);
    h.flush();
    assertEquals("MockFormatter_Head" + "testPublish_NoFilter"
        + "testPublish_NoFilter", aos.toString());
  }
View Full Code Here

Examples of org.butor.json.StreamHandler

      HttpRequest request = requestFactory.buildPostRequest(url, hc);
      HttpResponse resp = request.execute();
      InputStream is = resp.getContent();
      String reqLogInfo = String.format("reqId: %s, sessionId: %s",
          jsonServiceRequest.getReqId(), jsonServiceRequest.getSessionId());
      StreamHandler jsh = getStreamHandler();
      jsh.parse(is, handler, reqLogInfo);
      success = true;
    } catch (IOException e) {
      throw new ServiceCallException(e);
    } finally {
      String namespace = jsonServiceRequest.getNamespace();
View Full Code Here

Examples of org.jboss.remoting.stream.StreamHandler

      }
     
      else if(InternalInvocation.ADDSTREAMCALLBACK.equals(methodName))
      {
         StreamHandler streamHandler = getStreamHandler(invocation);
         if(handler instanceof StreamInvocationHandler)
         {
            InternalInvocation inv = (InternalInvocation)invocation.getParameter();
            // second parameter should be the param payload
            result = ((StreamInvocationHandler)handler).
View Full Code Here

Examples of org.jboss.remoting.stream.StreamHandler

   private StreamHandler getStreamHandler(InvocationRequest invocation) throws Exception
   {
      InternalInvocation inv = (InternalInvocation)invocation.getParameter();
      String locator = (String)inv.getParameters()[0];
      return new StreamHandler(locator);
   }
View Full Code Here

Examples of org.jboss.remoting.stream.StreamHandler

      }
     
      else if(InternalInvocation.ADDSTREAMCALLBACK.equals(methodName))
      {
         StreamHandler streamHandler = getStreamHandler(invocation);
         if(handler instanceof StreamInvocationHandler)
         {
            InternalInvocation inv = (InternalInvocation)invocation.getParameter();
            // second parameter should be the param payload
            result = ((StreamInvocationHandler)handler).
View Full Code Here

Examples of org.jboss.remoting.stream.StreamHandler

   private StreamHandler getStreamHandler(InvocationRequest invocation) throws Exception
   {
      InternalInvocation inv = (InternalInvocation)invocation.getParameter();
      String locator = (String)inv.getParameters()[0];
      return new StreamHandler(locator);
   }
View Full Code Here

Examples of org.jboss.remoting.stream.StreamHandler

      }
     
      else if(InternalInvocation.ADDSTREAMCALLBACK.equals(methodName))
      {
         StreamHandler streamHandler = getStreamHandler(invocation);
         if(handler instanceof StreamInvocationHandler)
         {
            InternalInvocation inv = (InternalInvocation)invocation.getParameter();
            // second parameter should be the param payload
            result = ((StreamInvocationHandler)handler).
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.