move tests to separate project
This commit is contained in:
parent
f75702a575
commit
2bf5313c2b
@ -1,4 +1,5 @@
|
||||
include ':vtm'
|
||||
include ':vtm-tests'
|
||||
include ':vtm-extras'
|
||||
include ':vtm-android'
|
||||
include ':vtm-android-example'
|
||||
|
15
vtm-tests/build.gradle
Normal file
15
vtm-tests/build.gradle
Normal file
@ -0,0 +1,15 @@
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven'
|
||||
|
||||
dependencies {
|
||||
compile project(':vtm')
|
||||
testCompile 'junit:junit:4.11'
|
||||
testCompile 'org.mockito:mockito-all:1.9.5'
|
||||
testCompile 'org.easytesting:fest-assert-core:2.0M10'
|
||||
testCompile 'com.squareup.okhttp:mockwebserver:1.5.2'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs = ['src']
|
||||
test.java.srcDirs = ['test']
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
package org.oscim.tiling.source.bitmap;
|
||||
|
||||
import static org.fest.assertions.api.Assertions.assertThat;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
import org.oscim.tiling.ITileDataSource;
|
||||
import org.oscim.tiling.source.LwHttp;
|
||||
import org.oscim.tiling.source.OkHttpEngine;
|
||||
|
||||
import static org.fest.assertions.api.Assertions.assertThat;
|
||||
import org.oscim.tiling.source.OkHttpEngine.OkHttpFactory;
|
||||
import org.oscim.tiling.source.UrlTileDataSource;
|
||||
|
||||
public class BitmapTileSourceTest {
|
||||
private BitmapTileSource tileSource;
|
||||
@ -24,7 +24,7 @@ public class BitmapTileSourceTest {
|
||||
|
||||
@Test
|
||||
public void shouldUseLwHttp() throws Exception {
|
||||
LwHttp lwHttp = Mockito.mock(LwHttp.class);
|
||||
LwHttpFactory lwHttp = Mockito.mock(LwHttpFactory.class);
|
||||
tileSource.setHttpEngine(lwHttp);
|
||||
ITileDataSource dataSource = tileSource.getDataSource();
|
||||
dataSource.destroy();
|
||||
@ -33,11 +33,11 @@ public class BitmapTileSourceTest {
|
||||
|
||||
@Test
|
||||
public void shouldUseOkHttp() throws Exception {
|
||||
OkHttpEngine okHttp = Mockito.mock(OkHttpEngine.class);
|
||||
OkHttpFactory okHttp = Mockito.mock(OkHttpFactory.class);
|
||||
tileSource.setHttpEngine(okHttp);
|
||||
ITileDataSource dataSource = tileSource.getDataSource();
|
||||
UrlTileDataSource dataSource = (UrlTileDataSource) tileSource.getDataSource();
|
||||
dataSource.destroy();
|
||||
Mockito.verify(okHttp).close();
|
||||
//Mockito.verify(dataSource.mConn).close();
|
||||
}
|
||||
|
||||
class TestBitmapTileSource extends BitmapTileSource {
|
@ -7,15 +7,10 @@ dependencies {
|
||||
compile 'org.slf4j:slf4j-api:1.7.6'
|
||||
compile 'com.squareup.okhttp:okhttp:1.5.2'
|
||||
providedCompile 'com.google.code.findbugs:annotations:2.0.1'
|
||||
testCompile 'junit:junit:4.11'
|
||||
testCompile 'org.mockito:mockito-all:1.9.5'
|
||||
testCompile 'org.easytesting:fest-assert-core:2.0M10'
|
||||
testCompile 'com.squareup.okhttp:mockwebserver:1.5.2'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs = ['src']
|
||||
test.java.srcDirs = ['test']
|
||||
main.resources.srcDirs = ['resources']
|
||||
main.compileClasspath += configurations.providedCompile
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user