Remove unused ServerConfig debugSql options, Update Tests to use agentloader

This commit is contained in:
Robin Bygrave
2013-04-29 22:42:27 +12:00
parent bb2479c9e7
commit 2f97c5c36e
217 changed files with 6351 additions and 6740 deletions
@@ -4,39 +4,41 @@ import java.sql.Timestamp;
import java.util.Arrays;
import junit.framework.Assert;
import junit.framework.TestCase;
import org.junit.Test;
import com.avaje.ebean.BaseTestCase;
import com.avaje.ebean.config.EncryptKey;
import com.avaje.ebeaninternal.server.type.SimpleAesEncryptor;
import com.avaje.tests.basic.encrypt.BasicEncryptKey;
public class TestSimpleEncryptor extends TestCase {
public class TestSimpleEncryptor extends BaseTestCase {
public void test() {
SimpleAesEncryptor e = new SimpleAesEncryptor();
EncryptKey key = new BasicEncryptKey("hello");
byte[] data = "test123".getBytes();
byte[] ecData = e.encrypt(data, key);
System.out.println(Arrays.toString(ecData));
byte[] deData = e.decrypt(ecData, key);
String s = new String(deData);
System.out.println(s);
Timestamp t = new Timestamp(System.currentTimeMillis());
byte[] ecTimestamp = e.encryptString(t.toString(), key);
System.out.println(t+" encrypted -> "+Arrays.toString(ecTimestamp));
String tsFormat = e.decryptString(ecTimestamp, key);
Timestamp t1 = Timestamp.valueOf(tsFormat);
Assert.assertEquals(t, t1);
}
@Test
public void test() {
SimpleAesEncryptor e = new SimpleAesEncryptor();
EncryptKey key = new BasicEncryptKey("hello");
byte[] data = "test123".getBytes();
byte[] ecData = e.encrypt(data, key);
System.out.println(Arrays.toString(ecData));
byte[] deData = e.decrypt(ecData, key);
String s = new String(deData);
System.out.println(s);
Timestamp t = new Timestamp(System.currentTimeMillis());
byte[] ecTimestamp = e.encryptString(t.toString(), key);
System.out.println(t + " encrypted -> " + Arrays.toString(ecTimestamp));
String tsFormat = e.decryptString(ecTimestamp, key);
Timestamp t1 = Timestamp.valueOf(tsFormat);
Assert.assertEquals(t, t1);
}
}