Skip to content

Commit

Permalink
Update gradle to version 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Ademar Alves de Oliveira committed Jul 1, 2017
1 parent df14cf6 commit 258e4ec
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Encryption/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'java'

group 'se.simbio.encryption'
version '2.0.0'
version '2.0.1'

sourceCompatibility = 1.6

Expand Down Expand Up @@ -29,5 +29,5 @@ test {
}

dependencies {
testCompile 'junit:junit:4.12'
testImplementation 'junit:junit:4.12'
}
Binary file modified Encryption/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion Encryption/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip
13 changes: 11 additions & 2 deletions Encryption/test/se/simbio/encryption/EncryptionTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package se.simbio.encryption;

import junit.framework.TestCase;
import org.junit.Test;

import java.io.UnsupportedEncodingException;
import java.security.InvalidAlgorithmParameterException;
Expand All @@ -17,10 +17,15 @@

import third.part.android.util.Base64;

public class EncryptionTest extends TestCase {
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.fail;
import static org.junit.Assert.assertEquals;

public class EncryptionTest {

private final CountDownLatch mSignal = new CountDownLatch(1);

@Test
public void test_commonCase() {
Encryption encryption = Encryption.getDefault("JustAKey", "some_salt", new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 });
assertNotNull(encryption);
Expand All @@ -32,6 +37,7 @@ public void test_commonCase() {
assertEquals(secretText, decrypted);
}

@Test
public void test_randomText() {
String key = "$3creTQei";
String salt = "anotherS@lt";
Expand All @@ -53,6 +59,7 @@ public void test_randomText() {
assertEquals(decryptedText, textToEncrypt);
}

@Test
public void test_differentInstances() {
String key = "yekIsKeyInverted";
String salt = "tlAsIsSaltInverted";
Expand All @@ -69,6 +76,7 @@ public void test_differentInstances() {
assertEquals(decryptedText, textToEncrypt);
}

@Test
public void test_backgroundMode() throws Throwable {
final String key = "£øЯ€µ%!þZµµ";
final String salt = "background_S_al_t";
Expand Down Expand Up @@ -104,6 +112,7 @@ public void onError(Exception exception) {
mSignal.await(10, TimeUnit.SECONDS);
}

@Test
public void test_builder() throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, UnsupportedEncodingException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException, InvalidKeySpecException {
Encryption encryption = new Encryption.Builder()
.setKeyLength(128)
Expand Down

0 comments on commit 258e4ec

Please sign in to comment.