1 64 65 package com.jcorporate.expresso.core.security; 66 67 import com.jcorporate.expresso.services.test.ExpressoTestCase; 68 import junit.framework.TestSuite; 69 70 71 77 public class CryptoTests 78 extends ExpressoTestCase { 79 private String [] testArray = { 80 "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+", 81 "abc", "rimo\n", "rimo\b\r\0", "rimovm01", "9123123456789", 82 "^\"\\...//?.<>" 83 }; 84 boolean usingStrongCrypto; 85 86 public CryptoTests(String testName) 87 throws Exception { 88 super(testName); 89 } 90 91 public static void main(String [] args) 92 throws Exception { 93 94 junit.textui.TestRunner.run(suite()); 96 } 97 98 public static junit.framework.Test suite() { 99 return new TestSuite(CryptoTests.class); 100 } 101 102 public void setUp() 103 throws Exception { 104 CryptoManager cm = CryptoManager.getInstance(); 105 usingStrongCrypto = cm.isUsingStrongCrypto(); 106 } 107 108 public void tearDown() 109 throws Exception { 110 CryptoManager cm = CryptoManager.getInstance(); 111 cm.loadClasses(usingStrongCrypto); 112 } 113 114 166 public void testWeakEncryption() 167 throws Exception { 168 } 179 180 public void testCryptoManager() 181 throws Exception { 182 CryptoManager cm = CryptoManager.getInstance(); 183 boolean usingStrongCrypto = cm.isUsingStrongCrypto(); 184 185 cm.loadClasses(true); 188 189 191 198 cm.loadClasses(false); 199 assertTrue("Got String Weak Encryption", 200 cm.getStringEncryption() instanceof com.jcorporate.expresso.core.security.weakencryption.StringEncryption); 201 } 202 } | Popular Tags |