Details
-
Type: Bug
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 2.2
-
Fix Version/s: 2.3
-
Component/s: PicoContainer Gems
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
Log4j and CommonsLogging are not Serializable and therefore, despite that ComponentMonitor is marked as Serializable, serialization isn't correct.
Test case:
@Test public void shouldSerialize() throws IOException, ClassNotFoundException
{ ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bos); oos.writeObject(componentMonitor); oos.close(); byte[] savedBytes = bos.toByteArray(); assertNotNull(savedBytes); ByteArrayInputStream bis = new ByteArrayInputStream(savedBytes); ObjectInputStream ois = new ObjectInputStream(bis); this.componentMonitor = (ComponentMonitor) ois.readObject(); assertNotNull(componentMonitor); //Run through a couple of other tests so we know that the delegate logger internally //appears to be working. testShouldTraceInstantiatedWithInjected(); }
With the exception of
PICO-308, this has been fixed.