PageRenderTime 24ms CodeModel.GetById 15ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/sigmah/src/test/java/org/sigmah/server/dao/BaseMapDAOTest.java

http://sigma-h.googlecode.com/
Java | 38 lines | 24 code | 9 blank | 5 comment | 1 complexity | 6801daea696c337866b775fcfa635acd MD5 | raw file
 1/*
 2 * All Sigmah code is released under the GNU General Public License v3
 3 * See COPYRIGHT.txt and LICENSE.txt.
 4 */
 5
 6package org.sigmah.server.dao;
 7
 8import org.junit.Assert;
 9import org.junit.Test;
10import org.sigmah.shared.map.LocalBaseMap;
11
12import java.io.File;
13import java.util.Properties;
14
15public class BaseMapDAOTest {
16
17    @Test
18    public void testBaseMapDAO() {
19
20        // check to see if the tiles folder exists; if not, skip this test
21        File tileRoot = new File("c:/tiles");
22        if (!tileRoot.isDirectory()) {
23            return;
24        }
25
26        BaseMapDAO dao = new BaseMapFsDAO(new Properties());
27        LocalBaseMap gray = (LocalBaseMap) dao.getBaseMap("zs.gray.cd");
28
29        Assert.assertEquals("Carte Gris avec Zones de Sante", gray.getName());
30        Assert.assertEquals("RGC", gray.getCopyright());
31        Assert.assertEquals("version", 1, gray.getVersion());
32        Assert.assertEquals("min zoom", 6, gray.getMinZoom());
33        Assert.assertEquals("max zoom", 9, gray.getMaxZoom());
34
35        File tile = new File(gray.getLocalTilePath(6, 34, 34));
36        Assert.assertTrue(tile.exists());
37    }
38}