/hg/icedtea-web: unittests warning cleanup: fixed typechecks, ra...
jvanek at icedtea.classpath.org
jvanek at icedtea.classpath.org
Fri Dec 13 00:47:44 PST 2013
changeset 540234db8ce7 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=540234db8ce7
author: Jiri Vanek <jvanek at redhat.com>
date: Fri Dec 13 09:54:16 2013 +0100
unittests warning cleanup: fixed typechecks, rawtypes, redundant casts...
ScreenFinder fixed to work partially also in headless mode.
After this clean up only "internal proprietary API and may be removed in a future release" warnings remain fro make check. Please keep itw in this way :)
diffstat:
ChangeLog | 24 ++++++
netx/net/sourceforge/jnlp/util/ScreenFinder.java | 26 +++++-
tests/junit-runner/CommandLine.java | 2 +-
tests/junit-runner/JunitLikeXmlOutputListener.java | 8 +-
tests/junit-runner/LessVerboseTextListener.java | 11 +-
tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java | 2 +-
tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java | 8 +-
tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashUtilsTest.java | 32 ++++----
tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashUtilsTest.java | 38 +++++----
tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItemTest.java | 2 +-
tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java | 4 +-
tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java | 4 +-
tests/netx/unit/net/sourceforge/jnlp/util/replacements/BASE64EncoderTest.java | 2 +-
tests/netx/unit/sun/applet/PluginAppletViewerTest.java | 3 -
tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java | 2 +-
tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java | 4 +-
tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java | 3 +-
tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java | 9 +-
tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java | 4 +-
tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java | 18 ++--
20 files changed, 120 insertions(+), 86 deletions(-)
diffs (truncated from 693 to 500 lines):
diff -r d93aaf41548e -r 540234db8ce7 ChangeLog
--- a/ChangeLog Mon Dec 09 13:25:21 2013 +0100
+++ b/ChangeLog Fri Dec 13 09:54:16 2013 +0100
@@ -1,3 +1,27 @@
+2013-12-13 Jiri Vanek <jvanek at redhat.com>
+
+ unittests warning cleanup: fixed typechecks, rawtypes, redundant casts...
+ * tests/junit-runner/CommandLine.java
+ * tests/junit-runner/JunitLikeXmlOutputListener.java
+ * tests/junit-runner/LessVerboseTextListener.java
+ * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java
+ * tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java
+ * tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashUtilsTest.java
+ * tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashUtilsTest.java
+ * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItemTest.java
+ * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java
+ * tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java
+ * tests/netx/unit/net/sourceforge/jnlp/util/replacements/BASE64EncoderTest.java
+ * tests/netx/unit/sun/applet/PluginAppletViewerTest.java
+ * tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java
+ * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java
+ * tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java
+ * tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java
+ * tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java
+ * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java
+ * netx/net/sourceforge/jnlp/util/ScreenFinder.java: centering of screen
+ fixed to work also in headless mode by returrning some defaults
+
2013-12-09 Jiri Vanek <jvanek at redhat.com>
* Messages.properties: added "It will be granted unrestricted access to your computer."
diff -r d93aaf41548e -r 540234db8ce7 netx/net/sourceforge/jnlp/util/ScreenFinder.java
--- a/netx/net/sourceforge/jnlp/util/ScreenFinder.java Mon Dec 09 13:25:21 2013 +0100
+++ b/netx/net/sourceforge/jnlp/util/ScreenFinder.java Fri Dec 13 09:54:16 2013 +0100
@@ -39,12 +39,14 @@
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
import java.awt.Insets;
import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.Window;
+import net.sourceforge.jnlp.util.logging.OutputController;
public class ScreenFinder {
@@ -54,8 +56,13 @@
}
public static Rectangle getCurrentScreenSizeWithoutBounds() {
- Point p = MouseInfo.getPointerInfo().getLocation();
- return getScreenOnCoordsWithutBounds(p);
+ try {
+ Point p = MouseInfo.getPointerInfo().getLocation();
+ return getScreenOnCoordsWithoutBounds(p);
+ } catch (HeadlessException ex) {
+ OutputController.getLogger().log(ex);
+ return new Rectangle(800, 600);
+ }
}
@@ -89,11 +96,16 @@
return result;
}
- public static Rectangle getScreenOnCoordsWithutBounds(Point p) {
- GraphicsDevice device = getScreenOnCoords(p);
- Rectangle screenSize = device.getDefaultConfiguration().getBounds();
- Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(device.getDefaultConfiguration());
- return new Rectangle((int)screenSize.getX()+insets.left, (int)screenSize.getY()+insets.top, (int)screenSize.getWidth()-insets.left, (int)screenSize.getHeight()-insets.bottom);
+ public static Rectangle getScreenOnCoordsWithoutBounds(Point p) {
+ try {
+ GraphicsDevice device = getScreenOnCoords(p);
+ Rectangle screenSize = device.getDefaultConfiguration().getBounds();
+ Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(device.getDefaultConfiguration());
+ return new Rectangle((int) screenSize.getX() + insets.left, (int) screenSize.getY() + insets.top, (int) screenSize.getWidth() - insets.left, (int) screenSize.getHeight() - insets.bottom);
+ } catch (HeadlessException ex) {
+ OutputController.getLogger().log(ex);
+ return new Rectangle(800, 600);
+ }
}
diff -r d93aaf41548e -r 540234db8ce7 tests/junit-runner/CommandLine.java
--- a/tests/junit-runner/CommandLine.java Mon Dec 09 13:25:21 2013 +0100
+++ b/tests/junit-runner/CommandLine.java Fri Dec 13 09:54:16 2013 +0100
@@ -45,7 +45,7 @@
addListener(jXmlOutput);
RunListener listener = new LessVerboseTextListener(system);
addListener(listener);
- Result result = run(classes.toArray(new Class[0]));
+ Result result = run(classes.toArray(new Class<?>[0]));
for (Failure each : missingClasses) {
result.getFailures().add(each);
}
diff -r d93aaf41548e -r 540234db8ce7 tests/junit-runner/JunitLikeXmlOutputListener.java
--- a/tests/junit-runner/JunitLikeXmlOutputListener.java Mon Dec 09 13:25:21 2013 +0100
+++ b/tests/junit-runner/JunitLikeXmlOutputListener.java Fri Dec 13 09:54:16 2013 +0100
@@ -80,7 +80,7 @@
private class ClassStat {
- Class c;
+ Class<?> c;
int total;
int failed;
int passed;
@@ -178,8 +178,9 @@
}
+ @SuppressWarnings("unchecked")
private void testDone(Description description, long testTime, double testTimeSeconds, boolean ignored) throws Exception {
- Class testClass = null;
+ Class<?> testClass = null;
Method testMethod = null;
try {
testClass = description.getTestClass();
@@ -305,6 +306,7 @@
}
@Override
+ @SuppressWarnings("unchecked")
public void testRunFinished(Result result) throws Exception {
writeElement(SOUT_ELEMENT, "@sout@");
@@ -335,7 +337,7 @@
try {
Bug b = null;
if (entry.getValue().c != null) {
- b = (Bug) entry.getValue().c.getAnnotation(Bug.class);
+ b = entry.getValue().c.getAnnotation(Bug.class);
}
if (b != null) {
openElement(BUGS);
diff -r d93aaf41548e -r 540234db8ce7 tests/junit-runner/LessVerboseTextListener.java
--- a/tests/junit-runner/LessVerboseTextListener.java Mon Dec 09 13:25:21 2013 +0100
+++ b/tests/junit-runner/LessVerboseTextListener.java Fri Dec 13 09:54:16 2013 +0100
@@ -114,11 +114,12 @@
}
}
-
- public static <T extends Annotation> T getAnnotation(Class q, String methodName, Class<T> a) {
+
+ @SuppressWarnings("unchecked")
+ public static <T extends Annotation> T getAnnotation(Class<?> q, String methodName, Class<T> a) {
try {
if (q != null) {
- T rem = (T) q.getAnnotation(a);
+ T rem = q.getAnnotation(a);
if (rem != null) {
return rem;
}
@@ -140,11 +141,11 @@
}
public static KnownToFail getK2F(Description description) {
- return (KnownToFail) getAnnotation(description.getTestClass(), description.getMethodName(), KnownToFail.class);
+ return getAnnotation(description.getTestClass(), description.getMethodName(), KnownToFail.class);
}
public static Remote getRemote(Description description) {
- return (Remote) getAnnotation(description.getTestClass(), description.getMethodName(), Remote.class);
+ return getAnnotation(description.getTestClass(), description.getMethodName(), Remote.class);
}
diff -r d93aaf41548e -r 540234db8ce7 tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java
--- a/tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java Mon Dec 09 13:25:21 2013 +0100
+++ b/tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java Fri Dec 13 09:54:16 2013 +0100
@@ -32,10 +32,10 @@
import java.util.Map;
import java.util.Hashtable;
import java.util.List;
-import junit.framework.Assert;
import net.sourceforge.jnlp.cache.UpdatePolicy;
import net.sourceforge.jnlp.util.replacements.BASE64Encoder;
+import org.junit.Assert;
import org.junit.Test;
diff -r d93aaf41548e -r 540234db8ce7 tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java
--- a/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java Mon Dec 09 13:25:21 2013 +0100
+++ b/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java Fri Dec 13 09:54:16 2013 +0100
@@ -175,7 +175,7 @@
allLog("Checking for same items between " + resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " (should be " + resourceBundle1.getIdentifier() + " x " + resourceBundle2.getIdentifier() + ")");
int localErrors=0;
while (keys1.hasMoreElements()) {
- String key = (String) keys1.nextElement();
+ String key = keys1.nextElement();
String val1 = getMissingResourceAsEmpty(resourceBundle1.getBundle(), key);
String val2 = getMissingResourceAsEmpty(resourceBundle2.getBundle(), key);
outLog("\""+val1+"\" x \""+val2);
@@ -222,7 +222,7 @@
String id = secondary[i].getIdentifier();
allLog("Checking for missing strings in " + sec.getLocale() + " (should be " + id + ") compared with default");
while (keys.hasMoreElements()) {
- String key = (String) keys.nextElement();
+ String key = keys.nextElement();
String val1 = getMissingResourceAsEmpty(main.getBundle(), key);
String val2 = getMissingResourceAsEmpty(sec, key);
outLog("\""+val1+"\" x \""+val2);
@@ -257,7 +257,7 @@
allLog("Checking for empty items in " + resourceBundle.getLocale() + " (should be " + id + ")");
int localErrors=0;
while (keys.hasMoreElements()) {
- String key = (String) keys.nextElement();
+ String key = keys.nextElement();
String val = getMissingResourceAsEmpty(resourceBundle, key);
outLog("\""+key+"\" = \""+val);
if (val.trim().isEmpty()) {
@@ -285,7 +285,7 @@
outLog("Checking for redundant keys in " + sec.getLocale() + " (should be " + id + ") compared with default");
errLog("Checking for redundant keys in " + sec.getLocale() + " (should be " + id + ") compared with default");
while (keys.hasMoreElements()) {
- String key = (String) keys.nextElement();
+ String key = keys.nextElement();
String val2 = getMissingResourceAsEmpty(main.getBundle(), key);
String val1 = getMissingResourceAsEmpty(sec, key);
outLog("\""+val1+"\" x \""+val2);
diff -r d93aaf41548e -r 540234db8ce7 tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashUtilsTest.java
--- a/tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashUtilsTest.java Mon Dec 09 13:25:21 2013 +0100
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashUtilsTest.java Fri Dec 13 09:54:16 2013 +0100
@@ -44,11 +44,11 @@
public class ErrorSplashUtilsTest {
- private void fakeEnvironment(Map original) throws Exception {
+ private void fakeEnvironment(Map<String,String> original) throws Exception {
SplashUtilsTest.fakeEnvironment(original);
}
- private Map getEnvironment() throws Exception {
+ private Map<String,String> getEnvironment() throws Exception {
return SplashUtilsTest.getEnvironment();
}
@@ -64,8 +64,8 @@
@Test
public void testgetErrorSplashScreen1() throws Exception {
- Map fake1 = new HashMap();
- Map original = getEnvironment();
+ Map<String,String> fake1 = new HashMap<String,String>();
+ Map<String,String> original = getEnvironment();
Assert.assertNotNull(original);
try {
fakeEnvironment(fake1);
@@ -85,10 +85,10 @@
@Test
public void testgetErrorSplashScreen2() throws Exception {
- Map fake1 = new HashMap();
+ Map<String,String> fake1 = new HashMap<String,String>();
fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT);
fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.DEFAULT);
- Map original = getEnvironment();
+ Map<String,String> original = getEnvironment();
Assert.assertNotNull(original);
try {
fakeEnvironment(fake1);
@@ -107,10 +107,10 @@
@Test
public void testgetErrorSplashScreen3() throws Exception {
- Map fake1 = new HashMap();
+ Map<String,String> fake1 = new HashMap<String,String>();
fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.NONE);
fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.DEFAULT);
- Map original = getEnvironment();
+ Map<String,String> original = getEnvironment();
Assert.assertNotNull(original);
try {
fakeEnvironment(fake1);
@@ -129,10 +129,10 @@
@Test
public void testgetErrorSplashScreen4() throws Exception {
- Map fake1 = new HashMap();
+ Map<String,String> fake1 = new HashMap<String,String>();
fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT);
fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.NONE);
- Map original = getEnvironment();
+ Map<String,String> original = getEnvironment();
Assert.assertNotNull(original);
try {
fakeEnvironment(fake1);
@@ -151,10 +151,10 @@
@Test
public void testgetErrorSplashScreen5() throws Exception {
- Map fake1 = new HashMap();
+ Map<String,String> fake1 = new HashMap<String,String>();
fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.NONE);
fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.NONE);
- Map original = getEnvironment();
+ Map<String,String> original = getEnvironment();
Assert.assertNotNull(original);
try {
fakeEnvironment(fake1);
@@ -170,10 +170,10 @@
@Test
public void testgetErrorSplashScreen6() throws Exception {
- Map fake1 = new HashMap();
+ Map<String,String> fake1 = new HashMap<String,String>();
fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT);
fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, "fgdthyfjtuk");
- Map original = getEnvironment();
+ Map<String,String> original = getEnvironment();
Assert.assertNotNull(original);
try {
fakeEnvironment(fake1);
@@ -192,9 +192,9 @@
@Test
public void testgetErrorSplashScreen7() throws Exception {
- Map fake1 = new HashMap();
+ Map<String,String> fake1 = new HashMap<String,String>();
fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, "egtrutkyukl");
- Map original = getEnvironment();
+ Map<String,String> original = getEnvironment();
Assert.assertNotNull(original);
try {
fakeEnvironment(fake1);
diff -r d93aaf41548e -r 540234db8ce7 tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashUtilsTest.java
--- a/tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashUtilsTest.java Mon Dec 09 13:25:21 2013 +0100
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashUtilsTest.java Fri Dec 13 09:54:16 2013 +0100
@@ -59,10 +59,11 @@
Assert.assertEquals(SplashUtils.SplashReason.JAVAWS, p2.getSplashReason());
}
+ @SuppressWarnings("unchecked")
public static Map<String, String> getEnvironment() throws Exception {
- Class[] classes = Collections.class.getDeclaredClasses();
+ Class<?>[] classes = Collections.class.getDeclaredClasses();
Map<String, String> env = System.getenv();
- for (Class cl : classes) {
+ for (Class<?> cl : classes) {
if ("java.util.Collections$UnmodifiableMap".equals(cl.getName())) {
Field field = cl.getDeclaredField("m");
field.setAccessible(true);
@@ -74,10 +75,11 @@
return null;
}
+ @SuppressWarnings("unchecked")
public static void fakeEnvironment(Map<String, String> newenv) throws Exception {
- Class[] classes = Collections.class.getDeclaredClasses();
+ Class<?>[] classes = Collections.class.getDeclaredClasses();
Map<String, String> env = System.getenv();
- for (Class cl : classes) {
+ for (Class<?> cl : classes) {
if ("java.util.Collections$UnmodifiableMap".equals(cl.getName())) {
Field field = cl.getDeclaredField("m");
field.setAccessible(true);
@@ -91,8 +93,8 @@
@Test
public void testGetSplashScreen1() throws Exception {
- Map fake1 = new HashMap();
- Map original = getEnvironment();
+ Map<String,String> fake1 = new HashMap<String,String>();
+ Map<String,String> original = getEnvironment();
Assert.assertNotNull(original);
try {
fakeEnvironment(fake1);
@@ -112,10 +114,10 @@
@Test
public void testGetSplashScreen2() throws Exception {
- Map fake1 = new HashMap();
+ Map<String,String> fake1 = new HashMap<String,String>();
fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT);
fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.DEFAULT);
- Map original = getEnvironment();
+ Map<String,String> original = getEnvironment();
Assert.assertNotNull(original);
try {
fakeEnvironment(fake1);
@@ -134,10 +136,10 @@
@Test
public void testGetSplashScreen3() throws Exception {
- Map fake1 = new HashMap();
+ Map<String,String> fake1 = new HashMap<String,String>();
fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.NONE);
fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.DEFAULT);
- Map original = getEnvironment();
+ Map<String,String> original = getEnvironment();
Assert.assertNotNull(original);
try {
fakeEnvironment(fake1);
@@ -156,10 +158,10 @@
@Test
public void testGetSplashScreen4() throws Exception {
- Map fake1 = new HashMap();
+ Map<String,String> fake1 = new HashMap<String,String>();
fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT);
fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.NONE);
- Map original = getEnvironment();
+ Map<String,String> original = getEnvironment();
Assert.assertNotNull(original);
try {
fakeEnvironment(fake1);
@@ -178,10 +180,10 @@
@Test
public void testGetSplashScreen5() throws Exception {
- Map fake1 = new HashMap();
+ Map<String,String> fake1 = new HashMap<String,String>();
fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.NONE);
fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.NONE);
- Map original = getEnvironment();
+ Map<String,String> original = getEnvironment();
Assert.assertNotNull(original);
try {
fakeEnvironment(fake1);
@@ -197,10 +199,10 @@
@Test
public void testGetSplashScreen6() throws Exception {
- Map fake1 = new HashMap();
+ Map<String,String> fake1 = new HashMap<String,String>();
fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT);
fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, "fgdthyfjtuk");
- Map original = getEnvironment();
+ Map<String,String> original = getEnvironment();
Assert.assertNotNull(original);
try {
fakeEnvironment(fake1);
@@ -219,9 +221,9 @@
@Test
public void testGetSplashScreen7() throws Exception {
- Map fake1 = new HashMap();
+ Map<String,String> fake1 = new HashMap<String,String>();
fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, "egtrutkyukl");
- Map original = getEnvironment();
+ Map<String,String> original = getEnvironment();
Assert.assertNotNull(original);
try {
fakeEnvironment(fake1);
diff -r d93aaf41548e -r 540234db8ce7 tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItemTest.java
--- a/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItemTest.java Mon Dec 09 13:25:21 2013 +0100
+++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItemTest.java Fri Dec 13 09:54:16 2013 +0100
@@ -36,8 +36,8 @@
exception statement from your version. */
package net.sourceforge.jnlp.splashscreen.parts;
-import junit.framework.Assert;
import net.sourceforge.jnlp.ServerAccess;
+import org.junit.Assert;
import org.junit.Test;
public class DescriptionInfoItemTest {
diff -r d93aaf41548e -r 540234db8ce7 tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java
--- a/tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java Mon Dec 09 13:25:21 2013 +0100
+++ b/tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java Fri Dec 13 09:54:16 2013 +0100
@@ -42,8 +42,6 @@
import static org.junit.Assert.assertTrue;
import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
import java.net.URL;
import org.junit.Test;
@@ -134,7 +132,7 @@
for (String testPath : testPaths) {
File testFile = new File(testPath);
- URL notEncodedUrl = testFile.toURL();
+ URL notEncodedUrl = testFile.toURI().toURL();
URL encodedUrl = testFile.toURI().toURL();
assertEquals(testFile, UrlUtils.decodeUrlAsFile(notEncodedUrl));
assertEquals(testFile, UrlUtils.decodeUrlAsFile(encodedUrl));
diff -r d93aaf41548e -r 540234db8ce7 tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java
--- a/tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java Mon Dec 09 13:25:21 2013 +0100
+++ b/tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java Fri Dec 13 09:54:16 2013 +0100
@@ -84,7 +84,7 @@
backupedEnv = null;
} else {
backupedEnv = env;
- Map m = new HashMap(env);
+ Map<String,String> m = new HashMap<String,String>(env);
m.put(HOME, System.getProperty("user.home"));
fakeEnvironment(m);
ServerAccess.logOutputReprint("Hacked environment");
@@ -102,7 +102,7 @@
}
}
More information about the distro-pkg-dev
mailing list