IN PROGRESS - BATCH-709: Change all collections to use generics
This commit is contained in:
@@ -52,7 +52,7 @@ public class TotalOrderItemsFunctionTests extends TestCase {
|
||||
//create list with correct item count
|
||||
LineItem item = new LineItem();
|
||||
item.setQuantity(3);
|
||||
List list = new ArrayList();
|
||||
List<LineItem> list = new ArrayList<LineItem>();
|
||||
list.add(item);
|
||||
|
||||
argument2.getResult(null);
|
||||
@@ -68,7 +68,7 @@ public class TotalOrderItemsFunctionTests extends TestCase {
|
||||
//create list with incorrect item count
|
||||
LineItem item = new LineItem();
|
||||
item.setQuantity(99);
|
||||
List list = new ArrayList();
|
||||
List<LineItem> list = new ArrayList<LineItem>();
|
||||
list.add(item);
|
||||
|
||||
argument2.getResult(null);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ValidateDiscountsFunctionTests extends TestCase {
|
||||
item.setDiscountAmount(new BigDecimal(0.0));
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
@@ -61,7 +61,7 @@ public class ValidateDiscountsFunctionTests extends TestCase {
|
||||
item.setDiscountAmount(new BigDecimal(0.0));
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
@@ -91,7 +91,7 @@ public class ValidateDiscountsFunctionTests extends TestCase {
|
||||
item.setPrice(new BigDecimal(100.0));
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
@@ -122,7 +122,7 @@ public class ValidateDiscountsFunctionTests extends TestCase {
|
||||
item.setPrice(new BigDecimal(100.0));
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
@@ -152,7 +152,7 @@ public class ValidateDiscountsFunctionTests extends TestCase {
|
||||
item.setDiscountAmount(new BigDecimal(99.0));
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ValidateHandlingPricesFunctionTests extends TestCase {
|
||||
item.setHandlingPrice(new BigDecimal(1.0));
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
@@ -59,7 +59,7 @@ public class ValidateHandlingPricesFunctionTests extends TestCase {
|
||||
item.setHandlingPrice(new BigDecimal(99999999.0));
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ValidateIdsFunctionTests extends TestCase {
|
||||
item.setItemId(1);
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
@@ -58,7 +58,7 @@ public class ValidateIdsFunctionTests extends TestCase {
|
||||
item.setItemId(9999999999L);
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ValidatePricesFunctionTests extends TestCase {
|
||||
item.setPrice(new BigDecimal(1.0));
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
@@ -59,7 +59,7 @@ public class ValidatePricesFunctionTests extends TestCase {
|
||||
item.setPrice(new BigDecimal(99999999.0));
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ValidateQuantitiesFunctionTests extends TestCase {
|
||||
item.setQuantity(1);
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
@@ -58,7 +58,7 @@ public class ValidateQuantitiesFunctionTests extends TestCase {
|
||||
item.setQuantity(9999);
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ValidateShippingPricesFunctionTests extends TestCase {
|
||||
item.setShippingPrice(new BigDecimal(1.0));
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
@@ -59,7 +59,7 @@ public class ValidateShippingPricesFunctionTests extends TestCase {
|
||||
item.setShippingPrice(new BigDecimal(99999999.0));
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ValidateTotalPricesFunctionTests extends TestCase {
|
||||
item.setTotalPrice(new BigDecimal(1.0));
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
@@ -71,7 +71,7 @@ public class ValidateTotalPricesFunctionTests extends TestCase {
|
||||
item.setTotalPrice(new BigDecimal(99999999.0));
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
@@ -104,7 +104,7 @@ public class ValidateTotalPricesFunctionTests extends TestCase {
|
||||
item.setTotalPrice(new BigDecimal(248.0));
|
||||
|
||||
//add it to line items list
|
||||
List items = new ArrayList();
|
||||
List<LineItem> items = new ArrayList<LineItem>();
|
||||
items.add(item);
|
||||
|
||||
//set return value for mock argument
|
||||
|
||||
@@ -30,7 +30,7 @@ public class DerbyDataSourceFactoryBean extends AbstractFactoryBean {
|
||||
return ds;
|
||||
}
|
||||
|
||||
public Class getObjectType() {
|
||||
public Class<DataSource> getObjectType() {
|
||||
return DataSource.class;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package test.jdbc.datasource;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
@@ -102,6 +101,7 @@ public class InitializingDataSourceFactoryBean extends AbstractFactoryBean {
|
||||
TransactionTemplate transactionTemplate = new TransactionTemplate(new DataSourceTransactionManager(dataSource));
|
||||
transactionTemplate.execute(new TransactionCallback() {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object doInTransaction(TransactionStatus status) {
|
||||
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
|
||||
String[] scripts;
|
||||
@@ -133,10 +133,9 @@ public class InitializingDataSourceFactoryBean extends AbstractFactoryBean {
|
||||
|
||||
}
|
||||
|
||||
private String stripComments(List list) {
|
||||
private String stripComments(List<String> list) {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
for (Iterator iter = list.iterator(); iter.hasNext();) {
|
||||
String line = (String) iter.next();
|
||||
for (String line : list) {
|
||||
if (!line.startsWith("//") && !line.startsWith("--")) {
|
||||
buffer.append(line + "\n");
|
||||
}
|
||||
@@ -144,7 +143,7 @@ public class InitializingDataSourceFactoryBean extends AbstractFactoryBean {
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
public Class getObjectType() {
|
||||
public Class<DataSource> getObjectType() {
|
||||
return DataSource.class;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user