aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java11
-rw-r--r--tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java27
2 files changed, 12 insertions, 26 deletions
diff --git a/tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java b/tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java
index 169af7b..c3ff3a7 100644
--- a/tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java
+++ b/tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java
@@ -43,6 +43,7 @@ import static org.junit.Assert.fail;
import java.io.File;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
@@ -131,14 +132,6 @@ public class JNLPClassLoaderTest {
}
}
- static private <T> List<T> toList(T ... parts) {
- List<T> list = new ArrayList<T>();
- for (T part : parts) {
- list.add(part);
- }
- return list;
- }
-
/* Note: Although it does a basic check, this mainly checks for file-descriptor leak */
@Test
public void checkForMainFileLeakTest() throws Exception {
@@ -152,7 +145,7 @@ public class JNLPClassLoaderTest {
@Override
public void run() {
try {
- classLoader.checkForMain(toList(jnlpFile.jarDesc));
+ classLoader.checkForMain(Arrays.asList(jnlpFile.jarDesc));
} catch (LaunchException e) {
fail(e.toString());
}
diff --git a/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java b/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java
index 31da5d3..0ec85de 100644
--- a/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java
+++ b/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java
@@ -4,36 +4,29 @@ import static org.junit.Assert.assertEquals;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.junit.Test;
public class UnsignedAppletTrustConfirmationTest {
- private List<String> toList(String ... parts) {
- List<String> list = new ArrayList<String>();
- for (String part : parts) {
- list.add(part);
- }
- return list;
- }
-
@Test
public void testToRelativePaths() throws Exception {
/* Absolute -> Relative */
- assertEquals(toList("test.jar"),
- UnsignedAppletTrustConfirmation.toRelativePaths(toList("http://example.com/test.jar"), "http://example.com/"));
+ assertEquals(Arrays.asList("test.jar"),
+ UnsignedAppletTrustConfirmation.toRelativePaths(Arrays.asList("http://example.com/test.jar"), "http://example.com/"));
/* Relative is unchanged */
- assertEquals(toList("test.jar"),
- UnsignedAppletTrustConfirmation.toRelativePaths(toList("test.jar"), "http://example.com/"));
+ assertEquals(Arrays.asList("test.jar"),
+ UnsignedAppletTrustConfirmation.toRelativePaths(Arrays.asList("test.jar"), "http://example.com/"));
/* Different root URL is unchanged */
- assertEquals(toList("http://example2.com/test.jar"),
- UnsignedAppletTrustConfirmation.toRelativePaths(toList("http://example2.com/test.jar"), "http://example.com/"));
+ assertEquals(Arrays.asList("http://example2.com/test.jar"),
+ UnsignedAppletTrustConfirmation.toRelativePaths(Arrays.asList("http://example2.com/test.jar"), "http://example.com/"));
/* Path with invalid URL characters is handled */
- assertEquals(toList("test .jar"),
- UnsignedAppletTrustConfirmation.toRelativePaths(toList("http://example.com/test .jar"), "http://example.com/"));
+ assertEquals(Arrays.asList("test .jar"),
+ UnsignedAppletTrustConfirmation.toRelativePaths(Arrays.asList("http://example.com/test .jar"), "http://example.com/"));
}
-} \ No newline at end of file
+}