diff options
author | Alexander Kurtakov | 2020-02-15 10:03:47 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2020-02-15 10:36:50 +0000 |
commit | 99321d4dddc7c2d17846cf87ec2eabd978d0fc2e (patch) | |
tree | f8e7ab5d6659823f5e71f3d7d850b0494ff0660c /bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/KeyStoreTrustEngineTest.java | |
parent | 343b30273359239e30550d401b063c8e5e5e746c (diff) | |
download | rt.equinox.framework-X20200218-0510.tar.gz rt.equinox.framework-X20200218-0510.tar.xz rt.equinox.framework-X20200218-0510.zip |
Convert osgi.tests to JUnit 4.Y20200409-0600Y20200407-0925Y20200407-0635Y20200407-0550Y20200318-0540Y20200317-0225Y20200316-1300Y20200316-0820Y20200314-1405Y20200313-1100Y20200311-0915Y20200310-0525Y20200305-0600Y20200225-1040Y20200219-1055Y20200219-0850Y20200218-1420Y20200218-1210Y20200218-0315Y20200218-0120X20200306-0700X20200305-1900X20200305-0700X20200304-1900X20200304-0700X20200303-1900X20200303-0700X20200302-1900X20200302-0930X20200302-0700X20200301-1900X20200301-0700X20200229-1900X20200229-0700X20200228-1900X20200228-0700X20200228-0520X20200227-1900X20200227-0700X20200227-0130X20200226-0700X20200225-1900X20200225-0700X20200224-1900X20200224-0700X20200223-1900X20200223-0700X20200223-0250X20200222-0700X20200221-1130X20200221-0700X20200221-0440X20200221-0310X20200221-0050X20200220-1900X20200220-0700X20200219-1900X20200219-0700X20200219-0500X20200218-0510X20200217-1120S4_15_0_RC2S4_15_0_RC1S4_15_0_M3R4_15I20200305-0155I20200304-1800I20200304-0600I20200303-1800I20200303-0600I20200302-1800I20200302-0600I20200301-2310I20200301-1800I20200301-0600I20200301-0030I20200229-1800I20200229-0600I20200228-1800I20200226-1800I20200226-0600I20200225-1800I20200225-0600I20200224-1800I20200224-0600I20200223-2335I20200223-1800I20200223-0600I20200222-1800I20200222-0600I20200221-1800I20200219-1800I20200219-0600I20200218-1800I20200218-0600I20200217-1800I20200217-0600I20200216-1800I20200216-1145I20200215-1800
Had to move to default eclipse formatter as the ancient one used simply
had no idea what to do with annotations.
Change-Id: I3dc61b31a2a5edf0da03ee17ed03d241c1178607
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
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.java | 82 |
1 files changed, 41 insertions, 41 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 7d37dbe52..0a6036961 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 @@ -32,7 +32,7 @@ import org.eclipse.osgi.tests.OSGiTestsActivator; public class KeyStoreTrustEngineTest extends TestCase { - private static char[] PASSWORD_DEFAULT = {'c', 'h', 'a', 'n', 'g', 'e', 'i', 't'}; + private static char[] PASSWORD_DEFAULT = { 'c', 'h', 'a', 'n', 'g', 'e', 'i', 't' }; private static String TYPE_DEFAULT = "JKS"; //$NON-NLS-1$ private static TestCase[] s_tests = { @@ -79,11 +79,11 @@ public class KeyStoreTrustEngineTest extends TestCase { public void runTest() { testAddTrustAnchor0(); } - }, /*, new KeyStoreTrustEngineTest("addTrustAnchor positive test: add with autogenerated alias", null) { - public void runTest() { - testAddTrustAnchor1(); - } - }*/ + }, /* + * , new + * KeyStoreTrustEngineTest("addTrustAnchor positive test: add with autogenerated alias" + * , null) { public void runTest() { testAddTrustAnchor1(); } } + */ new KeyStoreTrustEngineTest("addTrustAnchor negative test: null cert specified") { //$NON-NLS-1$ public void runTest() { testAddTrustAnchor2(); @@ -123,7 +123,7 @@ public class KeyStoreTrustEngineTest extends TestCase { testRemoveTrustAnchor5(); } }, - /* getTrustAnchor tests*/ + /* getTrustAnchor tests */ new KeyStoreTrustEngineTest("getTrustAnchor positive test: get by alias", "ca1_root") { //$NON-NLS-1$ //$NON-NLS-2$ public void runTest() { testGetTrustAnchor0(); @@ -142,7 +142,7 @@ public class KeyStoreTrustEngineTest extends TestCase { public void runTest() { testGetAliases0(); } - }}; + } }; public static Test suite() { TestSuite suite = new TestSuite("Unit tests for TrustEngine"); //$NON-NLS-1$ @@ -169,7 +169,7 @@ public class KeyStoreTrustEngineTest extends TestCase { TrustEngine engine; public KeyStoreTrustEngineTest() { - //placeholder + // placeholder } public KeyStoreTrustEngineTest(String name, String... aliases) { @@ -200,16 +200,16 @@ public class KeyStoreTrustEngineTest extends TestCase { } /** - * Closes a stream and ignores any resulting exception. This is useful - * when doing stream cleanup in a finally block where secondary exceptions - * are not worth logging. + * Closes a stream and ignores any resulting exception. This is useful when + * doing stream cleanup in a finally block where secondary exceptions are not + * worth logging. */ protected static void safeClose(OutputStream out) { try { if (out != null) out.close(); } catch (IOException e) { - //ignore + // ignore } } @@ -231,10 +231,10 @@ public class KeyStoreTrustEngineTest extends TestCase { return certs.toArray(new Certificate[] {}); } - //findTrustAnchor positive test: self signed trusted + // findTrustAnchor positive test: self signed trusted public void testFindTrustAnchor0() { try { - Certificate cert = engine.findTrustAnchor(new Certificate[] {getTestCertificate("ca1_root")}); //$NON-NLS-1$ + Certificate cert = engine.findTrustAnchor(new Certificate[] { getTestCertificate("ca1_root") }); //$NON-NLS-1$ assertNotNull("Did not return a cert for self-signed case", cert); //$NON-NLS-1$ assertEquals("Input and output certs not equal for self-signed case", cert, getTestCertificate("ca1_root")); //$NON-NLS-1$ //$NON-NLS-2$ } catch (Throwable t) { @@ -242,7 +242,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //findTrustAnchor positive test: chain with root trusted + // findTrustAnchor positive test: chain with root trusted public void testFindTrustAnchor1() { try { Certificate cert = engine.findTrustAnchor(getTestCertificateChain("ca1_leafb", "ca1_ou", "ca1_root")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ @@ -253,7 +253,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //findTrustAnchor positive test: chain with intermediate trusted + // findTrustAnchor positive test: chain with intermediate trusted public void testFindTrustAnchor2() { try { Certificate cert = engine.findTrustAnchor(getTestCertificateChain("ca1_leafb", "ca1_ou", "ca1_root")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ @@ -264,7 +264,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //findTrustAnchor positive test: chain with leaf trusted + // findTrustAnchor positive test: chain with leaf trusted public void testFindTrustAnchor3() { try { Certificate cert = engine.findTrustAnchor(getTestCertificateChain("ca1_leafb", "ca1_ou", "ca1_root")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ @@ -275,17 +275,17 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //findTrustAnchor negative test: untrusted self signed + // findTrustAnchor negative test: untrusted self signed public void testFindTrustAnchor4() { try { - Certificate cert = engine.findTrustAnchor(new Certificate[] {getTestCertificate("ca2_root")}); //$NON-NLS-1$ + Certificate cert = engine.findTrustAnchor(new Certificate[] { getTestCertificate("ca2_root") }); //$NON-NLS-1$ assertNull("Incorrectly returned a certificate for untrusted self-signed case", cert); //$NON-NLS-1$ } catch (Throwable t) { fail("Unexpected exception testing untrusted self-signed cert: " + t.getMessage()); //$NON-NLS-1$ } } - //findTrustAnchor negative test: untrusted chain + // findTrustAnchor negative test: untrusted chain public void testFindTrustAnchor5() { try { Certificate cert = engine.findTrustAnchor(getTestCertificateChain("ca2_leafb", "ca2_ou", "ca2_root")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ @@ -295,7 +295,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //findTrustAnchor negative test: invalid chain + // findTrustAnchor negative test: invalid chain public void testFindTrustAnchor6() { try { Certificate cert = engine.findTrustAnchor(getTestCertificateChain("ca2_leafa", "ca1_root")); //$NON-NLS-1$ //$NON-NLS-2$ @@ -305,7 +305,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //findTrustAnchor negative test: incomplete-able chain + // findTrustAnchor negative test: incomplete-able chain public void testFindTrustAnchor7() { try { Certificate cert = engine.findTrustAnchor(getTestCertificateChain("ca1_leafb", "ca1_root")); //$NON-NLS-1$ //$NON-NLS-2$ @@ -315,7 +315,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //findTrustAnchor negative test: null chain + // findTrustAnchor negative test: null chain public void testFindTrustAnchor8() { try { engine.findTrustAnchor(null); @@ -325,7 +325,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //testAddTrustAnchor positive test: add with alias + // testAddTrustAnchor positive test: add with alias public void testAddTrustAnchor0() { try { String alias = engine.addTrustAnchor(getTestCertificate("ca1_root"), "ca1_root"); //$NON-NLS-1$ //$NON-NLS-2$ @@ -336,7 +336,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //testAddTrustAnchor positive test: add with autogenerated alias + // testAddTrustAnchor positive test: add with autogenerated alias public void testAddTrustAnchor1() { try { String alias = engine.addTrustAnchor(getTestCertificate("ca1_root"), null); //$NON-NLS-1$ @@ -346,7 +346,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //testAddTrustAnchor negative test: null cert specified + // testAddTrustAnchor negative test: null cert specified public void testAddTrustAnchor2() { try { engine.addTrustAnchor(null, "ca1_root"); //$NON-NLS-1$ @@ -356,7 +356,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //testAddTrustAnchor negative test: existing cert specified + // testAddTrustAnchor negative test: existing cert specified public void testAddTrustAnchor3() { try { engine.addTrustAnchor(getTestCertificate("ca1_root"), "new_root"); //$NON-NLS-1$ //$NON-NLS-2$ @@ -368,7 +368,7 @@ public class KeyStoreTrustEngineTest extends TestCase { fail("Expected exception when adding trust anchor"); //$NON-NLS-1$ } - //testAddTrustAnchor negative test: existing alias specified + // testAddTrustAnchor negative test: existing alias specified public void testAddTrustAnchor4() { try { engine.addTrustAnchor(getTestCertificate("ca2_root"), "ca1_root"); //$NON-NLS-1$ //$NON-NLS-2$ @@ -380,7 +380,7 @@ public class KeyStoreTrustEngineTest extends TestCase { fail("Expected exception when adding trust anchor"); //$NON-NLS-1$ } - //removeTrustAnchor positive test: remove by alias + // removeTrustAnchor positive test: remove by alias public void testRemoveTrustAnchor0() { try { engine.removeTrustAnchor("ca1_root"); //$NON-NLS-1$ @@ -389,7 +389,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //removeTrustAnchor positive test: remove by cert + // removeTrustAnchor positive test: remove by cert public void testRemoveTrustAnchor1() { try { engine.removeTrustAnchor(getTestCertificate("ca1_root")); //$NON-NLS-1$ @@ -398,7 +398,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //removeTrustAnchor negative test: cert not found + // removeTrustAnchor negative test: cert not found public void testRemoveTrustAnchor2() { try { engine.removeTrustAnchor(getTestCertificate("ca1_root")); //$NON-NLS-1$ @@ -408,7 +408,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //removeTrustAnchor negative test: by alias not found + // removeTrustAnchor negative test: by alias not found public void testRemoveTrustAnchor3() { try { engine.removeTrustAnchor("ca2_root"); //$NON-NLS-1$ @@ -420,7 +420,7 @@ public class KeyStoreTrustEngineTest extends TestCase { fail("Expected exception when removing trust anchor"); //$NON-NLS-1$ } - //removeTrustAnchor negative test: remove by null alias + // removeTrustAnchor negative test: remove by null alias public void testRemoveTrustAnchor4() { try { engine.removeTrustAnchor((String) null); @@ -430,7 +430,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //removeTrustAnchor negative test: remove by null certificate + // removeTrustAnchor negative test: remove by null certificate public void testRemoveTrustAnchor5() { try { engine.removeTrustAnchor((Certificate) null); @@ -440,7 +440,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //getTrustAnchor positive test: get by alias + // getTrustAnchor positive test: get by alias public void testGetTrustAnchor0() { try { Certificate cert = engine.getTrustAnchor("ca1_root"); //$NON-NLS-1$ @@ -450,7 +450,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //getTrustAnchor negative test: get by null alias + // getTrustAnchor negative test: get by null alias public void testGetTrustAnchor1() { try { engine.getTrustAnchor(null); @@ -460,7 +460,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //getTrustAnchor negative test: does not exist + // getTrustAnchor negative test: does not exist public void testGetTrustAnchor2() { try { Certificate cert = engine.getTrustAnchor("ca2_root"); //$NON-NLS-1$ @@ -471,7 +471,7 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //getAliases positive test: get the alias list + // getAliases positive test: get the alias list public void testGetAliases0() { try { engine.getAliases(); @@ -480,6 +480,6 @@ public class KeyStoreTrustEngineTest extends TestCase { } } - //TODO: thread safety tests - //TODO: performance tests + // TODO: thread safety tests + // TODO: performance tests } |