01: package org.apache.commons.logging.impl;
02:
03: import java.io.ByteArrayOutputStream;
04: import java.io.IOException;
05: import java.io.ObjectOutputStream;
06:
07: import junit.framework.TestCase;
08:
09: import org.apache.commons.logging.Log;
10: import org.apache.commons.logging.LogFactory;
11:
12: public class SerializationTest extends TestCase {
13:
14: ObjectOutputStream oos;
15:
16: public SerializationTest(String name) {
17: super (name);
18: }
19:
20: protected void setUp() throws Exception {
21: ByteArrayOutputStream baos = new ByteArrayOutputStream();
22: oos = new ObjectOutputStream(baos);
23: super .setUp();
24: }
25:
26: protected void tearDown() throws Exception {
27: super .tearDown();
28: oos.close();
29: }
30:
31: public void testSmokeSimple() throws IOException {
32: Log log = LogFactory.getLog("testing");
33: oos.writeObject(log);
34: }
35:
36: public void testSmokeLocationAware() throws IOException {
37: SLF4JLocationAwareLog log = new SLF4JLocationAwareLog(null);
38: oos.writeObject(log);
39: }
40: }
|