You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2009/11/05 00:44:19 UTC
svn commit: r832912 - in
/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools:
EntityXmlAssertTest.java JunitSuiteWrapper.java ModelTestSuite.java
ServiceTest.java SimpleMethodTest.java TestRunContainer.java
Author: jleroux
Date: Wed Nov 4 23:44:18 2009
New Revision: 832912
URL: http://svn.apache.org/viewvc?rev=832912&view=rev
Log:
A patch from Bob Morley "Resolve java warnings exposed in Eclipse : framework - testtools" (https://issues.apache.org/jira/browse/OFBIZ-3119) - OFBIZ-3119
Modified:
ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/EntityXmlAssertTest.java
ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/JunitSuiteWrapper.java
ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java
ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ServiceTest.java
ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/SimpleMethodTest.java
ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java
Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/EntityXmlAssertTest.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/EntityXmlAssertTest.java?rev=832912&r1=832911&r2=832912&view=diff
==============================================================================
--- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/EntityXmlAssertTest.java (original)
+++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/EntityXmlAssertTest.java Wed Nov 4 23:44:18 2009
@@ -18,25 +18,21 @@
*******************************************************************************/
package org.ofbiz.testtools;
-import junit.framework.TestResult;
+import java.net.URL;
+import java.util.List;
+
+import javolution.util.FastList;
import junit.framework.AssertionFailedError;
+import junit.framework.TestResult;
-import org.w3c.dom.Element;
-import org.ofbiz.entity.Delegator;
+import org.ofbiz.base.location.FlexibleLocation;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.util.EntityDataAssert;
import org.ofbiz.entity.util.EntitySaxReader;
import org.ofbiz.service.testtools.OFBizTestCase;
-import org.ofbiz.base.util.UtilValidate;
-import org.ofbiz.base.util.Debug;
-import org.ofbiz.base.location.FlexibleLocation;
-
-import javolution.util.FastList;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.net.URL;
+import org.w3c.dom.Element;
public class EntityXmlAssertTest extends OFBizTestCase {
Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/JunitSuiteWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/JunitSuiteWrapper.java?rev=832912&r1=832911&r2=832912&view=diff
==============================================================================
--- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/JunitSuiteWrapper.java (original)
+++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/JunitSuiteWrapper.java Wed Nov 4 23:44:18 2009
@@ -18,7 +18,6 @@
*******************************************************************************/
package org.ofbiz.testtools;
-import java.util.Iterator;
import java.util.List;
import javolution.util.FastList;
Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java?rev=832912&r1=832911&r2=832912&view=diff
==============================================================================
--- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java (original)
+++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java Wed Nov 4 23:44:18 2009
@@ -19,7 +19,6 @@
package org.ofbiz.testtools;
import java.util.Enumeration;
-import java.util.Iterator;
import java.util.List;
import javolution.util.FastList;
@@ -37,7 +36,6 @@
import org.ofbiz.entity.DelegatorFactory;
import org.ofbiz.entity.testtools.EntityTestCase;
import org.ofbiz.service.GenericDispatcher;
-import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.testtools.OFBizTestCase;
import org.w3c.dom.Element;
@@ -95,10 +93,10 @@
String className = testElement.getAttribute("class-name");
try {
- Class clz = ObjectType.loadClass(className);
+ Class<?> clz = ObjectType.loadClass(className);
TestSuite suite = new TestSuite();
suite.addTestSuite(clz);
- Enumeration testEnum = suite.tests();
+ Enumeration<?> testEnum = suite.tests();
int testsAdded = 0;
int casesAdded = 0;
while (testEnum.hasMoreElements()) {
Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ServiceTest.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ServiceTest.java?rev=832912&r1=832911&r2=832912&view=diff
==============================================================================
--- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ServiceTest.java (original)
+++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ServiceTest.java Wed Nov 4 23:44:18 2009
@@ -18,22 +18,19 @@
*******************************************************************************/
package org.ofbiz.testtools;
-import junit.framework.TestResult;
+import java.util.List;
+import java.util.Map;
+
import junit.framework.AssertionFailedError;
+import junit.framework.TestResult;
-import org.w3c.dom.Element;
-import org.ofbiz.service.LocalDispatcher;
-import org.ofbiz.service.GenericServiceException;
-import org.ofbiz.service.ServiceUtil;
-import org.ofbiz.service.ModelService;
-import org.ofbiz.service.testtools.OFBizTestCase;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilValidate;
-
-import java.util.Map;
-import java.util.List;
-import java.util.Iterator;
+import org.ofbiz.service.GenericServiceException;
+import org.ofbiz.service.ModelService;
+import org.ofbiz.service.testtools.OFBizTestCase;
+import org.w3c.dom.Element;
public class ServiceTest extends OFBizTestCase {
Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/SimpleMethodTest.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/SimpleMethodTest.java?rev=832912&r1=832911&r2=832912&view=diff
==============================================================================
--- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/SimpleMethodTest.java (original)
+++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/SimpleMethodTest.java Wed Nov 4 23:44:18 2009
@@ -18,7 +18,6 @@
*******************************************************************************/
package org.ofbiz.testtools;
-import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -31,7 +30,6 @@
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.minilang.MiniLangException;
import org.ofbiz.minilang.SimpleMethod;
-import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.ModelService;
import org.ofbiz.service.testtools.OFBizTestCase;
import org.w3c.dom.Element;
@@ -63,7 +61,7 @@
try {
- Map serviceResult = SimpleMethod.runSimpleService(methodLocation, methodName, dispatcher.getDispatchContext(),
+ Map<String, Object> serviceResult = SimpleMethod.runSimpleService(methodLocation, methodName, dispatcher.getDispatchContext(),
UtilMisc.toMap("test", this, "testResult", result, "locale", Locale.getDefault()));
// do something with the errorMessage
Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java?rev=832912&r1=832911&r2=832912&view=diff
==============================================================================
--- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java (original)
+++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java Wed Nov 4 23:44:18 2009
@@ -18,8 +18,21 @@
*******************************************************************************/
package org.ofbiz.testtools;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.util.Enumeration;
+import java.util.Map;
+
import javolution.util.FastMap;
-import junit.framework.*;
+import junit.framework.AssertionFailedError;
+import junit.framework.Test;
+import junit.framework.TestFailure;
+import junit.framework.TestListener;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest;
import org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter;
@@ -28,12 +41,6 @@
import org.ofbiz.base.util.Debug;
import org.ofbiz.entity.Delegator;
-import java.io.*;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
/**
* A Container implementation to run the tests configured through this testtools stuff.
*/
@@ -146,7 +153,7 @@
results.failureCount() + " # Errors: " + results.errorCount(), module);
if (Debug.importantOn()) {
Debug.log("[JUNIT] ----------------------------- ERRORS ----------------------------- [JUNIT]", module);
- Enumeration err = results.errors();
+ Enumeration<?> err = results.errors();
if (!err.hasMoreElements()) {
Debug.log("None");
} else {
@@ -160,7 +167,7 @@
}
Debug.log("[JUNIT] ------------------------------------------------------------------ [JUNIT]", module);
Debug.log("[JUNIT] ---------------------------- FAILURES ---------------------------- [JUNIT]", module);
- Enumeration fail = results.failures();
+ Enumeration<?> fail = results.failures();
if (!fail.hasMoreElements()) {
Debug.log("None");
} else {