Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
Fix: Fixed and improved Unit Tests
Browse files Browse the repository at this point in the history
Signed-off-by: Meddy Menzikoff <m.menzikoff@oneclickflare.fr>
  • Loading branch information
ocfmem committed Feb 27, 2020
1 parent 103a161 commit fcae6a3
Show file tree
Hide file tree
Showing 12 changed files with 498 additions and 783 deletions.
20 changes: 10 additions & 10 deletions android/keyple-plugin/android-nfc/build.gradle
Expand Up @@ -41,7 +41,10 @@ android {
}

testOptions {
unitTests.returnDefaultValues = true//mock Log Android object
unitTests {
returnDefaultValues = true//mock Log Android object
includeAndroidResources = true
}
}


Expand Down Expand Up @@ -223,16 +226,13 @@ dependencies {
/*
Tests
*/
/** Test **/
testImplementation "junit:junit:4.12"

testImplementation "junit:junit:${junit_version}"

/**Power mock**/
androidTestImplementation "org.mockito:mockito-android:${mockito_android_version}"
androidTestImplementation "org.powermock:powermock-api-mockito:${powermock_version}"
androidTestImplementation "org.powermock:powermock-module-junit4:${powermock_version}"
/** Mocking for tests **/
testImplementation "io.mockk:mockk:1.9"

testImplementation "org.powermock:powermock-api-mockito:${powermock_version}"
testImplementation "org.powermock:powermock-module-junit4:${powermock_version}"
/**End of power mock **/
/** Allow to use Android SDK in JVM */
testImplementation 'org.robolectric:robolectric:4.3.1'

}

This file was deleted.

Expand Up @@ -11,12 +11,10 @@
********************************************************************************/
package org.eclipse.keyple.plugin.android.nfc

import android.annotation.TargetApi
import android.app.Activity
import android.content.Intent
import android.nfc.NfcAdapter
import android.nfc.Tag
import android.os.Build
import android.os.Bundle
import org.eclipse.keyple.core.seproxy.exception.KeypleChannelControlException
import org.eclipse.keyple.core.seproxy.exception.KeypleIOReaderException
Expand Down Expand Up @@ -204,16 +202,16 @@ internal object AndroidNfcReaderImpl : AbstractObservableLocalReader(AndroidNfcR
}
}

@TargetApi(24)
private fun addRemovedListener(tag: Tag?) {

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
nfcAdapter?.ignore(tag, 1000, {
Timber.i("Tag Proxy removed")
tagProxy = null
}, null)
}
}
// @TargetApi(24)
// private fun addRemovedListener(tag: Tag?) {
//
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
// nfcAdapter?.ignore(tag, 1000, {
// Timber.i("Tag Proxy removed")
// tagProxy = null
// }, null)
// }
// }

/**
*
Expand Down
14 changes: 0 additions & 14 deletions android/keyple-plugin/android-nfc/src/test/assets/logback.xml

This file was deleted.

This file was deleted.

0 comments on commit fcae6a3

Please sign in to comment.