move tests to separate project

This commit is contained in:
Hannes Janetzek
2014-03-29 12:54:12 +01:00
parent f75702a575
commit 2bf5313c2b
7 changed files with 24 additions and 13 deletions

View File

@@ -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();
}
}