FileDocCategorySizeDatePackage
SerializableTypeTest.javaAPI DocHibernate 3.2.51429Tue Dec 12 16:22:26 GMT 2006org.hibernate.test.lob

SerializableTypeTest

public class SerializableTypeTest extends org.hibernate.junit.functional.FunctionalTestCase
Tests of {@link org.hibernate.type.SerializableType}
author
Steve Ebersole

Fields Summary
Constructors Summary
public SerializableTypeTest(String testName)

		super( testName );
	
Methods Summary
public java.lang.StringgetCacheConcurrencyStrategy()

		return null;
	
public java.lang.String[]getMappings()

		return new String[] { "lob/LobMappings.hbm.xml" };
	
public static junit.framework.Testsuite()

		return new FunctionalTestClassTestSuite( SerializableTypeTest.class );
	
public voidtestNewSerializableType()

		final String payloadText = "Initial payload";

		Session s = openSession();
		s.beginTransaction();
		LobHolder holder = new LobHolder();
		holder.setSerialData( new SerializableData( payloadText ) );
		s.save( holder );
		s.getTransaction().commit();
		s.close();

		s = openSession();
		s.beginTransaction();
		holder = ( LobHolder ) s.get( LobHolder.class, holder.getId() );
		SerializableData serialData = ( SerializableData ) holder.getSerialData();
		assertEquals( payloadText, serialData.getPayload() );
		s.delete( holder );
		s.getTransaction().commit();
		s.close();