Package de.alpengeist

Source Code of de.alpengeist.YahooTest

package de.alpengeist;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Test;
import twitter4j.internal.org.json.JSONObject;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;

public class YahooTest {
    private Logger log = LoggerFactory.getLogger(YahooTest.class);
    @Test
    public void testPlaces() throws Exception {
        YahooPlaces y = new YahooPlaces();
        JSONObject result = y.getPlace("Miesbach");
        log.info(result.toString(2));
        assertTrue(y.isOk(result));
        assertEquals(y.getLatitude(result), "47.789140");
        assertEquals(y.getLongitude(result), "11.833420");
        assertEquals(y.getGeoQuality(result), 40);
        assertEquals(y.getCountry(result), "Germany");

        result = y.getPlace("xxxxx");
        assertTrue(y.isOk(result));
        assertTrue(y.getFound(result) == 0);
    }
}
TOP

Related Classes of de.alpengeist.YahooTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.