PicoContainer
  1. PicoContainer
  2. PICO-307

CommonsLogging and Log4jMonitors do not exhibit correct Seriailization behavior

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor 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 :
      0

      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(); }

        People

        • Assignee:
          Michael Rimov
          Reporter:
          Michael Rimov
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: