/** * Test the {@link Cryptor#encrypt} method. * @throws CryptoException */ @Test public void testPos_EncryptDecryptLongString() throws CryptoException { helpTestEncryptDecrypt( CLEARTEXT ); }
/** * Test the {@link Cryptor#encrypt} method. * @throws CryptoException */ @Test public void testPos_EncryptDecryptStringsOfBlanks() throws CryptoException { String BLANKS = " "; //$NON-NLS-1$ for ( int k = 1; k < BLANKS.length(); k++ ) { // Use substring starting at index 0, and 'k' characters long String cleartext = BLANKS.substring(0,k); helpTestEncryptDecrypt( cleartext ); } }
/** * Test the {@link Cryptor#encrypt} method. * @throws CryptoException */ @Test public void testPos_EncryptDecryptHalfLongString() throws CryptoException { helpTestEncryptDecrypt( CLEARTEXT.substring(0,CLEARTEXT.length()/2) ); }
/** * Test the {@link Cryptor#encrypt} method. * @throws CryptoException */ @Test public void testPos_EncryptDecryptStringsOfVariousLengths() throws CryptoException { for ( int k = 1; k < CLEARTEXT.length()/4; k++ ) { // Use substring starting at index k, and 'k' characters long String cleartext = CLEARTEXT.substring(k,k+k); helpTestEncryptDecrypt( cleartext ); } }
@Test public void testLongEncryption() throws Exception { helpTestEncryptDecrypt(CLEARTEXT + CLEARTEXT + CLEARTEXT); }