move tests to separate project
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package org.oscim.tiling.source.oscimap4;
|
||||
|
||||
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;
|
||||
|
||||
public class OSciMap4TileSourceTest {
|
||||
private OSciMap4TileSource tileSource;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
tileSource = new OSciMap4TileSource("http://www.example.org/tiles/vtm");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldNotBeNull() throws Exception {
|
||||
assertThat(tileSource).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldUseLwHttp() throws Exception {
|
||||
LwHttp lwHttp = Mockito.mock(LwHttp.class);
|
||||
tileSource.setHttpEngine(lwHttp);
|
||||
ITileDataSource dataSource = tileSource.getDataSource();
|
||||
dataSource.destroy();
|
||||
Mockito.verify(lwHttp).close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldUseOkHttp() throws Exception {
|
||||
OkHttpEngine okHttp = Mockito.mock(OkHttpEngine.class);
|
||||
tileSource.setHttpEngine(okHttp);
|
||||
ITileDataSource dataSource = tileSource.getDataSource();
|
||||
dataSource.destroy();
|
||||
Mockito.verify(okHttp).close();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user