From 6e6263012f093a93b01572ed95fbfd5b1cd54496 Mon Sep 17 00:00:00 2001 From: Hardy Ferentschik Date: Tue, 26 Jan 2010 19:44:57 +0000 Subject: [PATCH] HHH-4822 reverted a test which was accidently marked with @FailureExpected git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18637 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- .../org/hibernate/ejb/test/lob/BlobTest.java | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/entitymanager/src/test/java/org/hibernate/ejb/test/lob/BlobTest.java b/entitymanager/src/test/java/org/hibernate/ejb/test/lob/BlobTest.java index ef28e2aeea..d3e99aa1fb 100644 --- a/entitymanager/src/test/java/org/hibernate/ejb/test/lob/BlobTest.java +++ b/entitymanager/src/test/java/org/hibernate/ejb/test/lob/BlobTest.java @@ -19,30 +19,28 @@ import org.hibernate.test.annotations.FailureExpected; */ public class BlobTest extends TestCase { - @FailureExpected public void testBlobSerialization() throws Exception { - throw new RuntimeException( ); -// EntityManager em = getOrCreateEntityManager(); -// em.getTransaction().begin(); -// Map image = new HashMap(); -// image.put( "meta", "metadata" ); -// image.put( "data", "imagedata" ); -// ImageReader reader = new ImageReader(); -// ByteArrayOutputStream baos = new ByteArrayOutputStream(); -// ObjectOutputStream oos = new ObjectOutputStream( baos ); -// oos.writeObject( image ); -// reader.setImage( (Blob) Hibernate.createBlob( baos.toByteArray() ) ); -// em.persist( reader ); -// em.getTransaction().commit(); -// em.close(); //useless but y'a know -// em = getOrCreateEntityManager(); -// em.getTransaction().begin(); -// reader = em.find( ImageReader.class, reader.getId() ); -// ObjectInputStream ois = new ObjectInputStream( reader.getImage().getBinaryStream() ); -// image = (HashMap) ois.readObject(); -// assertTrue( image.containsKey( "meta" ) ); -// em.getTransaction().commit(); -// em.close(); + EntityManager em = getOrCreateEntityManager(); + em.getTransaction().begin(); + Map image = new HashMap(); + image.put( "meta", "metadata" ); + image.put( "data", "imagedata" ); + ImageReader reader = new ImageReader(); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream( baos ); + oos.writeObject( image ); + reader.setImage( (Blob) Hibernate.createBlob( baos.toByteArray() ) ); + em.persist( reader ); + em.getTransaction().commit(); + em.close(); //useless but y'a know + em = getOrCreateEntityManager(); + em.getTransaction().begin(); + reader = em.find( ImageReader.class, reader.getId() ); + ObjectInputStream ois = new ObjectInputStream( reader.getImage().getBinaryStream() ); + image = (HashMap) ois.readObject(); + assertTrue( image.containsKey( "meta" ) ); + em.getTransaction().commit(); + em.close(); } @Override