Fix [deprecation] compiler warnings
Fix deprecation compiler warnings by refactoring code or applying
@SuppressWarnings("deprecation") annotations. JUnit tests of
internally deprecated classes are now themselves marked as
@Deprecated.
Numerous EasyMock deprecation warnings will remain until the
migration to mockito can be completed.
This commit is contained in:
@@ -20,8 +20,10 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.activation.FileTypeMap;
|
||||
import javax.mail.Address;
|
||||
import javax.mail.Message;
|
||||
@@ -59,7 +61,7 @@ public class JavaMailSenderTests extends TestCase {
|
||||
simpleMessage.setTo("you@mail.org");
|
||||
simpleMessage.setCc(new String[] {"he@mail.org", "she@mail.org"});
|
||||
simpleMessage.setBcc(new String[] {"us@mail.org", "them@mail.org"});
|
||||
Date sentDate = new Date(2004, 1, 1);
|
||||
Date sentDate = new GregorianCalendar(2004, 1, 1).getTime();
|
||||
simpleMessage.setSentDate(sentDate);
|
||||
simpleMessage.setSubject("my subject");
|
||||
simpleMessage.setText("my text");
|
||||
@@ -334,7 +336,7 @@ public class JavaMailSenderTests extends TestCase {
|
||||
MimeMessage mimeMessage = sender.createMimeMessage();
|
||||
mimeMessage.setSubject("custom");
|
||||
mimeMessage.setRecipient(Message.RecipientType.TO, new InternetAddress("you@mail.org"));
|
||||
mimeMessage.setSentDate(new Date(2005, 3, 1));
|
||||
mimeMessage.setSentDate(new GregorianCalendar(2005, 3, 1).getTime());
|
||||
sender.send(mimeMessage);
|
||||
|
||||
assertEquals("host", sender.transport.getConnectedHost());
|
||||
@@ -559,7 +561,7 @@ public class JavaMailSenderTests extends TestCase {
|
||||
throw new MessagingException("No sentDate specified");
|
||||
}
|
||||
if (message.getSubject() != null && message.getSubject().contains("custom")) {
|
||||
assertEquals(new Date(2005, 3, 1), message.getSentDate());
|
||||
assertEquals(new GregorianCalendar(2005, 3, 1).getTime(), message.getSentDate());
|
||||
}
|
||||
this.sentMessages.add(message);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ import org.quartz.Trigger;
|
||||
import org.quartz.TriggerListener;
|
||||
import org.quartz.impl.SchedulerRepository;
|
||||
import org.quartz.spi.JobFactory;
|
||||
|
||||
import org.springframework.beans.TestBean;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
@@ -63,7 +62,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.context.support.StaticApplicationContext;
|
||||
import org.springframework.core.io.FileSystemResourceLoader;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.scheduling.TestMethodInvokingTask;
|
||||
|
||||
/**
|
||||
@@ -973,7 +972,7 @@ public class QuartzSupportTests {
|
||||
|
||||
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
|
||||
"/org/springframework/scheduling/quartz/databasePersistence.xml");
|
||||
SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(ctx.getBean(DataSource.class));
|
||||
JdbcTemplate jdbcTemplate = new JdbcTemplate(ctx.getBean(DataSource.class));
|
||||
assertTrue("No triggers were persisted", jdbcTemplate.queryForList("SELECT * FROM qrtz_triggers").size()>0);
|
||||
Thread.sleep(3000);
|
||||
try {
|
||||
|
||||
@@ -198,7 +198,7 @@ public class JasperReportsUtilsTests extends TestCase {
|
||||
HSSFRow row = sheet.getRow(3);
|
||||
HSSFCell cell = row.getCell((short) 1);
|
||||
assertNotNull("Cell should not be null", cell);
|
||||
assertEquals("Cell content should be Dear Lord!", "Dear Lord!", cell.getStringCellValue());
|
||||
assertEquals("Cell content should be Dear Lord!", "Dear Lord!", cell.getRichStringCellValue().getString());
|
||||
}
|
||||
|
||||
private JasperReport getReport() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user