Fixes for tests

This commit is contained in:
serso 2016-01-05 17:34:03 +01:00
parent 60d65d52df
commit c015b44aa7
4 changed files with 20 additions and 17 deletions

View File

@ -61,7 +61,7 @@ repositories {
} }
dependencies { dependencies {
compile fileTree(dir: 'libs', include: ['*.jar']) compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'org.solovyev:common-core:1.0.7' compile 'org.solovyev:common-core:1.0.7'
compile 'org.solovyev:common-text:1.0.7' compile 'org.solovyev:common-text:1.0.7'
compile 'org.solovyev:common-security:1.0.7' compile 'org.solovyev:common-security:1.0.7'
@ -87,29 +87,28 @@ dependencies {
compile 'com.google.android.gms:play-services-analytics:8.4.0' compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.melnykov:floatingactionbutton:1.1.0' compile 'com.melnykov:floatingactionbutton:1.1.0'
compile(name: 'plotter', ext: 'aar') compile(name: 'plotter', ext: 'aar')
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1' debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1' releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
compile group: 'org.solovyev', name: 'common-text', version: '1.0.7' compile 'org.solovyev:common-text:1.0.7'
compile group: 'org.solovyev', name: 'common-listeners', version: '1.0.7' compile 'org.solovyev:common-listeners:1.0.7'
compile(group: 'com.google.guava', name: 'guava', version: '11.0.2') { compile('com.google.guava:guava:11.0.2') {
exclude(module: 'jsr305') exclude(module: 'jsr305')
} }
compile(group: 'org.solovyev', name: 'jscl', version: '1.0.11') { compile('org.solovyev:jscl:1.0.11') {
exclude(module: 'xercesImpl') exclude(module: 'xercesImpl')
} }
compile(group: 'org.simpleframework', name: 'simple-xml', version: '2.6.1') { compile('org.simpleframework:simple-xml:2.6.1') {
exclude(module: 'stax-api') exclude(module: 'stax-api')
exclude(module: 'xpp3') exclude(module: 'xpp3')
} }
compile group: 'commons-cli', name: 'commons-cli', version: '1.2' compile 'commons-cli:commons-cli:1.2'
testCompile group: 'junit', name: 'junit', version: '4.11' testCompile 'junit:junit:4.11'
testCompile group: 'net.sf.opencsv', name: 'opencsv', version: '2.0' testCompile 'net.sf.opencsv:opencsv:2.0'
testCompile group: 'org.mockito', name: 'mockito-core', version: '1.9.0' testCompile 'org.mockito:mockito-core:1.9.0'
testCompile "org.robolectric:robolectric:3.0" testCompile 'org.robolectric:robolectric:3.0'
testCompile 'org.mockito:mockito-all:1.9.5' testCompile 'org.mockito:mockito-all:1.9.5'
testCompile 'org.skyscreamer:jsonassert:1.2.3' testCompile 'org.skyscreamer:jsonassert:1.2.3'
testCompile (name: 'org.apache.http.legacy', ext: 'jar') testCompile(name: 'org.apache.http.legacy', ext: 'jar')
} }
tasks.withType(Test) { tasks.withType(Test) {

View File

@ -22,12 +22,15 @@
package org.solovyev.android.calculator; package org.solovyev.android.calculator;
import android.os.Build;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.solovyev.android.CalculatorTestRunner; import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;
import org.solovyev.common.text.Strings; import org.solovyev.common.text.Strings;
import java.util.Date; import java.util.Date;
@ -42,7 +45,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
* Time: 1:11 PM * Time: 1:11 PM
*/ */
@RunWith(value = CalculatorTestRunner.class) @Config(constants = BuildConfig.class, sdk = Build.VERSION_CODES.LOLLIPOP_MR1)
@RunWith(value = RobolectricGradleTestRunner.class)
public class AndroidCalculatorEditorViewTest { public class AndroidCalculatorEditorViewTest {
@BeforeClass @BeforeClass

View File

@ -26,7 +26,7 @@ import static org.solovyev.android.calculator.CalculatorEventType.display_state_
import static org.solovyev.android.calculator.CalculatorEventType.editor_state_changed; import static org.solovyev.android.calculator.CalculatorEventType.editor_state_changed;
import static org.solovyev.android.calculator.CalculatorEventType.editor_state_changed_light; import static org.solovyev.android.calculator.CalculatorEventType.editor_state_changed_light;
@Config(manifest = Config.NONE) @Config(constants = BuildConfig.class)
@RunWith(RobolectricGradleTestRunner.class) @RunWith(RobolectricGradleTestRunner.class)
public class CalculatorBroadcasterTest { public class CalculatorBroadcasterTest {

View File

@ -17,7 +17,7 @@ import static org.solovyev.android.calculator.CalculatorReceiver.ACTION_BUTTON_I
import static org.solovyev.android.calculator.CalculatorReceiver.ACTION_BUTTON_PRESSED; import static org.solovyev.android.calculator.CalculatorReceiver.ACTION_BUTTON_PRESSED;
import static org.solovyev.android.calculator.CalculatorReceiver.newButtonClickedIntent; import static org.solovyev.android.calculator.CalculatorReceiver.newButtonClickedIntent;
@Config(manifest = Config.NONE) @Config(constants = BuildConfig.class)
@RunWith(RobolectricGradleTestRunner.class) @RunWith(RobolectricGradleTestRunner.class)
public class CalculatorReceiverTest { public class CalculatorReceiverTest {