Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/test/java/badbeans/BeanWithNoGetterOverloadedSetters.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@

public class BeanWithNoGetterOverloadedSetters {

// bad bean with no getter on purpose
@SuppressWarnings("unused")
private String value;

public void setValue(String value) {
this.value = value;
}

// Duplicate is on purpose
public void setValue(Integer value) {
this.value = value.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void testOddPaginatedIterator() {
assertEquals(false, oddPageList.isPreviousPageAvailable());

int count = 0;
Iterator i = oddPageList.iterator();
Iterator<?> i = oddPageList.iterator();
while (i.hasNext()) {
i.next();
count++;
Expand Down Expand Up @@ -151,7 +151,7 @@ public void testEvenPaginatedIterator() {
assertEquals(false, evenPageList.isPreviousPageAvailable());

int count = 0;
Iterator i = evenPageList.iterator();
Iterator<?> i = evenPageList.iterator();
while (i.hasNext()) {
i.next();
count++;
Expand Down Expand Up @@ -214,7 +214,7 @@ public void testSmallPaginatedIterator() {
assertEquals(false, smallPageList.isNextPageAvailable());

int count = 0;
Iterator i = smallPageList.iterator();
Iterator<?> i = smallPageList.iterator();
while (i.hasNext()) {
i.next();
count++;
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/ibatis/sqlmap/BaseSqlMapTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected void assertAccount2(Account account) {
assertEquals(account.getEmailAddress(), "jim.smith@somewhere.com");
}

protected void assertList(List list) {
protected void assertList(List<?> list) {
assertEquals(2, list.size());
}

Expand All @@ -122,7 +122,7 @@ protected void assertFieldAccount6(FieldAccount account) {
assertNull(account.emailAddress());
}

protected void assertAccount1(Map account) {
protected void assertAccount1(Map<?, ?> account) {
Integer id = (Integer) account.get("id");
String firstName = (String) account.get("firstName");
String lastName = (String) account.get("lastName");
Expand Down Expand Up @@ -155,7 +155,7 @@ protected void assertOrder1(Order order) {
assertEquals("C4B 4F4", order.getPostalCode());
}

protected void assertOrder1(Map order) {
protected void assertOrder1(Map<?, ?> order) {
Calendar cal = new GregorianCalendar(2003, 1, 15, 8, 15, 00);

assertEquals(Integer.valueOf(1), order.get("id"));
Expand Down
16 changes: 8 additions & 8 deletions src/test/java/com/ibatis/sqlmap/BatchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void setUp() throws Exception {

@Test
public void testExecutebatchDetailed() {
List accountList1 = new ArrayList();
List<Account> accountList1 = new ArrayList<Account>();
Account account = new Account();
account.setId(10);
account.setFirstName("fred");
Expand Down Expand Up @@ -81,7 +81,7 @@ public void testExecutebatchDetailed() {
account.setEmailAddress("fred.flintstone@gmail.com");
accountList1.add(account);

List accountList2 = new ArrayList();
List<Account> accountList2 = new ArrayList<Account>();
account = new Account();
account.setId(15);
account.setFirstName("fred");
Expand Down Expand Up @@ -133,7 +133,7 @@ public void testExecutebatchDetailed() {
sqlMap.insert("insertAccountViaInlineParameters", accountList2.get(i));
}

List results = sqlMap.executeBatchDetailed();
List<?> results = sqlMap.executeBatchDetailed();
sqlMap.commitTransaction();

assertEquals(3, results.size());
Expand Down Expand Up @@ -162,7 +162,7 @@ public void testExecutebatchDetailed() {

@Test
public void testExecutebatchDetailedWithError() {
List accountList1 = new ArrayList();
List<Account> accountList1 = new ArrayList<Account>();
Account account = new Account();
account.setId(10);
account.setFirstName("fred");
Expand Down Expand Up @@ -198,7 +198,7 @@ public void testExecutebatchDetailedWithError() {
account.setEmailAddress("fred.flintstone@gmail.com");
accountList1.add(account);

List accountList2 = new ArrayList();
List<Account> accountList2 = new ArrayList<Account>();
account = new Account();
account.setId(15);
account.setFirstName("fred");
Expand Down Expand Up @@ -279,7 +279,7 @@ public void testExecutebatchDetailedWithError() {
BatchUpdateException bue = e.getBatchUpdateException();
assertEquals(1, bue.getUpdateCounts().length);

List results = e.getSuccessfulBatchResults();
List<?> results = e.getSuccessfulBatchResults();
assertEquals(2, results.size());
BatchResult br = (BatchResult) results.get(0);
assertEquals(5, br.getUpdateCounts().length);
Expand All @@ -298,7 +298,7 @@ public void testExecutebatchDetailedWithError() {

@Test
public void testExecutebatch() {
List accountList1 = new ArrayList();
List<Account> accountList1 = new ArrayList<Account>();
Account account = new Account();
account.setId(10);
account.setFirstName("fred");
Expand Down Expand Up @@ -334,7 +334,7 @@ public void testExecutebatch() {
account.setEmailAddress("fred.flintstone@gmail.com");
accountList1.add(account);

List accountList2 = new ArrayList();
List<Account> accountList2 = new ArrayList<Account>();
account = new Account();
account.setId(15);
account.setFirstName("fred");
Expand Down
34 changes: 17 additions & 17 deletions src/test/java/com/ibatis/sqlmap/CacheStatementTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void setUp() throws Exception {

@Test
public void testMappedStatementQueryWithCache() throws SQLException {
List list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);
List<?> list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);

int firstId = System.identityHashCode(list);

Expand All @@ -70,7 +70,7 @@ public void testMappedStatementQueryWithCache() throws SQLException {
@Test
public void testMappedStatementQueryWithCache2() throws SQLException {
// tests the new methods that don't require a parameter object
List list = sqlMap.queryForList("getCachedAccountsViaResultMap");
List<?> list = sqlMap.queryForList("getCachedAccountsViaResultMap");

int firstId = System.identityHashCode(list);

Expand All @@ -94,7 +94,7 @@ public void testMappedStatementQueryWithCache2() throws SQLException {

@Test
public void testFlushDataCache() throws SQLException {
List list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);
List<?> list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);
int firstId = System.identityHashCode(list);
list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);
int secondId = System.identityHashCode(list);
Expand All @@ -108,7 +108,7 @@ public void testFlushDataCache() throws SQLException {
@Test
public void testFlushDataCache2() throws SQLException {
// tests the new methods that don't require a parameter object
List list = sqlMap.queryForList("getCachedAccountsViaResultMap");
List<?> list = sqlMap.queryForList("getCachedAccountsViaResultMap");
int firstId = System.identityHashCode(list);
list = sqlMap.queryForList("getCachedAccountsViaResultMap");
int secondId = System.identityHashCode(list);
Expand All @@ -121,7 +121,7 @@ public void testFlushDataCache2() throws SQLException {

@Test
public void testFlushDataCacheOnExecute() throws SQLException {
List list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);
List<?> list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);
int firstId = System.identityHashCode(list);
list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);
int secondId = System.identityHashCode(list);
Expand All @@ -135,7 +135,7 @@ public void testFlushDataCacheOnExecute() throws SQLException {
@Test
public void testFlushDataCacheOnExecute2() throws SQLException {
// tests the new methods that don't require a parameter object
List list = sqlMap.queryForList("getCachedAccountsViaResultMap");
List<?> list = sqlMap.queryForList("getCachedAccountsViaResultMap");
int firstId = System.identityHashCode(list);
list = sqlMap.queryForList("getCachedAccountsViaResultMap");
int secondId = System.identityHashCode(list);
Expand All @@ -148,7 +148,7 @@ public void testFlushDataCacheOnExecute2() throws SQLException {

@Test
public void testFlushDataCacheOnExecuteInBatch() throws SQLException {
List list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);
List<?> list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);
int firstId = System.identityHashCode(list);
list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);
int secondId = System.identityHashCode(list);
Expand All @@ -164,7 +164,7 @@ public void testFlushDataCacheOnExecuteInBatch() throws SQLException {
@Test
public void testFlushDataCacheOnExecuteInBatch2() throws SQLException {
// tests the new methods that don't require a parameter object
List list = sqlMap.queryForList("getCachedAccountsViaResultMap");
List<?> list = sqlMap.queryForList("getCachedAccountsViaResultMap");
int firstId = System.identityHashCode(list);
list = sqlMap.queryForList("getCachedAccountsViaResultMap");
int secondId = System.identityHashCode(list);
Expand All @@ -179,7 +179,7 @@ public void testFlushDataCacheOnExecuteInBatch2() throws SQLException {

@Test
public void testFlushDataCacheOnExecuteInBatchWithTx() throws SQLException {
List list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);
List<?> list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);
int firstId = System.identityHashCode(list);
list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);
int secondId = System.identityHashCode(list);
Expand All @@ -201,7 +201,7 @@ public void testFlushDataCacheOnExecuteInBatchWithTx() throws SQLException {
@Test
public void testMappedStatementQueryWithThreadedCache() throws SQLException {

Map results = new HashMap();
Map<String, Object> results = new HashMap<String, Object>();

TestCacheThread.startThread(sqlMap, results, "getCachedAccountsViaResultMap");
Integer firstId = (Integer) results.get("id");
Expand All @@ -211,7 +211,7 @@ public void testMappedStatementQueryWithThreadedCache() throws SQLException {

assertTrue(firstId.equals(secondId));

List list = (List) results.get("list");
List<?> list = (List<?>) results.get("list");

Account account = (Account) list.get(1);
account.setEmailAddress("new.clinton@ibatis.com");
Expand All @@ -228,7 +228,7 @@ public void testMappedStatementQueryWithThreadedCache() throws SQLException {
@Test
public void testMappedStatementQueryWithThreadedReadWriteCache() throws SQLException {

Map results = new HashMap();
Map<String, Object> results = new HashMap<String, Object>();

TestCacheThread.startThread(sqlMap, results, "getRWCachedAccountsViaResultMap");
Integer firstId = (Integer) results.get("id");
Expand All @@ -238,7 +238,7 @@ public void testMappedStatementQueryWithThreadedReadWriteCache() throws SQLExcep

assertFalse(firstId.equals(secondId));

List list = (List) results.get("list");
List<?> list = (List<?>) results.get("list");

Account account = (Account) list.get(1);
account.setEmailAddress("new.clinton@ibatis.com");
Expand Down Expand Up @@ -281,10 +281,10 @@ public void testCacheKeyWithTwoParamsSameHashcode() {

private static class TestCacheThread extends Thread {
private SqlMapClient sqlMap;
private Map results;
private Map<String, Object> results;
private String statementName;

public TestCacheThread(SqlMapClient sqlMap, Map results, String statementName) {
public TestCacheThread(SqlMapClient sqlMap, Map<String, Object> results, String statementName) {
this.sqlMap = sqlMap;
this.results = results;
this.statementName = statementName;
Expand All @@ -294,7 +294,7 @@ public TestCacheThread(SqlMapClient sqlMap, Map results, String statementName) {
public void run() {
try {
SqlMapSession session = sqlMap.openSession();
List list = session.queryForList(statementName, null);
List<?> list = session.queryForList(statementName, null);
int firstId = System.identityHashCode(list);
list = session.queryForList(statementName, null);
int secondId = System.identityHashCode(list);
Expand All @@ -307,7 +307,7 @@ public void run() {
}
}

public static void startThread(SqlMapClient sqlMap, Map results, String statementName) {
public static void startThread(SqlMapClient sqlMap, Map<String, Object> results, String statementName) {
Thread t = new TestCacheThread(sqlMap, results, statementName);
t.start();
try {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/ibatis/sqlmap/ComplexTypeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public void setUp() throws Exception {

@Test
public void testMapBeanMap() throws Exception {
Map map = new HashMap();
Map<String, ComplexBean> map = new HashMap<>();
ComplexBean bean = new ComplexBean();
bean.setMap(new HashMap());
bean.setMap(new HashMap<String, Integer>());
bean.getMap().put("id", Integer.valueOf(1));
map.put("bean", bean);

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/ibatis/sqlmap/DiscriminatorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void setUp() throws Exception {
@Test
public void testDiscriminator() throws Exception {

List list = sqlMap.queryForList("getDocuments", null);
List<?> list = sqlMap.queryForList("getDocuments", null);
assertEquals(6, list.size());

assertTrue(list.get(0) instanceof Book);
Expand All @@ -64,7 +64,7 @@ public void testDiscriminator() throws Exception {

@Test
public void testDiscriminatorInNestedResultMap() throws Exception {
List list = sqlMap.queryForList("getPersonDocuments");
List<?> list = sqlMap.queryForList("getPersonDocuments");
assertEquals(3, list.size());

assertTrue(((PersonDocument) list.get(0)).getFavoriteDocument() instanceof Magazine);
Expand All @@ -75,7 +75,7 @@ public void testDiscriminatorInNestedResultMap() throws Exception {

@Test
public void testDiscriminatorWithNestedResultMap() throws Exception {
List list = sqlMap.queryForList("getDocumentsWithAttributes");
List<?> list = sqlMap.queryForList("getDocumentsWithAttributes");
assertEquals(6, list.size());

assertTrue(list.get(0) instanceof Book);
Expand Down
Loading