activate junit tests in Shared, Tracker and Buoy projects (with some easy tests)

This commit is contained in:
Peter Siegmund committed 2015-06-19 15:29:41 +02:00
1 parent 8ff5aea866
commit 88495f692f
7 files changed
+81 -11

No files matched your search

@@ -15,6 +15,10 @@ android {
java.srcDirs = ["src"]
res.srcDirs = ["res"]
}
test {
java.srcDirs = ["tests-jvm/src"]
}
}
signingConfigs {
@@ -46,6 +50,11 @@ dependencies {
/* Google Play Services */
compile "com.google.android.gms:play-services-location:7.3.0"
/* all local jar-libs */
compile fileTree(dir: "libs", include: ["*.jar"])
/* JVM tests */
testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:1.9.5"
}
@@ -26,9 +26,13 @@ android {
}
androidTest {
java.srcDirs = ["tests/src"]
res.srcDirs = ["tests/res"]
assets.srcDirs = ["tests/assets"]
java.srcDirs = ["tests-ui/src"]
res.srcDirs = ["tests-ui/res"]
assets.srcDirs = ["tests-ui/assets"]
}
test {
java.srcDirs = ["tests-jvm/src"]
}
}
@@ -64,7 +68,6 @@ android {
}
dependencies {
/* support libraries */
compile "com.android.support:appcompat-v7:22.1.1"
@@ -75,8 +78,20 @@ dependencies {
/* local dependencies */
compile project(":mobile:com.sap.sailing.android.shared")
/* all local jar-libs */
// compile fileTree(dir: "libs", include: ["*.jar"])
/* JVM tests */
testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:1.9.5"
/* UI testing with espresso */
androidTestCompile "com.android.support:support-annotations:22.1.1"
androidTestCompile "com.android.support.test:runner:0.2"
androidTestCompile "com.android.support.test:rules:0.2"
androidTestCompile "com.android.support.test.espresso:espresso-core:2.1"
androidTestCompile ("com.android.support.test.espresso:espresso-contrib:2.1") {
exclude group: "com.android.support", module: "appcompat"
exclude group: "com.android.support", module: "support-v4"
exclude module: "recyclerview-v7"
}
}
// Custom tasks
@@ -0,0 +1,14 @@
package com.sap.sailing.android.tracking.app.utils;
import org.junit.Test;
import static org.junit.Assert.assertNotNull;
public class ServiceHelperTest {
@Test
public void testServiceHelperConstructor() {
ServiceHelper serviceHelper = ServiceHelper.getInstance();
assertNotNull(serviceHelper);
}
}
@@ -26,9 +26,13 @@ android {
}
androidTest {
java.srcDirs = ["tests/src"]
res.srcDirs = ["tests/res"]
assets.srcDirs = ["tests/assets"]
java.srcDirs = ["tests-ui/src"]
res.srcDirs = ["tests-ui/res"]
assets.srcDirs = ["tests-ui/assets"]
}
test {
java.srcDirs = ["tests-jvm/src"]
}
}
@@ -73,8 +77,20 @@ dependencies {
/* local dependencies */
compile project(":mobile:com.sap.sailing.android.shared")
/* all local jar-libs */
// compile fileTree(dir: "libs", include: ["*.jar"])
/* JVM tests */
testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:1.9.5"
/* UI testing with espresso */
androidTestCompile "com.android.support:support-annotations:22.1.1"
androidTestCompile "com.android.support.test:runner:0.2"
androidTestCompile "com.android.support.test:rules:0.2"
androidTestCompile "com.android.support.test.espresso:espresso-core:2.1"
androidTestCompile ("com.android.support.test.espresso:espresso-contrib:2.1") {
exclude group: "com.android.support", module: "appcompat"
exclude group: "com.android.support", module: "support-v4"
exclude module: "recyclerview-v7"
}
}
// Custom tasks
@@ -0,0 +1,16 @@
package com.sap.sailing.android.buoy.positioning.app.valueobjects;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class MarkInfoTest {
@Test
public void testMarkInfoName() {
MarkInfo markInfo = new MarkInfo();
String name = "test";
markInfo.setName(name);
assertEquals(markInfo.getName(), name);
}
}