當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。