1 16 package org.quartz.impl.jdbcjobstore; 17 18 import java.io.IOException ; 19 import java.io.NotSerializableException ; 20 21 import org.apache.commons.logging.LogFactory; 22 import org.quartz.JobDataMap; 23 24 import junit.framework.TestCase; 25 26 public class StdJDBCDelegateTest extends TestCase { 27 28 public void testSerializeJobData() throws IOException { 29 StdJDBCDelegate delegate = new StdJDBCDelegate(LogFactory.getLog(getClass()), "QRTZ_", "INSTANCE"); 30 31 JobDataMap jdm = new JobDataMap(); 32 delegate.serializeJobData(jdm).close(); 33 34 jdm.clear(); 35 jdm.put("key", "value"); 36 jdm.put("key2", null); 37 delegate.serializeJobData(jdm).close(); 38 39 jdm.clear(); 40 jdm.put("key1", "value"); 41 jdm.put("key2", null); 42 jdm.put("key3", new Object ()); 43 try { 44 delegate.serializeJobData(jdm); 45 fail(); 46 } catch (NotSerializableException e) { 47 assertTrue(e.getMessage().indexOf("key3") >= 0); 48 } 49 } 50 } 51 | Popular Tags |