当前位置: 首页>>代码示例>>Java>>正文


Java SerializationTestHelper.assertSerializationEquals方法代码示例

本文整理汇总了Java中org.apache.log4j.util.SerializationTestHelper.assertSerializationEquals方法的典型用法代码示例。如果您正苦于以下问题:Java SerializationTestHelper.assertSerializationEquals方法的具体用法?Java SerializationTestHelper.assertSerializationEquals怎么用?Java SerializationTestHelper.assertSerializationEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.log4j.util.SerializationTestHelper的用法示例。


在下文中一共展示了SerializationTestHelper.assertSerializationEquals方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSerializationSimple

import org.apache.log4j.util.SerializationTestHelper; //导入方法依赖的package包/类
/**
   * Serialize a simple logging event and check it against
   * a witness.
   * @throws Exception if exception during test.
   */
  public void testSerializationSimple() throws Exception {
    Logger root = Logger.getRootLogger();
    LoggingEvent event =
      new LoggingEvent(
        root.getClass().getName(), root, Level.INFO, "Hello, world.", null);
//    event.prepareForDeferredProcessing();

    int[] skip = new int[] { 352, 353, 354, 355, 356 };
    SerializationTestHelper.assertSerializationEquals(
      "witness/serialization/simple.bin", event, skip, 237);
  }
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:17,代码来源:LoggingEventTest.java

示例2: testSerializationWithException

import org.apache.log4j.util.SerializationTestHelper; //导入方法依赖的package包/类
/**
   * Serialize a logging event with an exception and check it against
   * a witness.
   * @throws Exception if exception during test.
   *
   */
  public void testSerializationWithException() throws Exception {
    Logger root = Logger.getRootLogger();
    Exception ex = new Exception("Don't panic");
    LoggingEvent event =
      new LoggingEvent(
        root.getClass().getName(), root, Level.INFO, "Hello, world.", ex);
//    event.prepareForDeferredProcessing();

    int[] skip = new int[] { 352, 353, 354, 355, 356 };
    SerializationTestHelper.assertSerializationEquals(
      "witness/serialization/exception.bin", event, skip, 237);
  }
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:19,代码来源:LoggingEventTest.java

示例3: testSerializationWithLocation

import org.apache.log4j.util.SerializationTestHelper; //导入方法依赖的package包/类
/**
   * Serialize a logging event with an exception and check it against
   * a witness.
   * @throws Exception if exception during test.
   *
   */
  public void testSerializationWithLocation() throws Exception {
    Logger root = Logger.getRootLogger();
    LoggingEvent event =
      new LoggingEvent(
        root.getClass().getName(), root, Level.INFO, "Hello, world.", null);
    LocationInfo info = event.getLocationInformation();
//    event.prepareForDeferredProcessing();

    int[] skip = new int[] { 352, 353, 354, 355, 356 };
    SerializationTestHelper.assertSerializationEquals(
      "witness/serialization/location.bin", event, skip, 237);
  }
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:19,代码来源:LoggingEventTest.java

示例4: testSerializationNDC

import org.apache.log4j.util.SerializationTestHelper; //导入方法依赖的package包/类
/**
   * Serialize a logging event with ndc.
   * @throws Exception if exception during test.
   *
   */
  public void testSerializationNDC() throws Exception {
    Logger root = Logger.getRootLogger();
    NDC.push("ndc test");

    LoggingEvent event =
      new LoggingEvent(
        root.getClass().getName(), root, Level.INFO, "Hello, world.", null);
//    event.prepareForDeferredProcessing();

    int[] skip = new int[] { 352, 353, 354, 355, 356 };
    SerializationTestHelper.assertSerializationEquals(
      "witness/serialization/ndc.bin", event, skip, 237);
    }
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:19,代码来源:LoggingEventTest.java

示例5: testSerializationMDC

import org.apache.log4j.util.SerializationTestHelper; //导入方法依赖的package包/类
/**
   * Serialize a logging event with mdc.
   * @throws Exception if exception during test.
   *
   */
  public void testSerializationMDC() throws Exception {
    Logger root = Logger.getRootLogger();
    MDC.put("mdckey", "mdcvalue");

    LoggingEvent event =
      new LoggingEvent(
        root.getClass().getName(), root, Level.INFO, "Hello, world.", null);
//    event.prepareForDeferredProcessing();

    int[] skip = new int[] { 352, 353, 354, 355, 356 };
    SerializationTestHelper.assertSerializationEquals(
      "witness/serialization/mdc.bin", event, skip, 237);
  }
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:19,代码来源:LoggingEventTest.java

示例6: testSerializeINFO

import org.apache.log4j.util.SerializationTestHelper; //导入方法依赖的package包/类
/**
 * Serialize Level.INFO and check against witness.
 *
 * @throws Exception if exception during test.
 */
@Test
public void testSerializeINFO() throws Exception {
    final int[] skip = new int[]{};
    SerializationTestHelper.assertSerializationEquals(
        "target/test-classes/witness/serialization/info.bin",
        Level.INFO, skip, Integer.MAX_VALUE);
}
 
开发者ID:OuZhencong,项目名称:log4j2,代码行数:13,代码来源:LevelTest.java

示例7: testSerializeINFO

import org.apache.log4j.util.SerializationTestHelper; //导入方法依赖的package包/类
/**
 * Serialize Level.INFO and check against witness.
 * @throws Exception if exception during test.
 *
 */
public void testSerializeINFO() throws Exception {
  int[] skip = new int[] {  };
  SerializationTestHelper.assertSerializationEquals(
    "witness/serialization/info.bin", Level.INFO, skip, Integer.MAX_VALUE);
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:11,代码来源:LevelTest.java


注:本文中的org.apache.log4j.util.SerializationTestHelper.assertSerializationEquals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。