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
This commit is contained in:
Hardy Ferentschik 2010-01-26 19:44:57 +00:00
parent 7f8c1896e4
commit 6e6263012f
1 changed files with 21 additions and 23 deletions

View File

@ -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<String,String> image = new HashMap<String, String>();
// 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<String, String>) ois.readObject();
// assertTrue( image.containsKey( "meta" ) );
// em.getTransaction().commit();
// em.close();
EntityManager em = getOrCreateEntityManager();
em.getTransaction().begin();
Map<String,String> image = new HashMap<String, String>();
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<String, String>) ois.readObject();
assertTrue( image.containsKey( "meta" ) );
em.getTransaction().commit();
em.close();
}
@Override