⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serializationtest.java

📁 Java开发最新的日志记录工具slf4j的源码
💻 JAVA
字号:
package org.apache.commons.logging.impl;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

import junit.framework.TestCase;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class SerializationTest extends TestCase {

  ObjectOutputStream oos;
  
  public SerializationTest(String name) {
    super(name);
  }

  protected void setUp() throws Exception {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    oos = new ObjectOutputStream(baos);
    super.setUp();
  }

  protected void tearDown() throws Exception {
    super.tearDown();
    oos.close();
  }

  
  public void testSmokeSimple() throws IOException {
    Log log = LogFactory.getLog("testing");
    oos.writeObject(log);
  }
  
  public void testSmokeLocationAware() throws IOException {
    SLF4JLocationAwareLog log = new SLF4JLocationAwareLog(null);
    oos.writeObject(log);
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -