Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
64d42c3
Creating new sample project using Robolectric (no code coverage data …
alixwar Sep 28, 2017
9418b5d
Removed unused kotlin stuff
alixwar Sep 28, 2017
55169e0
Fixed serious issue with the sample
alixwar Sep 28, 2017
e6b1a3e
Removed strange final modifier
alixwar Sep 28, 2017
f3b7788
Improved sample with JUnit4 and JUnit5 tests (which generate coverage)
alixwar Sep 28, 2017
1a30abe
Refactoring: Name
alixwar Sep 28, 2017
51ae543
Added Mockito runner test
alixwar Sep 28, 2017
2090f60
Creating new sample project using Robolectric (no code coverage data …
alixwar Sep 28, 2017
fff1dc8
Removed unused kotlin stuff
alixwar Sep 28, 2017
c47428b
Fixed serious issue with the sample
alixwar Sep 28, 2017
addeea5
Removed strange final modifier
alixwar Sep 28, 2017
ecdae35
Improved sample with JUnit4 and JUnit5 tests (which generate coverage)
alixwar Sep 28, 2017
0f1d2a8
Refactoring: Name
alixwar Sep 28, 2017
8fbcf71
Added Mockito runner test
alixwar Sep 28, 2017
b997405
Merge branch 'master' of https://github.com/alixwar/android-junit5
alixwar Oct 10, 2017
186faf6
Getting the sample project up to speed with the rest of the modules
alixwar Oct 10, 2017
b931f24
Creating new sample project using Robolectric (no code coverage data …
alixwar Sep 28, 2017
bbb46c3
Removed unused kotlin stuff
alixwar Sep 28, 2017
fc43863
Fixed serious issue with the sample
alixwar Sep 28, 2017
6efa281
Removed strange final modifier
alixwar Sep 28, 2017
ec334d1
Improved sample with JUnit4 and JUnit5 tests (which generate coverage)
alixwar Sep 28, 2017
cba3542
Refactoring: Name
alixwar Sep 28, 2017
d5a0466
Added Mockito runner test
alixwar Sep 28, 2017
15e42a4
Creating new sample project using Robolectric (no code coverage data …
alixwar Sep 28, 2017
8dc3d0c
Fixed serious issue with the sample
alixwar Sep 28, 2017
1310d29
Removed strange final modifier
alixwar Sep 28, 2017
d0bd76e
Improved sample with JUnit4 and JUnit5 tests (which generate coverage)
alixwar Sep 28, 2017
a79df6c
Getting the sample project up to speed with the rest of the modules
alixwar Oct 10, 2017
01fd8fd
Merge remote-tracking branch 'origin/master'
alixwar Oct 10, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions sample-robolectric/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
buildscript {
ext.junit4Version = "4.12"
ext.robolectricVersion = "3.4.2"
ext.mockitoVersion = "1.10.19"

repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
google()
jcenter()
}

dependencies {
//noinspection GradleDynamicVersion
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.0.10"
classpath "com.android.tools.build:gradle:$ANDROID_PLUGIN_2X_VERSION"
}
}

apply plugin: "com.android.application"
apply plugin: "de.mannodermaus.android-junit5"
apply plugin: "jacoco"

android {
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// A Note to my forgetful self:
//
// When updating these values, make sure
// to always update the Travis CI .yml config
// & the plugin's AndroidJUnitPlatformSpec, too
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
compileSdkVersion 26
buildToolsVersion "26.0.2"

defaultConfig {
applicationId "de.mannodermaus.gradle.plugins.android_junit5.sample_robolectric"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
}

compileOptions {
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_7
}
}

dependencies {
testCompile junit5()
testCompile junit5Params()
testCompile "junit:junit:$junit4Version"
testCompile "org.robolectric:robolectric:$robolectricVersion"
testCompile "org.mockito:mockito-all:$mockitoVersion"
testCompile "de.mannodermaus.gradle.plugins:android-junit5-embedded-runtime:1.0.10"
}
2 changes: 2 additions & 0 deletions sample-robolectric/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!-- Nothing to see here, check out the "test" source set instead! -->
<manifest package="de.mannodermaus.gradle.plugins.android_junit5.sample_robolectric"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package de.mannodermaus.gradle.plugins.android_junit5.sample_robolectric;

public class Foo {

public int junit4() {
return -1;
}

public int junit4robolectric() {
return -1;
}

public int junit4mockito() {
return -1;
}

public int junit5() {
return -1;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package de.mannodermaus.gradle.plugins.android_junit5.sample_robolectric;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;

import static org.junit.Assert.assertEquals;

public class FooJunit4Test {

@Test
public void junit4codeCoverage() {
final int result = new Foo().junit4();

assertEquals(-1, result);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package de.mannodermaus.gradle.plugins.android_junit5.sample_robolectric;


import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

class FooJunit5Tests {

@Test
void junit5codeCoverage() {
final int result = new Foo().junit5();

assertEquals(-1, result);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package de.mannodermaus.gradle.plugins.android_junit5.sample_robolectric;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;

import static org.junit.Assert.assertEquals;

@RunWith(MockitoJUnitRunner.class)
public class FooMockitoTest {

@Test
public void mockitoCodeCoverage() {
final int result = new Foo().junit4mockito();

assertEquals(-1, result);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package de.mannodermaus.gradle.plugins.android_junit5.sample_robolectric;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;

import static org.junit.Assert.assertEquals;

@RunWith(RobolectricTestRunner.class)
public class FooRobolectricTest {

@Test
public void noCodeCoverage() {
final int result = new Foo().junit4robolectric();

assertEquals(-1, result);
}

}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ rootProject.name = GROUP_ID

include ':android-junit5'
include ':sample'
include ':sample-robolectric'
include ':android-junit5-embedded-runtime'