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:
parent
7f8c1896e4
commit
6e6263012f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue