Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 
 package eu.clarin.weblicht.wlfxb.tc.test;
 

Author(s):
Yana Panchenko
    private static final String INPUT_FILE_WITHOUT_LAYER = "/data/tc-geo/tcf-before.xml";
    private static final String INPUT_FILE_WITH_LAYER = "/data/tc-geo/tcf-after.xml";
    private static final String EXPECTED_OUTPUT_FILE = "/data/tc-geo/output-expected.xml";
    private static final String OUTPUT_FILE = "/tmp/output.xml";
            EnumSet.of(..);
    public static final String sampleToken = "Peter";
    public static final String sampleLon = "-94.62746";
    public static final String sampleLat = "39.11417";
    public static final double sampleAlt = 233;
    @Test
    public void testRead() throws Exception {
        GeoLayer layer = tc.getGeoLayer();
        Assert.assertEquals(1, layer.size());
        Assert.assertEquals("-94.62746"layer.getPoint(0).getLongitude());
        Assert.assertEquals(tc.getTokensLayer().getToken(0), layer.getTokens(layer.getPoint(0))[0]);
    }
    @Test
    public void testReadWrite() throws Exception {
        ..println(tc);
        // create geo layer, it's empty at first
        GeoLayer geo = tc.createGeoLayer("http://www.geonames.org/"..);
        for (int i = 0; i < tc.getTokensLayer().size(); i++) {
            Token token = tc.getTokensLayer().getToken(i);
            if (token.getString().equals()) {
                // create and add geo point to the geo layer
                geo.addPoint("Europe"nullnulltoken);
            }
        }
        // IMPORTANT close the streams!!!
        tc.close();
        ..println(tc);
        // compare output xml with expected xml
    }
New to GrepCode? Check out our FAQ X