mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-10 14:20:55 +00:00
activate junit tests in Shared, Tracker and Buoy projects (with some easy tests)
This commit is contained in:
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
|
||||
|
||||
+14
@@ -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);
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
@@ -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
|
||||
|
||||
+16
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user