Author: mrisaliti
Date: Sun Jan 9 16:28:21 2011
New Revision: 1056972
URL: http://svn.apache.org/viewvc?rev=1056972&view=rev
Log:
Remove most of the java compilation warning (generics markup, unused
code/import) (OFBIZ-4102)
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java
ofbiz/trunk/applications/content/src/org/ofbiz/content/test/LuceneTests.java
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java?rev=1056972&r1=1056971&r2=1056972&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java
(original)
+++
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java
Sun Jan 9 16:28:21 2011
@@ -50,31 +50,31 @@ public class FinAccountTests extends OFB
}
public void testCreateFinAccount() throws Exception {
- Map ctx = FastMap.newInstance();
+ Map<String, Object> ctx = FastMap.newInstance();
ctx.put("finAccountId", "TESTACCOUNT1");
ctx.put("finAccountName", "Test Financial Account");
ctx.put("finAccountTypeId", "BANK_ACCOUNT");
ctx.put("userLogin", userLogin);
- Map resp = dispatcher.runSync("createFinAccount", ctx);
+ Map<String, Object> resp = dispatcher.runSync("createFinAccount", ctx);
assertEquals("Service result success", ModelService.RESPOND_SUCCESS,
resp.get(ModelService.RESPONSE_MESSAGE));
}
public void testDeposit() throws Exception {
- Map ctx = FastMap.newInstance();
+ Map<String, Object> ctx = FastMap.newInstance();
ctx.put("finAccountId", "TESTACCOUNT1");
ctx.put("amount", new BigDecimal("100.00"));
ctx.put("userLogin", userLogin);
- Map resp = dispatcher.runSync("finAccountDeposit", ctx);
+ Map<String, Object> resp = dispatcher.runSync("finAccountDeposit",
ctx);
BigDecimal balance = (BigDecimal) resp.get("balance");
assertEquals(balance.toPlainString(), "100.00");
}
public void testWithdraw() throws Exception {
- Map ctx = FastMap.newInstance();
+ Map<String, Object> ctx = FastMap.newInstance();
ctx.put("finAccountId", "TESTACCOUNT1");
ctx.put("amount", new BigDecimal("50.00"));
ctx.put("userLogin", userLogin);
- Map resp = dispatcher.runSync("finAccountWithdraw", ctx);
+ Map<String, Object> resp = dispatcher.runSync("finAccountWithdraw",
ctx);
BigDecimal previousBalance = (BigDecimal) resp.get("previousBalance");
BigDecimal balance = ((BigDecimal) resp.get("balance"));
assertEquals(balance.add(new BigDecimal("50.00")).toPlainString(),
previousBalance.toPlainString());
Modified:
ofbiz/trunk/applications/content/src/org/ofbiz/content/test/LuceneTests.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/test/LuceneTests.java?rev=1056972&r1=1056971&r2=1056972&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/org/ofbiz/content/test/LuceneTests.java
(original)
+++
ofbiz/trunk/applications/content/src/org/ofbiz/content/test/LuceneTests.java
Sun Jan 9 16:28:21 2011
@@ -19,25 +19,30 @@
package org.ofbiz.content.test;
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
import javolution.util.FastMap;
+
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.QueryParser;
-import org.apache.lucene.search.*;
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.Searcher;
+import org.apache.lucene.search.TopScoreDocCollector;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.util.Version;
-import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.content.search.SearchWorker;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.service.testtools.OFBizTestCase;
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-
public class LuceneTests extends OFBizTestCase {
protected GenericValue userLogin = null;
@@ -56,14 +61,14 @@ public class LuceneTests extends OFBizTe
}
public void testCreateIndex() throws Exception {
- Map ctx = FastMap.newInstance();
+ Map<String, Object> ctx = FastMap.newInstance();
ctx.put("contentId", "WebStoreCONTENT");
ctx.put("userLogin", userLogin);
- Map resp = dispatcher.runSync("indexTree", ctx);
+ Map<String, Object> resp = dispatcher.runSync("indexTree", ctx);
assertEquals(7, resp.get("goodIndexCount"));
- List<String> badIndexList = (List<String>) resp.get("badIndexList");
+ List<String> badIndexList =
UtilGenerics.checkList(resp.get("badIndexList"));
assertEquals(8, badIndexList.size());
}