From: Erik Brakkee Date: Fri, 30 Jul 2010 19:38:23 +0000 (+0000) Subject: (no commit message) X-Git-Tag: wamblee-utils-0.7~135 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=8e20b580861e4aec9cdce7968db2f65e6bff99ca;hp=0552a34aa457b5eaebbf484a809b371901c9c82b;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);