From: erik Date: Fri, 30 Jul 2010 19:38:23 +0000 (+0000) Subject: (no commit message) X-Git-Tag: wamblee-utils-0.5~29 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=e5115ce7418616a92ae02c665bac3ec382887a2d;p=utils --- diff --git a/wicket/joe/src/test/java/org/wamblee/wicket/inject/InjectionBehaviorTest.java b/wicket/joe/src/test/java/org/wamblee/wicket/inject/InjectionBehaviorTest.java index 4a2fef21..d5c62024 100644 --- a/wicket/joe/src/test/java/org/wamblee/wicket/inject/InjectionBehaviorTest.java +++ b/wicket/joe/src/test/java/org/wamblee/wicket/inject/InjectionBehaviorTest.java @@ -24,6 +24,7 @@ import org.apache.wicket.Component; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.wamblee.general.ObjectSerializationUtils; import org.wamblee.inject.Injector; import org.wamblee.inject.InjectorBuilder; import org.wamblee.inject.InjectorFactory; @@ -61,14 +62,8 @@ public class InjectionBehaviorTest { public void testInjectOnlyOnceAfterDeserialisation() throws Exception { InjectionBehavior behavior = new InjectionBehavior(); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ObjectOutputStream os = new ObjectOutputStream(bos); - os.writeObject(behavior); - os.flush(); - ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); - ObjectInputStream ois = new ObjectInputStream(bis); - behavior = (InjectionBehavior)ois.readObject(); - + behavior = ObjectSerializationUtils.deserialize(ObjectSerializationUtils.serialize(behavior), InjectionBehavior.class); + behavior.beforeRender(component); verify(injector).inject(same(component)); reset(injector);