svn commit: r1059654 - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty: clearcommerce/CCPaymentServices.java clearcommerce/CCServicesTest.java gosoftware/RitaApi.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1059654 - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty: clearcommerce/CCPaymentServices.java clearcommerce/CCServicesTest.java gosoftware/RitaApi.java

mrisaliti
Author: mrisaliti
Date: Sun Jan 16 20:31:09 2011
New Revision: 1059654

URL: http://svn.apache.org/viewvc?rev=1059654&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/thirdparty/clearcommerce/CCPaymentServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java?rev=1059654&r1=1059653&r2=1059654&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java Sun Jan 16 20:31:09 2011
@@ -928,6 +928,7 @@ public class CCPaymentServices {
 
 }
 
+@SuppressWarnings("serial")
 class ClearCommerceException extends GeneralException {
 
     ClearCommerceException() {

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java?rev=1059654&r1=1059653&r2=1059654&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCServicesTest.java Sun Jan 16 20:31:09 2011
@@ -41,7 +41,7 @@ public class CCServicesTest extends OFBi
     protected GenericValue creditCard = null;
     protected GenericValue billingAddress = null;
     protected GenericValue shippingAddress = null;
-    protected Map pbOrder = null;
+    protected Map<String, Object> pbOrder = null;
     protected BigDecimal creditAmount = null;
     protected String configFile = null;
 
@@ -54,28 +54,23 @@ public class CCServicesTest extends OFBi
         // populate test data
         configFile = "paymentTest.properties";
         creditAmount = new BigDecimal("234.00");
-        emailAddr = delegator.makeValue("ContactMech", UtilMisc.toMap(
-                "infoString","[hidden email]"));
+        emailAddr = delegator.makeValue("ContactMech", UtilMisc.toMap("infoString","[hidden email]"));
         orderId = "testOrder1000";
-        creditCard = delegator.makeValue("CreditCard", UtilMisc.toMap(
-                "cardType","VISA",
+        creditCard = delegator.makeValue("CreditCard", UtilMisc.toMap("cardType","VISA",
                 "expireDate","12/2008",  // mm/yyyy, gets converted to mm/yy
                 "cardNumber","4111111111111111"));
-        billingAddress = delegator.makeValue("PostalAddress", UtilMisc.toMap(
-                "toName","The customer Name",
+        billingAddress = delegator.makeValue("PostalAddress", UtilMisc.toMap("toName","The customer Name",
                 "address1","The customer billingAddress1",
                 "address2","The customer billingAddress2",
                 "city","The customer city",
                 "stateProvinceGeoId", "NLD"));
-        shippingAddress = delegator.makeValue("PostalAddress", UtilMisc.toMap(
-                "toName","The customer Name",
+        shippingAddress = delegator.makeValue("PostalAddress", UtilMisc.toMap("toName","The customer Name",
                 "address1","The customer shippingStreet1",
                 "address2","The customer shippingStreet2",
                 "city","The customer city",
                 "stateProvinceGeoId", "NLD",
                 "postalCode","12345"));
-        pbOrder = UtilMisc.toMap(
-                "OrderFrequencyCycle", "M",
+        pbOrder = UtilMisc.<String, Object>toMap("OrderFrequencyCycle", "M",
                 "OrderFrequencyInterval", "3",
                 "TotalNumberPayments", "4");
     }
@@ -86,8 +81,7 @@ public class CCServicesTest extends OFBi
     public void testAuth() throws Exception{
         Debug.logInfo("=====[testAuth] starting....", module);
         try {
-            Map serviceInput = UtilMisc.toMap(
-                    "paymentConfig", configFile,
+            Map<String, Object> serviceInput = UtilMisc.<String, Object>toMap("paymentConfig", configFile,
                     "billToEmail", emailAddr,
                     "creditCard", creditCard,
                     "billingAddress", billingAddress,
@@ -97,7 +91,7 @@ public class CCServicesTest extends OFBi
             serviceInput.put("processAmount", new BigDecimal("200.00"));
 
             // run the service (make sure in payment
-            Map result = dispatcher.runSync("clearCommerceCCAuth",serviceInput);
+            Map<String, Object> result = dispatcher.runSync("clearCommerceCCAuth",serviceInput);
 
             // verify the results
             String responseMessage = (String) result.get(ModelService.RESPONSE_MESSAGE);
@@ -120,16 +114,14 @@ public class CCServicesTest extends OFBi
     public void testCredit() throws Exception{
         Debug.logInfo("=====[testCCredit] starting....", module);
         try {
-            Map serviceMap = UtilMisc.toMap(
-                    "paymentConfig", configFile,
+            Map<String, Object> serviceMap = UtilMisc.<String, Object>toMap("paymentConfig", configFile,
                     "orderId", orderId,
                     "creditAmount", creditAmount,
                     "billToEmail", emailAddr,
                     "creditCard", creditCard,
-                    "creditAmount", new BigDecimal("200.00")
-           );
+                    "creditAmount", new BigDecimal("200.00"));
             // run the service
-            Map result = dispatcher.runSync("clearCommerceCCCredit",serviceMap);
+            Map<String, Object> result = dispatcher.runSync("clearCommerceCCCredit",serviceMap);
 
             // verify the results
             String responseMessage = (String) result.get(ModelService.RESPONSE_MESSAGE);
@@ -151,19 +143,17 @@ public class CCServicesTest extends OFBi
     public void testPurchaseSubscription() throws Exception {
         Debug.logInfo("=====[testPurchaseSubscription] starting....", module);
         try {
-
-            Map serviceMap = UtilMisc.toMap(
-                    "paymentConfig", configFile,
+            Map<String, Object> serviceMap = UtilMisc.<String, Object>toMap("paymentConfig", configFile,
                     "orderId", orderId,
                     "creditAmount", creditAmount,
                     "billToEmail", emailAddr,
                     "creditCard", creditCard,
-                    "pbOrder", pbOrder          // if supplied, the crediting is for a subscription and credit by period is managed by ClearCommerce
-           );
+                    "pbOrder", pbOrder);  // if supplied, the crediting is for a subscription and credit by period is managed by ClearCommerce
+                      
             serviceMap.put("creditAmount", new BigDecimal("200.00"));
 
             // run the service
-            Map result = dispatcher.runSync("clearCommerceCCCredit",serviceMap);
+            Map<String, Object> result = dispatcher.runSync("clearCommerceCCCredit", serviceMap);
 
             // verify the results
             String responseMessage = (String) result.get(ModelService.RESPONSE_MESSAGE);
@@ -206,13 +196,11 @@ cancelled. If the order is to be resumed
         Debug.logInfo("=====[testReport] starting....", module);
         try {
 
-            Map serviceMap = UtilMisc.toMap(
-                    "orderId", "4488668f-2db0-3002-002b-0003ba1d84d5",
-                    "paymentConfig", configFile
-           );
+            Map<String, Object> serviceMap = UtilMisc.<String, Object>toMap("orderId", "4488668f-2db0-3002-002b-0003ba1d84d5",
+                    "paymentConfig", configFile);
 
             // run the service
-            Map result = dispatcher.runSync("clearCommerceCCReport",serviceMap);
+            Map<String, Object> result = dispatcher.runSync("clearCommerceCCReport",serviceMap);
 
             // verify the results
             String responseMessage = (String) result.get(ModelService.RESPONSE_MESSAGE);

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java?rev=1059654&r1=1059653&r2=1059654&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java Sun Jan 16 20:31:09 2011
@@ -19,10 +19,10 @@
 package org.ofbiz.accounting.thirdparty.gosoftware;
 
 import java.io.IOException;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
 import java.util.Map;
 
+import javolution.util.FastMap;
+
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.HttpClient;
@@ -92,19 +92,20 @@ public class RitaApi {
     protected static final int MODE_IN = 10;
 
     // instance variables
-    protected LinkedHashMap document = null;
+    protected Map<String, String> document = null;
     protected String host = null;
     protected boolean ssl = false;
     protected int port = 0;
     protected int mode = 0;
 
-    public RitaApi(Map document) {
-        this.document = new LinkedHashMap(document);
+    public RitaApi(Map<String, String> document) {
+        this.document = FastMap.newInstance();
+        this.document.putAll(document);
         this.mode = MODE_OUT;
     }
 
     public RitaApi() {
-        this.document = new LinkedHashMap();
+        this.document = FastMap.newInstance();
         this.mode = MODE_IN;
     }
 
@@ -151,9 +152,7 @@ public class RitaApi {
     @Override
     public String toString() {
         StringBuilder buf = new StringBuilder();
-        Iterator i = document.entrySet().iterator();
-        while (i.hasNext()) {
-            Map.Entry entry = (Map.Entry) i.next();
+        for (Map.Entry<String, String> entry : document.entrySet()) {
             String name = (String) entry.getKey();
             String value = (String) entry.getValue();
             buf.append(name);
@@ -165,7 +164,7 @@ public class RitaApi {
         return buf.toString();
     }
 
-    public Map getDocument() {
+    public Map<String, String> getDocument() {
         return this.document;
     }
 
@@ -227,7 +226,7 @@ public class RitaApi {
             br.close();
             */
 
-            LinkedHashMap docMap = new LinkedHashMap();
+            Map<String, String> docMap = FastMap.newInstance();
             String resp = null;
             try {
                 resp = http.post(stream);