Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/KeyStoreTrustEngineTest.java')
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/KeyStoreTrustEngineTest.java27
1 files changed, 16 insertions, 11 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/KeyStoreTrustEngineTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/KeyStoreTrustEngineTest.java
index 35828dbdd..1f3e55f34 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/KeyStoreTrustEngineTest.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/KeyStoreTrustEngineTest.java
@@ -13,14 +13,19 @@
*******************************************************************************/
package org.eclipse.osgi.tests.security;
-import java.io.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
import java.net.URL;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.util.ArrayList;
-import junit.framework.*;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
import org.eclipse.osgi.internal.service.security.KeyStoreTrustEngine;
import org.eclipse.osgi.service.security.TrustEngine;
import org.eclipse.osgi.tests.OSGiTestsActivator;
@@ -31,8 +36,8 @@ public class KeyStoreTrustEngineTest extends TestCase {
private static String TYPE_DEFAULT = "JKS"; //$NON-NLS-1$
private static TestCase[] s_tests = {
- /* findTrustAnchor tests */
- new KeyStoreTrustEngineTest("findTrustAnchor positive test: self signed trusted", new String[] {"ca1_root"}) { //$NON-NLS-1$ //$NON-NLS-2$
+ /* findTrustAnchor tests */
+ new KeyStoreTrustEngineTest("findTrustAnchor positive test: self signed trusted", new String[] {"ca1_root"}) { //$NON-NLS-1$ //$NON-NLS-2$
public void runTest() {
testFindTrustAnchor0();
}
@@ -74,7 +79,7 @@ public class KeyStoreTrustEngineTest extends TestCase {
public void runTest() {
testAddTrustAnchor0();
}
- },/*, new KeyStoreTrustEngineTest("addTrustAnchor positive test: add with autogenerated alias", null) {
+ }, /*, new KeyStoreTrustEngineTest("addTrustAnchor positive test: add with autogenerated alias", null) {
public void runTest() {
testAddTrustAnchor1();
}
@@ -141,8 +146,8 @@ public class KeyStoreTrustEngineTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite("Unit tests for TrustEngine"); //$NON-NLS-1$
- for (int i = 0; i < s_tests.length; i++) {
- suite.addTest(s_tests[i]);
+ for (TestCase s_test : s_tests) {
+ suite.addTest(s_test);
}
return suite;
}
@@ -180,8 +185,8 @@ public class KeyStoreTrustEngineTest extends TestCase {
testStore = KeyStore.getInstance(TYPE_DEFAULT);
testStore.load(null, PASSWORD_DEFAULT);
if (aliases != null) {
- for (int i = 0; i < aliases.length; i++) {
- testStore.setCertificateEntry(aliases[i], getTestCertificate(aliases[i]));
+ for (String alias : aliases) {
+ testStore.setCertificateEntry(alias, getTestCertificate(alias));
}
}
testStoreFile = File.createTempFile("teststore", "jks"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -220,8 +225,8 @@ public class KeyStoreTrustEngineTest extends TestCase {
private static Certificate[] getTestCertificateChain(String[] aliases) throws KeyStoreException {
ArrayList certs = new ArrayList(aliases.length);
- for (int i = 0; i < aliases.length; i++) {
- certs.add(getTestCertificate(aliases[i]));
+ for (String alias : aliases) {
+ certs.add(getTestCertificate(alias));
}
return (Certificate[]) certs.toArray(new Certificate[] {});
}

Back to the top